home *** CD-ROM | disk | FTP | other *** search
- <%
-
- ' Save URL of calling page as needed
- SetURLCallHIW
-
- %>
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
- <HTML>
- <HEAD>
- <!--META TAGS ARE RECOMMENDED FOR THE SEARCH ENGINE-->
- <META NAME="DESCRIPTION" CONTENT="How It Works Page">
- <META NAME="KEYWORDS" CONTENT="help, code, source code, questions, explanation">
- <META NAME="GENERATOR" CONTENT="Microsoft Visual InterDev 1.0">
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1">
- <!--END META TAGS-->
-
- <TITLE>How This Page Works</TITLE>
- </HEAD>
-
- <BODY BGCOLOR=#FFFFFF TOPMARGIN=0 LEFTMARGIN=0 ALINK=#23238E VLINK=#808080 LINK=#FFCC00>
- <BASEFONT FACE="VERDANA, ARIAL, HELVETICA" SIZE=2>
-
- <!--Change link color on mouseover
- Only if running Internet Explorer 4.0 or later -->
- <!--#include file=../libHighlight.inc-->
-
- <!--BEGIN TOP TABLE HOLDING GRAPHIC, NAVIGATIONAL LINK, AND MAIN CONTENT-->
- <TABLE WIDTH="100%" HEIGHT="100%" CELLPADDING=0 CELLSPACING=0 BGCOLOR="#000000" BORDER=0>
- <TR>
- <TD BGCOLOR="#000000" ALIGN=CENTER VALIGN=TOP WIDTH=170>
- <BR>
- <IMG SRC="../images/btslarge.jpg" HEIGHT=119 WIDTH=171
- ALT="Behind the Scenes at Exploration Air" BORDER=0 >
- <BR>
- <BR>
- <BR>
- <!--BACK BUTTON AND VARIABLE TO RETURN TO ORIGINATING PAGE-->
- <A HREF="<%=Session("URLCallHIW")%>">
- <IMG SRC="../images/barrowy.gif" HEIGHT=8 WIDTH=8 ALT="Return to Exploration Air Benefits"
- HSPACE=2 BORDER=0>
- </A>
- <FONT SIZE=2 FACE="VERDANA, ARIAL, HELVETICA"><STRONG>
- <A HREF="<%=Session("URLCallHIW")%>" TITLE="Return to Exploration Air Benefits">
- B A C K
- </A>
- </STRONG></FONT>
- <BR>
- <BR>
- <!--JAVASCRIPT TO VIEW PAGE'S SOURCE CODE-->
- <FONT SIZE=2 FACE="VERDANA, ARIAL, HELVETICA">
- <A HREF="JavaScript:openWindow('../Benefits/EmpProfile.asp')"
- TITLE="View the Source for the Employee Profile page">
- V I E W S O U R C E
- </A>
- <BR>
- </FONT>
- </TD>
- <TD BGCOLOR="#FFFFFF" BACKGROUND="../images/btsbg.gif" VALIGN=top>
- <BR CLEAR=ALL>
- <TABLE CELLPADDING=10 CELLSPACING=0 BORDER=0>
- <TR>
- <TD VALIGN=top>
- <FONT FACE="VERDANA, ARIAL, HELVETICA" COLOR="#0000FF" SIZE=5>
- How The Employee Profile Page Works
- </FONT>
- <P>
- <HR>
- <FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="3">
-
- <H2>The Big Picture</H2>
-
- This page is used to enter employee information such as address, phone number, etc.
- It also has a button that will take you to the page for adding a dependent.
-
- <H2>Functional Overview</H2>
-
- As on most other pages in the Benefits application, a few standard tasks are
- done at the top of the page. The first is that VBScript is declared the default
- scripting language for the page. Next, "TRANSACTION=REQUIRED" is specified to cause
- Microsoft Transaction Server to wrap the actions of the page in a transaction.
- Then, "Option Explicit" is specified so that an error will generate unless
- all the variables on the page are explicitly declared. This protects against
- errors caused by misspelling a variable name and having the server treat
- the misspelled variable name as a new variable declaration.
-
- <P>Next, libAuthenticate.inc checks whether the user has a Session variable containing
- the EmployeeId. If not, then the request is redirected to Benefits/Default.asp
- to ensure that the application is properly initialized for the user.
-
- <P>Next, page variables are initialized, then the subprocedure GetValuesFromDatabase
- is called to get the current employee profile information from the database
- by calling the component method
- <STRONG><A HREF=HIWBenefitsComponent.asp#GetForID>
- Employee.GetForID</A></STRONG>.
-
- <P>The subprocedure BuildGenderList is called to create a select list of
- the available Genders from the database by calling the component method
- <STRONG><A HREF=HIWBenefitsComponent.asp#GenderList>
- BenefitList.GenderList</A></STRONG>
-
- <P>A table of dependent records for the employee
- are created by the subprocedure ListDependents, which retrieves records from
- the database by calling <STRONG><A HREF=HIWBenefitsComponent.asp#GetDependents>
- Employee.GetDependents</A></STRONG>.
-
- <P>The page is sent to the client
- browser for entry of the dependent information. A client-side script is run to validate
- the data entered, then the data is sent to the server. The server runs a
- subprocedure to get the data into the appropriate fields, then calls the function
- "UpdateDatabase". The UpdateDatabase function calls
- the component method <STRONG><A HREF=HIWBenefitsComponent.asp#UpdateEmployee>
- Employee.Update</A></STRONG> to update the employee records.
-
- <P>The UpdateDatabase function calls the component method
- <STRONG><A HREF=HIWBenefitsComponent.asp#UpdateDependent>Employee.UpdateDependent</A></STRONG>
- to update dependent records.
-
- <P>The UpdateDatabase function then calls the component method
- <STRONG><A HREF=HIWBenefitsComponent.asp#RemoveDependent>
- Employee.RemoveDependent</A></STRONG> to remove any dependents who are marked for
- removal from the employee records.
-
- <P>If the <STRONG>Add Dependent</STRONG> button is clicked, the page will redirect to
- <STRONG>DependentAdd.asp</STRONG> after updating the employee tables.
-
- <H2>Data Model</H2>
-
- You can view a diagram of the <STRONG><A HREF="HIWBenefitsSchema.asp">database</A></STRONG>.
-
- <P>
- <H2>Components Used</H2>
-
- This pages uses methods in the BenefitList class of the Benefit component.
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#GetForID>Employee.GetForID</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#GenderList>BenefitList.GenderList</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#GetDependents>Employee.GetDependents</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#UpdateEmployee>Employee.Update</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#UpdateDependent>Employee.UpdateDependent</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#RemoveDependent>Employee.RemoveDependent</A></STRONG>
- <P>
- </FONT>
- </TD>
- </TR>
- </TABLE>
- <!--END TOP TABLE HOLDING GRAPHIC, NAVIGATIONAL LINK, AND MAIN CONTENT-->
-
- <BR>
- <BR>
-
- <CENTER>
- <!--BEGIN LEGAL INFORMATION-->
- <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0>
- <TR>
- <TD>
- <FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="1">
- <A HREF="../legal.htm">
- ©1997 Microsoft Corporation. All rights reserved. Terms of Use.
- </A>
- </FONT>
- <P>
- </TD>
- </TR>
- </TABLE>
- </CENTER>
- <!--END LEGAL INFORMATION-->
- </TD>
- </TR>
- </TABLE>
-
- </BODY>
- </HTML>
- <!--END HTML-->
-
- <SCRIPT LANGUAGE="JavaScript">
- function openWindow(SourceURL)
- {
- // Set some defaults
- width=450;
- height=450;
-
- url = "code.asp?Source=" + SourceURL;
- window.open(url,"Sample","resizable=yes,scrollbars=yes,width=" + width + ",height=" + height);
- }
- </SCRIPT>
-
- <%
-
- '
- ' SetURLCallHIW saves the name of the page in the application that called HIW page
- '
- Sub SetURLCallHIW
- ' Extract the last directory from path
- Dim strPathInfo, strLastChar, intLocation, ShortString, strLastDir
- strPathInfo = Request.ServerVariables("HTTP_REFERER")
- ' now str has a value like: "http://servername/exair/benefits/Default.asp"
- ' we need to extract "benefits"
- strLastChar = ""
- ShortString = strPathInfo
- intLocation = 0
-
- If Len(ShortString) > 0 Then
- ' Get position of beginning of file name
- Do Until strLastChar = "/"
- strLastChar = right(ShortString, 1)
- ShortString = left(ShortString, len(ShortString)-1)
- intLocation = intLocation + 1
- Loop
-
- ' Now get position of beginning of last directory name
- strLastChar = ""
- Do Until strLastChar = "/"
- strLastChar = right(ShortString, 1)
- ShortString = left(ShortString, len(ShortString)-1)
- intLocation = intLocation + 1
- Loop
- strLastDir = mid(strPathInfo, len(strPathInfo) - (intLocation - 2), 10)
-
- ' If last directory not 'HowItWorks', then save the calling URL
- If strLastDir <> "HowItWorks" Then
- Session("URLCallHIW") = strPathInfo
- End If
- End If
- End Sub
-
- %>
-