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 The Benefits Detail 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/DetailInsurance.asp')"
- TITLE="View the Source for the Default 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 Benefits Detail Page Works
- </FONT>
- <P>
- <HR>
- <FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="3">
-
- <H2>The Big Picture</H2>
-
- The Benefits Detail page displays information about the benefit which was chosen by clicking
- a link on the
- Benefits Summary page. This page can be generated for different benefits, with the particular
- benefit specified as a parameter in calling the ASP script. This page is updateable if
- the employee has a qualifying change in effect. A qualifying change means that the
- employee has experienced a recent marriage, childbirth, and so on.
-
- <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 set according to whether the employee clicked <STRONG>Open
- Enrollment</STRONG> or <STRONG>Review/Change Current Benefits</STRONG>.
-
- <P>If the page is in review/change mode, then the subprocedure <STRONG>CheckQualifier</STRONG>
- is run to determine if the employee currently has a qualifying change in effect.
- <STRONG>CheckQualifier</STRONG> calls the component method
- <STRONG><A HREF=HIWBenefitsComponent.asp#CheckQualifier>BenefitList.CheckQualifier</A></STRONG>
- to return information from the database.
- If the employee has a qualifier in effect, then the page will be generated to
- let the employee change benefit options, such as the plan they are covered
- under, which dependents are covered, and whether Pre-tax or After-tax earnings
- will be used to pay the cost of the insurance.
-
- <P>The next step is to process the incoming parameters if this page is calling itself.
- ASP scripts commonly combine page generation and input processing on the same
- page. This means that the same page may both generate the data input form, and also
- update the database with the information that was input on the form.
-
- <P>This concept can take some time to get used to. The important point to remember is
- that the page requires conditional code to know how to process incoming data,
- and a different processing path if it is called from another page than if it calls
- itself. In this page, this is accomplished by testing whether the Form input
- parameters include "SubmitPlan". If they do, then the page is being called
- by itself, so the page correctly processes the input parameters.
-
- <P>Next, this page determines whether it should use Remote Data Services (RDS).
- It does this by checking the Session
- variable "UseRDS". If so, then the page will be generated
- to use RDS, otherwise it will be generated to use regular HTML. The advantage of
- using RDS in this case is that all the relevant options for the
- different plans can be loaded on the client machine, so the client does not need a round trip
- to the server to get information on other plans that the employee wants to see.
-
- <P>This page uses two data binding controls in RDS mode. The first is used to
- populate multiple HTML fields (SPAN elements). The second is used to populate a table.
- Both controls present the data in view-only mode, with no update capabilities
- implemented.
-
- <P>Whether the page uses RDS or not, the information displayed is conditioned on
- the selected benefit and plan. For example, if the benefit does not cover dependents,
- dependent information will not be displayed. If the plan does not require designation
- of a physician, the physician field will not be displayed. This feature is accomplished
- through Dynamic HTML if RDS is used, or through server-side scripting if RDS is
- not used.
-
- <P>This page will accurately reflect the state of the
- application and data. For example, if the client browser is at the end of the
- RDS recordset, the "Next" and "Last" buttons are disabled. If the user is not
- qualified to make changes, the fields all appear as display only.
-
- <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#CheckQualifier>BenefitList.CheckQualifier</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#CurrentPlan>BenefitList.CurrentPlan</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#PlanInfo>BenefitList.PlanInfo</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#PlanList>BenefitList.PlanList</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#PlanField>BenefitList.PlanField</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#ListDependents>BenefitList.ListDependents</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#ListCoveredPersons>BenefitList.ListCoveredPersons</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#PhysicianList>BenefitList.PhysicianList</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#TaxStatusList>BenefitList.TaxStatusList</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#UpdateBenefitList>BenefitList.Update</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#InactivateDependents>BenefitList.InactivateDependents</A></STRONG>
- <BR><STRONG><A HREF=HIWBenefitsComponent.asp#SaveDependents>BenefitList.SaveDependents</A></STRONG>
-
- <P>
- </FONT>
- </TD>
- </TR>
- </TABLE>
- <!--END TOP TABLE HOLDING GRAPHIC, NAVIGATIONAL LINK, AND MAIN CONTENT-->
-
- <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
-
- %>
-