home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 September
/
CHIPCD_9_99.iso
/
software
/
uaktualnienia
/
OptionPackPL
/
iis4_07.cab
/
HIWBenefitsComponent.asp
< prev
next >
Wrap
Text File
|
1998-04-27
|
41KB
|
1,261 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 Benefit Component 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>
</TD>
<TD BGCOLOR="#FFFFFF" BACKGROUND="../images/btsbg.gif" VALIGN=top>
<BR CLEAR=ALL>
<TABLE WIDTH="100%" CELLPADDING=10 CELLSPACING=0 BORDER=0>
<TR>
<TD VALIGN=top>
<FONT FACE="VERDANA, ARIAL, HELVETICA" COLOR="#0000FF" SIZE=5>
How The Benefit Component Works
</FONT>
<P>
<HR>
<FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="3">
<H2>The Big Picture</H2>
The Exploration Air Employee Benefits application uses the component <STRONG>Benefit</STRONG>,
which has two classes; <STRONG><A HREF=#BenefitList>BenefitList</A></STRONG> and
<STRONG><A HREF=#Employee>Employee</A></STRONG>.
The purpose of the methods is to encapsulate a specific function
so that the ASP pages can have a defined interface to accomplish work, without concern
for the details of how the work is done.
<H2>Why Benefits Uses Components</H2>
<P>The use of components has two advantages for the
application developer. First, as changes to the ASP pages are made, the method calls
to the components do not change (unless different functionality is required
from the component). This reduces the complexity of the ASP page and reduces
the likelihood of introducing new bugs through modification of the existing ASP pages.
The second advantage is that the methods can be called by
other applications. For example, the Benefits
application calls the <STRONG><A HREF=#NewBenefits>NewBenefits</A></STRONG>
method of the <STRONG><A HREF=#Employee>Employee</A></STRONG>
component to create the default benefit records for a specified employee. If you had
another application that you wanted to use to set up new employees,
you could have the other application call the <STRONG><A HREF=#NewBenefits>NewBenefits</A></STRONG>
method
to add default benefits.
<H2>Design Goals</H2>
The design goal of the component was to create methods that encapsulate a single logical
function, such as add a new employee, or return a list of an employee's dependents. Some
methods call other methods in order to accomplish their function, as when the
<STRONG><A HREF=#AddNew>Employee.AddNew</A></STRONG> method calls the
<STRONG><A HREF=#NewBenefits>Employee.NewBenefits</A></STRONG>
method to add the benefit records.
<P>All of the methods in the <STRONG>Benefit</STRONG> component require passing the name
of the file DSN to be used
by the method. This makes it easier to use different databases from the same set of ASP pages.
<H2>Architectural Details</H2>
Both of the classes in the <STRONG>Benefit</STRONG> component are contained in the
Microsoft Transaction Server (MTS) package called <STRONG>Benefit</STRONG>, and are run
by <STRONG>Benefit.dll</STRONG>.
This component was created in Visual Basic 5.0, and can be modified to work with
other database structures because it performs a defined role of application layer
between the presentation layer (in ASP pages) and the database layer (in the SQL
Server database).
<A NAME=#BenefitList>
<H2>The BenefitList Class</H2>
</A>
The primary focus of the <STRONG>BenefitList</STRONG> class is maintaining the benefits
information in the Benefits database. The component has 21 methods, which are called as needed
by the ASP pages in Benefits, but could also be called by other applications.
<HR>
<A NAME=#AddBenefit>
<H3>AddBenefit</H3>
</A>
<H4>Overview</H4>
The <STRONG>AddBenefit</STRONG> method creates a record in EmployeeBenefit for the
specified benefit Id and
employee, and a record in EmployeeBenefitDependent for each dependent of the employee.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id of the employee whose dependent is being added
<BR><STRONG>lngBenefitId</STRONG>: Benefit Id being added, as defined in the Benefit table
<H4>Methods Called</H4>
<STRONG><A HREF=#AddEBD>BenefitList.AddEBD</A></STRONG>
<H4>Stored Procedures Called</H4>
<STRONG>sp_AddBenefitSelect1</STRONG>
<BR><STRONG>sp_AddBenefitInsert</STRONG>
<BR><STRONG>sp_AddBenefitSelect2</STRONG>
<H4>Tables Affected</H4>
<STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeBenefit>EmployeeBenefit</A></STRONG>
<BR><STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeBenefitDependent>EmployeeBenefitDependent</A></STRONG>
<H4>Return Value</H4>
No value returned
<HR>
<A NAME=#AddEBD>
<H3>AddEBD</H3>
</A>
<H4>Overview</H4>
The <STRONG>AddEBD</STRONG> method adds a record to the EmployeeBenefitDependent table for the dependent specified,
for every benefit the employee has. Only records for the employee are created as active status
records. All other dependents' records for the employee are created as inactive, and may be activated
by an employee while a change qualifier is in effect.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id of the employee whose dependent is being added
<BR><STRONG>lngBenefitId</STRONG>: Benefit Id being added, as defined in the Benefit table
<BR><STRONG>lngDependentId</STRONG>: The dependent Id of the dependent who records are to be added for
<BR><STRONG>lngDependentTypeId</STRONG>: The type of dependent for whom records are being
created, as defined in the DependentType table
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_AddEBD</STRONG>
<H4>Tables Affected</H4>
<STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeBenefitDependent>EmployeeBenefitDependent</A></STRONG>
<H4>Return Value</H4>
No value returned
<HR>
<A NAME=#AddQualifier>
<H3>AddQualifier</H3>
</A>
<H4>Overview</H4>
The <STRONG>AddQualifier</STRONG> method adds a record to the EmployeeQualifier table to record that a
qualifying event has occurred that qualifies the employee to change benefit options
as needed, during a period defined in the BenefitQualifier table.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id of the employee whose dependent is being added
<BR><STRONG>lngQualifierId</STRONG>: Qualifier Id being added, as defined in the Qualifier table
<BR><STRONG>datQualifierDate</STRONG>: The date the qualifying event occurred
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_AddQualifier</STRONG>
<H4>Tables Affected</H4>
<STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeQualifier>EmployeeQualifier</A></STRONG>
<H4>Return Value</H4>
No value returned
<HR>
<A NAME=#BenefitsForId>
<H3>BenefitsForId</H3>
</A>
<H4>Overview</H4>
The <STRONG>BenefitsForId</STRONG> method returns a <STRONG>Recordset</STRONG> listing all the benefits the employee has
for the specified year.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id of the employee whose dependent is being added
<BR><STRONG>intBenefitYear</STRONG>: Benefit year for which benefits are to be created
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_BenefitsForId</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>BenefitId </STRONG>
<HR>
<A NAME=#ChangeQualifierList>
<H3>ChangeQualifierList</H3>
</A>
<H4>Overview</H4>
The <STRONG>ChangeQualifierList</STRONG> method returns a <STRONG>Recordset</STRONG> listing all change qualifiers that apply
to the qualifier class, and to the benefit if specified.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngBenefitId</STRONG>: The benefit Id for which to return the qualifier Ids
<BR><STRONG>lngQualifierClassId</STRONG>: Qualifier class Id for which to return the qualifier Ids
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_ChangeQualifierList1</STRONG>
<BR>-OR-
<BR><STRONG>sp_ChangeQualifierList2</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
If the benefit is specified (causing <STRONG>sp_ChangeQualifierList1</STRONG> to run)
<BR><STRONG>QualifierId </STRONG>
<BR><STRONG>QualifierLabel </STRONG>
<BR><STRONG>QualifierRank </STRONG>
<BR><STRONG>ChangeDays </STRONG>
<P>If the benefit is not specified (causing <STRONG>sp_ChangeQualifierList2</STRONG> to run)
<BR><STRONG>QualifierId </STRONG>
<BR><STRONG>QualifierLabel </STRONG>
<BR><STRONG>QualifierRank </STRONG>
<HR>
<A NAME=#CheckQualifier>
<H3>CheckQualifier</H3>
</A>
<H4>Overview</H4>
The <STRONG>CheckQualifier</STRONG> method returns a <STRONG>Recordset</STRONG> listing all the qualifiers in effect for the
employee and benefit specified. A valid change qualifier is required before changes can
be made to the employee's benefit choices.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id for which a qualifier is sought
<BR><STRONG>lngBenefitId</STRONG>: Benefit Id for which a qualifier is sought
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_CheckQualifier</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>QualifierId</STRONG>
<HR>
<A NAME=#CurrentPlan>
<H3>CurrentPlan</H3>
</A>
<H4>Overview</H4>
The <STRONG>CurrentPlan</STRONG> method returns a <STRONG>Recordset</STRONG> listing the current options selected for the
specified employee and benefit.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id for which the plan information is sought
<BR><STRONG>lngBenefitId</STRONG>: Benefit Id for which the plan information is sought
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_CurrentPlan</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>BenefitLabel</STRONG>
<BR><STRONG>PlanId</STRONG>
<BR><STRONG>DependentCovered</STRONG>
<BR><STRONG>TaxStatusId</STRONG>
<BR><STRONG>TaxStatusLabel</STRONG>
<HR>
<A NAME=#DependentTypeList>
<H3>DependentTypeList</H3>
</A>
<H4>Overview</H4>
The <STRONG>DependentTypeList</STRONG> method returns a <STRONG>Recordset</STRONG> listing the dependent types.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_DependentTypeList</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>DependentTypeId</STRONG>
<BR><STRONG>DependentTypeLabel</STRONG>
<BR><STRONG>DependentTypeRank</STRONG>
<HR>
<A NAME=#GenderList>
<H3>GenderList</H3>
</A>
<H4>Overview</H4>
The <STRONG>GenderList</STRONG> method returns a <STRONG>Recordset</STRONG> listing the gender types.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_GenderList</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>GenderId</STRONG>
<BR><STRONG>GenderLabel</STRONG>
<BR><STRONG>GenderRank</STRONG>
<HR>
<A NAME=#GetTotalCost>
<H3>GetTotalCost</H3>
</A>
<H4>Overview</H4>
The <STRONG>GetTotalCost</STRONG> method returns a <STRONG>Recordset</STRONG> listing the total cost of the benefits options
currently selected, summing the cost of either benefits paid for with pre-tax or benefits
paid for with after-tax dollars.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id for which the total cost is sought
<BR><STRONG>intBenefitYear</STRONG>: Benefit year for which the total cost is sought
<BR><STRONG>lngTaxStatusId</STRONG>: Tax status Id for which the total cost is sought
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_GetTotalCost</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>TotalCost</STRONG>
<HR>
<A NAME=#GetTotalCredits>
<H3>GetTotalCredits</H3>
</A>
<H4>Overview</H4>
The <STRONG>GetTotalCredits</STRONG> method returns a <STRONG>Recordset</STRONG> listing the total credits available for
purchase of benefits. Any costs beyond the credit amount are deducted from the
employee's pay.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id for which the total credits are sought
<BR><STRONG>intBenefitYear</STRONG>: Benefit year for which the total credits are sought
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_GetTotalCredits</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>TotalCredits</STRONG>
<HR>
<A NAME=#GetTotalPaycheck>
<H3>GetTotalPaycheck</H3>
</A>
<H4>Overview</H4>
The <STRONG>GetTotalPaycheck</STRONG> method returns a <STRONG>Recordset</STRONG> listing the total paycheck after
benefit costs, credits, exemptions, and tax withholding are considered.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id for which the total paycheck is sought
<BR><STRONG>intBenefitYear</STRONG>: Benefit year for which the total paycheck is sought
<H4>Methods Called</H4>
<STRONG><A HREF=#GetTotalCost>BenefitList.GetTotalCost</A></STRONG>
<BR><STRONG><A HREF=#GetTotalCredits>BenefitList.GetTotalCredits</A></STRONG>
<H4>Stored Procedures Called</H4>
<STRONG>sp_GetTotalPaycheck</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
The value of the function is set to the value of curTotalPaycheck
<HR>
<A NAME=#InactivateDependents>
<H3>InactivateDependents</H3>
</A>
<H4>Overview</H4>
The <STRONG>InactivateDependents</STRONG> method sets the record status to "inactive" for all
the dependents for the specified employee and benefit.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id for which the depenents are inactivated
<BR><STRONG>lngBenefitId</STRONG>: Benefit year for which the depenents are inactivated
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_InactivateDependents</STRONG>
<H4>Tables Affected</H4>
<STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeBenefitDependent>EmployeeBenefitDependent</A></STRONG>
<H4>Return Value</H4>
No value returned
<HR>
<A NAME=#ListCoveredPersons>
<H3>ListCoveredPersons</H3>
</A>
<H4>Overview</H4>
The <STRONG>ListCoveredPersons</STRONG> method returns a <STRONG>Recordset</STRONG> listing all the persons who are covered
under the specified employee and benefit.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The benefit Id for which to list the covered persons
<BR><STRONG>lngBenefitId</STRONG>: Benefit Id for which to list the covered persons
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_ListCoveredPersons</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>DependentTypeLabel</STRONG>
<BR><STRONG>FirstName</STRONG>
<BR><STRONG>LastName</STRONG>
<BR><STRONG>PhysicianLabel</STRONG>
<HR>
<A NAME=#ListDependents>
<H3>ListDependents</H3>
</A>
<H4>Overview</H4>
The <STRONG>ListDependents</STRONG> method returns a <STRONG>Recordset</STRONG> listing all the persons who are dependents of
the specified employee along with information about their coverage under the specified benefit.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The benefit Id for which to list the dependents
<BR><STRONG>lngBenefitId</STRONG>: Benefit Id for which to list the dependents
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_ListDependents</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>DependentId</STRONG>
<BR><STRONG>EBDStatus</STRONG>
<BR><STRONG>DependentTypeLabel</STRONG>
<BR><STRONG>LastName</STRONG>
<BR><STRONG>FirstName</STRONG>
<BR><STRONG>PhysicianId</STRONG>
<HR>
<A NAME=#PhysicianList>
<H3>PhysicianList</H3>
</A>
<H4>Overview</H4>
The <STRONG>PhysicianList</STRONG> method returns a <STRONG>Recordset</STRONG> listing all the physicians.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_PhysicianList</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>PhysicianId</STRONG>
<BR><STRONG>PhysicianLabel</STRONG>
<HR>
<A NAME=#PlanField>
<H3>PlanField</H3>
</A>
<H4>Overview</H4>
The <STRONG>PlanField</STRONG> method returns a <STRONG>Recordset</STRONG> listing all the physicians.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngPlanId</STRONG>: The plan Id for which the plan field records should be returned
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_PlanField</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>FieldLabel</STRONG>
<BR><STRONG>FieldValue</STRONG>
<HR>
<A NAME=#PlanInfo>
<H3>PlanInfo</H3>
</A>
<H4>Overview</H4>
The <STRONG>PlanInfo</STRONG> method returns a <STRONG>Recordset</STRONG> listing information about the specified plan.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngBenefitId</STRONG>: The benefit Id for which the plan records should be returned
<BR><STRONG>lngPlanId</STRONG>: The plan Id for which the plan records should be returned
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_PlanInfo</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>PlanLabel</STRONG>
<BR><STRONG>PlanDesc</STRONG>
<BR><STRONG>PlanCost</STRONG>
<BR><STRONG>PhysicianRequired</STRONG>
<BR><STRONG>PlanRank</STRONG>
<HR>
<A NAME=#PlanList>
<H3>PlanList</H3>
</A>
<H4>Overview</H4>
The <STRONG>PlanList</STRONG> method returns a <STRONG>Recordset</STRONG> listing plans that fall under the specified benefit Id.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngBenefitId</STRONG>: The benefit Id for which the plan records should be returned
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_PlanList</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>PlanId</STRONG>
<BR><STRONG>PlanLabel</STRONG>
<BR><STRONG>PlanRank</STRONG>
<HR>
<A NAME=#SaveDependents>
<H3>SaveDependents</H3>
</A>
<H4>Overview</H4>
The <STRONG>SaveDependents</STRONG> method changes to "Active" the record status of all the specified records,
and saves the physician Id as needed.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id for which the dependent records should be saved
<BR><STRONG>lngBenefitId</STRONG>: The benefit Id for which the dependent records should be saved
<BR><STRONG>lngDependentId</STRONG>: The benefit Id for which the dependent records should be saved
<BR><STRONG>lngPhysicianId</STRONG>: The benefit Id for which the dependent records should be saved
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_SaveDependents</STRONG>
<H4>Tables Affected</H4>
<STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeBenefitDependent>EmployeeBenefitDependent</A></STRONG>
<H4>Return Value</H4>
No value returned
<HR>
<A NAME=#SummaryForId>
<H3>SummaryForId</H3>
</A>
<H4>Overview</H4>
The <STRONG>SummaryForId</STRONG> method returns a <STRONG>Recordset</STRONG> containing all of the benefit records for the
specified employee and benefit year.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id for which the benefit records should be returned
<BR><STRONG>intBenefitYear</STRONG>: The benefit year for which the benefit records should be returned
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_SummaryForId</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>BenefitId</STRONG>
<BR><STRONG>BenefitLabel</STRONG>
<BR><STRONG>DetailTemplate</STRONG>
<BR><STRONG>PlanLabel</STRONG>
<BR><STRONG>PlanCost</STRONG>
<BR><STRONG>TaxStatusLabel</STRONG>
<HR>
<A NAME=#TaxStatusList>
<H3>TaxStatusList</H3>
</A>
<H4>Overview</H4>
The <STRONG>TaxStatusList</STRONG> method returns a <STRONG>Recordset</STRONG> containing all of the tax status records that apply
to the specified benefit Id.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngBenefitId</STRONG>: The benefit Id for which the tax status records should be returned
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_TaxStatusList</STRONG>
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>TaxStatusId</STRONG>
<BR><STRONG>TaxStatusLabel</STRONG>
<BR><STRONG>TaxDefault</STRONG>
<HR>
<A NAME=#UpdateBenefitList>
<H3>Update</H3>
</A>
<H4>Overview</H4>
The <STRONG>Update</STRONG> method updates the EmployeeBenefit table with the specified
plan Id and tax status Id for the specified employee and benefit. Note that this is
the <STRONG>BenefitList.Update</STRONG> method; there is also an
<STRONG>Employee.Update</STRONG> method.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id for which the information should be updated
<BR><STRONG>lngBenefitId</STRONG>: The benefit Id for which the information should be updated
<BR><STRONG>lngPlanId</STRONG>: The plan Id selected under the benefit
<BR><STRONG>lngTaxStatusId</STRONG>: The tax status Id to be applied to the benefit
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
<STRONG>sp_Update</STRONG>
<H4>Tables Affected</H4>
<STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeBenefit>EmployeeBenefit</A></STRONG>
<H4>Return Value</H4>
No value returned
<A NAME=#Employee>
<H2>The Employee Class</H2>
</A>
The primary focus of the <STRONG>Employee</STRONG> class is maintaining the employee information
in the Benefits database. The class has nine methods, which are called as needed
by the ASP pages in Benefits, but could also be called by other applications.
<HR>
<A NAME=#AddDependent>
<H3>AddDependent</H3>
</A>
<H4>Overview</H4>
The <STRONG>AddDependent</STRONG> method adds a dependent's information to the Benefits database.
It inserts records into the Dependent and EmployeeDependent tables, and calls
<STRONG><A HREF=#AddEBD>BenefitList.AddEBD</A></STRONG>
to add records to the EmployeeBenefitDependent table.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id of the employee whose dependent is being added
<BR><STRONG>lngDependentTypeId</STRONG>: The type of dependent being added, as defined in the DependentType table
<BR><STRONG>strFirstName</STRONG>: The first name of the dependent
<BR><STRONG>strLastName</STRONG>: The last name of the dependent
<BR><STRONG>strMiddleName</STRONG>: The middle name of the dependent
<BR><STRONG>strDependentSSN</STRONG>: The Social Security Number of the dependent
<BR><STRONG>lngDependentGenderId</STRONG>: The gender of the dependent, as defined in the Gender table
<BR><STRONG>datDependentBirthdate</STRONG>: The birthdate of the dependent
<H4>Methods Called</H4>
<STRONG><A HREF=#AddEBD>BenefitList.AddEBD</A></STRONG>
<H4>Stored Procedures Called</H4>
No stored procedures called
<H4>Tables Affected</H4>
<STRONG><A HREF=HIWBenefitsDatabase.asp#Dependent>Dependent</A></STRONG>
<BR><STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeDependent>EmployeeDependent</A></STRONG>
<BR><STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeBenefitDependent>EmployeeBenefitDependent</A></STRONG>
<H4>Return Value</H4>
No value returned
<HR>
<A NAME=#AddEmployeeDependent>
<H3>AddEmployeeDependent</H3>
</A>
<H4>Overview</H4>
The <STRONG>AddEmployeeDependent</STRONG> method creates a record for the employee in the Dependent table
and in the EmployeeDependent table.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id of the employee
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
No stored procedures called
<H4>Tables Affected</H4>
<STRONG><A HREF=HIWBenefitsDatabase.asp#Dependent>Dependent</A></STRONG>
<BR><STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeDependent>EmployeeDependent</A></STRONG>
<H4>Return Value</H4>
No value returned
<HR>
<A NAME=#AddNEW>
<H3>AddNew</H3>
</A>
<H4>Overview</H4>
The <STRONG>AddNew</STRONG> method creates a new record for the specified Windows NT
user name. It inserts a record
into the Employee table with the Windows NT user name set to the value passed in, which was
retrieved from the server variables by the ASP page. It then calls other methods to add the
employee dependent record, new benefits records, and a change qualifier that will allow the
new employee to change benefit choices.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>strNTUserName</STRONG>: The Windows NT user name retrieved from the server variables by the ASP page
<BR><STRONG>intBenefitYear </STRONG>: The benefit year currently in effect
<BR><STRONG>lngQualifierId </STRONG>: The Id of the qualifier that represents adding a new employee
<BR><STRONG>datQualifierDate </STRONG>: The date the new employee was added
<H4>Methods Called</H4>
<STRONG><A HREF=#AddEmployeeDependent>Employee.AddEmployeeDependent</A></STRONG>
<BR><STRONG><A HREF=#NewBenefits>Employee.NewBenefits</A></STRONG>
<BR><STRONG><A HREF=#AddQualifier>BenefitList.AddQualifier</A></STRONG>
<H4>Stored Procedures Called</H4>
No stored procedures called
<H4>Tables Affected</H4>
<STRONG><A HREF=HIWBenefitsDatabase.asp#Employee>Employee</A></STRONG>
<BR><STRONG><A HREF=HIWBenefitsDatabase.asp#Dependent>Dependent</A></STRONG>
<BR><STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeDependent>EmployeeDependent</A></STRONG>
<BR><STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeBenefitDependent>EmployeeBenefitDependent</A></STRONG>
<BR><STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeQualifier>EmployeeQualifier</A></STRONG>
<H4>Return Value</H4>
No value returned
<HR>
<A NAME=#GetDependents>
<H3>GetDependents</H3>
</A>
<H4>Overview</H4>
The <STRONG>GetDependents</STRONG> method returns a <STRONG>Recordset</STRONG> containing information on the specified
employee's dependents.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id of the employee
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
No stored procedures called
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>DependentId</STRONG>
<BR><STRONG>DependentTypeLabel</STRONG>
<BR><STRONG>LastName</STRONG>
<BR><STRONG>FirstName</STRONG>
<BR><STRONG>MiddleName</STRONG>
<BR><STRONG>DependentBirthdate</STRONG>
<BR><STRONG>GenderLabel</STRONG>
<BR><STRONG>DependentSSN</STRONG>
<HR>
<A NAME=#GetForId>
<H3>GetForId</H3>
</A>
<H4>Overview</H4>
The <STRONG>GetForId</STRONG> method returns a <STRONG>Recordset</STRONG> containing information on the specified
employee.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id of the employee
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
No stored procedures called
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>DependentId</STRONG>
<BR><STRONG>FirstName</STRONG>
<BR><STRONG>LastName</STRONG>
<BR><STRONG>MiddleName</STRONG>
<BR><STRONG>KnownAs</STRONG>
<BR><STRONG>NTUserName</STRONG>
<BR><STRONG>DependentSSN</STRONG>
<BR><STRONG>DependentGenderId</STRONG>
<BR><STRONG>DependentBirthdate</STRONG>
<BR><STRONG>Address1</STRONG>
<BR><STRONG>Address2</STRONG>
<BR><STRONG>City</STRONG>
<BR><STRONG>State</STRONG>
<BR><STRONG>PostCode</STRONG>
<BR><STRONG>Country</STRONG>
<BR><STRONG>HomePhone</STRONG>
<BR><STRONG>BusinessPhone</STRONG>
<BR><STRONG>Fax</STRONG>
<BR><STRONG>Email</STRONG>
<BR><STRONG>PeriodEarnings</STRONG>
<BR><STRONG>Exemptions</STRONG>
<HR>
<A NAME=#LookupEmployee>
<H3>LookupEmployee</H3>
</A>
<H4>Overview</H4>
The <STRONG>LookupEmployee</STRONG> method returns a <STRONG>Recordset</STRONG> containing
the <STRONG>EmployeeId</STRONG> of the current user.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>strLogonUser</STRONG>: The Logon_User value returned by the browser, containing
the Windows NT user name of the current user
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
No stored procedures called
<H4>Tables Affected</H4>
No tables affected
<H4>Return Value</H4>
A <STRONG>Recordset</STRONG> is returned containing:
<BR><STRONG>EmployeeId</STRONG>
<HR>
<A NAME=#NewBenefits>
<H3>NewBenefits</H3>
</A>
<H4>Overview</H4>
The <STRONG>NewBenefits</STRONG> method creates a new record for each benefit for the
year specified, for the specified employee.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id of the employee
<BR><STRONG>intBenefitYear </STRONG>: The benefit year currently in effect
<H4>Methods Called</H4>
<BR><STRONG><A HREF=#AddBenefit>BenefitList.AddBenefit</A></STRONG>
<H4>Stored Procedures Called</H4>
No stored procedures called
<H4>Tables Affected</H4>
<STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeBenefit>EmployeeBenefit</A></STRONG>
<H4>Return Value</H4>
No value returned
<HR>
<A NAME=#RemoveDependent>
<H3>RemoveDependent</H3>
</A>
<H4>Overview</H4>
The <STRONG>RemoveDependent</STRONG> method marks a dependent's records as status
"Delete". This method is used in removing a dependent from an employee's records.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: The file DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: The employee Id of the employee whose dependent is being removed
<BR><STRONG>lngDependentId</STRONG>: The dependent Id of the dependent who is being removed
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
No stored procedures called
<H4>Tables Affected</H4>
<STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeDependent>EmployeeDependent</A></STRONG>
<BR><STRONG><A HREF=HIWBenefitsDatabase.asp#EmployeeBenefitDependent>EmployeeBenefitDependent</A></STRONG>
<H4>Return Value</H4>
No value returned
<HR>
<A NAME=#UpdateEmployee>
<H3>Update</H3>
</A>
<H4>Overview</H4>
The <STRONG>Update</STRONG> method updates demographic information for the specified employee, setting fields
to the specified values. Note that this is the <STRONG>Employee.Update</STRONG> method; there is also a
<STRONG>BenefitList.Update</STRONG> method.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: File DSN that should be used in executing this method
<BR><STRONG>lngEmployeeId</STRONG>: Employee Id of the employee whose record is being updated
<BR><STRONG>lngDependentId</STRONG>: Dependent Id of the employee's dependent record
<BR><STRONG>strFirstName</STRONG>: Employee first name
<BR><STRONG>strLastName</STRONG>: Employee last name
<BR><STRONG>strMiddleName</STRONG>: Employee middle name
<BR><STRONG>strKnownAs</STRONG>: Employee nickname
<BR><STRONG>strDependentSSN</STRONG>: Employee SSN
<BR><STRONG>lngDependentGenderId</STRONG>: Employee Gender Id
<BR><STRONG>datDependentBirthdate</STRONG>: Employee birthdate
<BR><STRONG>strAddress1</STRONG>: Employee address line 1
<BR><STRONG>strAddress2</STRONG>: Employee address line 2
<BR><STRONG>strCity</STRONG>: Employee city
<BR><STRONG>strState</STRONG>: Employee state
<BR><STRONG>strPostCode</STRONG>: Employee postal code
<BR><STRONG>strCountry</STRONG>: Employee country
<BR><STRONG>strHomePhone</STRONG>: Employee home phone
<BR><STRONG>strBusinessPhone</STRONG>: Employee business phone
<BR><STRONG>strFax</STRONG>: Employee fax number
<BR><STRONG>strEmail</STRONG>: Employee email address
<BR><STRONG>lngExemptions</STRONG>: Employee number of exemptions
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
No stored procedures called
<H4>Tables Affected</H4>
<STRONG><A HREF=HIWBenefitsDatabase.asp#Employee>Employee</A></STRONG>
<BR><STRONG><A HREF=HIWBenefitsDatabase.asp#Dependent>Dependent</A></STRONG>
<H4>Return Value</H4>
No value returned
<HR>
<A NAME=#UpdateDependent>
<H3>UpdateDependent</H3>
</A>
<H4>Overview</H4>
The <STRONG>UpdateDependent</STRONG> method updates demographic information for the specified dependent,
setting fields to the specified values.
<H4>Input Parameters</H4>
<STRONG>strFileDSN</STRONG>: File DSN that should be used in executing this method
<BR><STRONG>lngDependentId</STRONG>: Dependent Id of the dependent record being updated
<BR><STRONG>strDependentSSN</STRONG>: Dependent SSN
<BR><STRONG>lngDependentGenderId</STRONG>: Dependent Gender Id
<BR><STRONG>datDependentBirthdate</STRONG>: Dependent birthdate
<H4>Methods Called</H4>
No methods called
<H4>Stored Procedures Called</H4>
No stored procedures called
<H4>Tables Affected</H4>
<STRONG><A HREF=HIWBenefitsDatabase.asp#Dependent>Dependent</A></STRONG>
<H4>Return Value</H4>
No value returned
<P>
</FONT>
</TD>
</TR>
</TABLE>
</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-->
</BODY>
</HTML>
<!--END HTML-->
<%
'
' 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
' 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 Sub
%>