home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 February
/
CHIP_2_98.iso
/
software
/
pelne
/
optionp
/
iis4_07.cab
/
HIWBenefitsSummary.asp
< prev
next >
Wrap
Text File
|
1997-11-01
|
9KB
|
222 lines
<%
' 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 Summary 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/Benefits.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 Summary Page Works
</FONT>
<P>
<HR>
<FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="3">
<H2>The Big Picture</H2>
This page displays the employee's current benefits, and links that the employee can click
to review or change individual benefit choices.
<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>This page is generated to either "Review/Change Current Benefits" or for "Open Enrollment".
This is determined by checking the "Review" parameter of the query string. A parameter of 0
means this page should generate for Open Enrollment. A parameter of 1
means this page should generate for Review.
<P>If the page is prepared for Open Enrollment, a check is made of whether the employee
has already been in open enrollment for the coming benefit year. If not, the component
method
<STRONG><A HREF=HIWBenefitsComponent.asp#NewBenefits>Employee.NewBenefits</A></STRONG>
is called, specifying the new benefit year. This component creates records
in the Benefits database for the benefits that have been created for the next year.
<P>Next, four subprocedures are run to get subtotals of the employee's benefits
information. These subprocedures call component methods which get information from the
database and compute the totals. The methods called are
<STRONG><A HREF=HIWBenefitsComponent.asp#GetTotalCost>BenefitList.GetTotalCost</A></STRONG>
(called once with a parameter for After-tax total and again with a parameter for Pre-tax total),
<STRONG><A HREF=HIWBenefitsComponent.asp#GetTotalCredits>BenefitList.GetTotalCredits</A></STRONG>,
and
<STRONG><A HREF=HIWBenefitsComponent.asp#GetTotalPaycheck>BenefitList.GetTotalPaycheck</A></STRONG>.
<P>Now the HTML page is written. One of the first things that happens is that an include
file tests whether the client browser is Internet Explorer 4.0 or later. If so, then
two functions are included in the page that will change the color of links
whenever the mouse passes over them.
<P>A subprocedure called ListBenefitSummary runs to generate the table in the middle
of the page. This subprocedure calls the component method
<STRONG><A HREF=HIWBenefitsComponent.asp#SummaryForID>BenefitList.SummaryForID</A></STRONG>
to prepare a recordset of data that will be generated into a table by the ASP script.
<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 Employee class and the BenefitList class of the
Benefit component.
<BR><STRONG><A HREF=HIWBenefitsComponent.asp#NewBenefits>Employee.NewBenefits</A></STRONG>
<BR><STRONG><A HREF=HIWBenefitsComponent.asp#GetTotalCost>BenefitList.GetTotalCost</A></STRONG>
<BR><STRONG><A HREF=HIWBenefitsComponent.asp#GetTotalCredits>BenefitList.GetTotalCredits</A></STRONG>
<BR><STRONG><A HREF=HIWBenefitsComponent.asp#GetTotalPaycheck>BenefitList.GetTotalPaycheck</A></STRONG>
<BR><STRONG><A HREF=HIWBenefitsComponent.asp#SummaryForID>BenefitList.SummaryForID</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
%>