home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 September
/
CHIPCD_9_99.iso
/
software
/
uaktualnienia
/
OptionPackPL
/
iis4_07.cab
/
DetailInsurance.asp
< prev
next >
Wrap
Text File
|
1998-04-27
|
30KB
|
1,104 lines
<%@ LANGUAGE="VBSCRIPT" TRANSACTION=REQUIRED %>
<% Option Explicit %>
<!--#include file=libAuthenticate.inc-->
<%
Dim m_ReturnTitle1, m_ReturnTitle2, m_EnrollPrompt, m_BenefitLabel, m_DependentCovered, _
m_PlanId, m_PlanLabel, m_PlanDesc, m_PlanCost, m_TaxStatusId, m_TaxStatusLabel, _
m_Change, m_CurrentPlanId, m_ShowPlanId, m_ShowPlanRank, m_PhysicianRequired, _
m_CoveredPrompt, m_TaxStatusPrompt, m_Review, m_BenefitId, m_RequestPlanId, _
m_intRequestPlanId, m_intTaxStatus, m_BenefitYear, m_ActiveQualifier, _
m_NoPhysician, strURL, m_strMainPrompt, m_UpdateMessage
' Move Input parameters to working variables
m_Review = Request("Review")
m_BenefitId = Request("BenefitId")
m_RequestPlanId = Request("RequestPlanId")
' Get the Physician Id that represents 'No Physician Selected'
m_NoPhysician = CInt(Application("NoPhysician"))
' Handle if Review or Open Enrollment and Qualified to change or not
If m_Review = 0 Then
m_Change = 1
m_BenefitYear = Year(Date) + 1
m_ReturnTitle1 = "Return to Open Enrollment"
m_ReturnTitle2 = "OPEN ENROLLMENT"
m_EnrollPrompt = "To change your Insurance, select a Plan, make any other changes, " & _
"and then click <STRONG>Save</STRONG>." & _
"<BR>Any changes you make will take effect at the beginning of next year.<P>"
m_CoveredPrompt = "<FONT FACE=VERDANA, ARIAL, HELVETICA SIZE=2> " & _
"<CENTER> To add or remove coverage, click the check box next to the " & _
"person whose coverage you want to change. <BR> " & _
"You can also <A HREF=" & Chr(34) & "DependentAdd.asp" & Chr(34) & _
">add a dependent</A></CENTER></FONT>"
' Set prompt about tax status
m_TaxStatusPrompt = "<FONT FACE=VERDANA, ARIAL, HELVETICA SIZE=2> " & _
"<CENTER> To choose whether to spend Pre-tax dollars or After-tax dollars " & _
"on this benefit, select the appropriate button.</CENTER></FONT>"
Else
' Deal with records for this year
m_BenefitYear = Year(Date)
' Find out if Employee has a qualifying event in effect for this benefit
CheckQualifier
If m_ActiveQualifier = 1 Then
m_Change = 1
m_ReturnTitle1 = "Return to Review or Change Current Benefits"
m_ReturnTitle2 = "REVIEW OR CHANGE CURRENT BENEFITS"
m_EnrollPrompt = "To change your Insurance, select a Plan, make any other changes, " & _
"and then click <STRONG>Save</STRONG>." & _
"<BR>Any changes you make will take effect at the beginning of next month.<P>"
' Set prompt about maintaining covered persons
m_CoveredPrompt = "<FONT FACE=VERDANA, ARIAL, HELVETICA SIZE=2> " & _
"<CENTER> To add or remove coverage, click the check box next to the " & _
"person whose coverage you want to change. <BR> " & _
"You can also <A HREF=" & Chr(34) & "DependentAdd.asp" & Chr(34) & _
">add a dependent</A></CENTER></FONT>"
' Set prompt about tax status
m_TaxStatusPrompt = "<FONT FACE=VERDANA, ARIAL, HELVETICA SIZE=2> " & _
"<CENTER> To choose whether to spend Pre-tax dollars or After-tax dollars " & _
"on this benefit, select the appropriate button.</CENTER> </FONT>"
Else
m_ReturnTitle1 = "Return to Review or Change Current Benefits"
m_ReturnTitle2 = "REVIEW OR CHANGE CURRENT BENEFITS"
m_EnrollPrompt = "To change your Insurance, click <STRONG>Change</STRONG>.<P>"
' Set prompt about maintaining covered persons
m_CoveredPrompt = "<FONT FACE=VERDANA, ARIAL, HELVETICA SIZE=2> " & _
"<CENTER>You can <A HREF=" & Chr(34) & "DependentAdd.asp" & Chr(34) & _
">add a dependent</A></CENTER></FONT>"
End If
End If
m_UpdateMessage = ""
If Request.Form("SubmitPlan") <> "" Then
If Request.Form("SubmitPlan") = "Save" Then
GetValuesFromForm
UpdateBenefit
GetCurrentPlan
m_ShowPlanId = m_CurrentPlanId
GetPlanInfo(m_ShowPlanId)
m_UpdateMessage = " Language=JavaScript " & _
"onLoad=" & Chr(34) & "{ alert ('Your Insurance Plan was updated.');}" & Chr(34)
' User clicked Change, so need to get qualifying change info and then update
Else
strURL = "Change.asp?BenefitId=" & m_BenefitId
Response.Redirect(strURL)
Response.End
End If
Else
' If the Request included a "RequestPlan" then show its info
If m_RequestPlanId > 0 Then
GetCurrentPlan
m_ShowPlanId = CInt(m_RequestPlanId)
GetPlanInfo(m_ShowPlanId)
' Else show the current plan info
Else
GetCurrentPlan
m_ShowPlanId = m_CurrentPlanId
GetPlanInfo(m_ShowPlanId)
End If
End If
%>
<!--BEGIN HTML-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<!--META TAGS ARE RECOMMENDED FOR THE SEARCH ENGINE-->
<META NAME="DESCRIPTION" CONTENT="Insurance Detail">
<META NAME="KEYWORDS" CONTENT="insurance, covered, dependent, change, update">
<META NAME="GENERATOR" CONTENT="Microsoft Visual InterDev 1.0">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1">
<!--END META TAGS-->
<TITLE><%= m_BenefitLabel %></TITLE>
</HEAD>
<BODY BGCOLOR=#FFFFFF TOPMARGIN=0 LEFTMARGIN=0 ALINK=#23238E VLINK=#228B22 LINK=#23238E
<%= m_UpdateMessage%> >
<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-->
<!--COLOR BANNER_START-->
<CENTER>
<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD BGCOLOR="#C71585" WIDTH=100% HEIGHT=20>
</TD>
</TR>
</TABLE>
<!--COLOR BANNER_END-->
<!--BEGIN TABLE CONTAINING LOGO, TITLE AND NAVIGATIONAL LINK-->
<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD VALIGN=TOP WIDTH=325>
<A HREF="../default.asp">
<IMG SRC="../images/logo_sm.gif" WIDTH=200 HEIGHT=100
ALT="Return to Exploration Air Home Page" BORDER=0>
</A>
<BR>
<A HREF="default.asp">
<IMG SRC="../images/barrowy.gif" HEIGHT=8 WIDTH=8 HSPACE=5
ALT="Return to Employee Benefit Home Page" BORDER=0>
</A>
<FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="2" ><STRONG>
<A HREF="default.asp" TITLE="Click to return to Employee Benefit Home Page">
EMPLOYEE BENEFITS HOME PAGE
</A>
</STRONG></FONT>
<BR>
<A HREF="Benefits.asp?Review=<%= m_Review%>">
<IMG SRC="../images/barrowy.gif" HEIGHT=8 WIDTH=8 HSPACE=5
ALT="<%= m_ReturnTitle1%>" BORDER=0>
</A>
<FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="2" ><STRONG>
<A HREF="Benefits.asp?Review=<%= m_Review%>" TITLE="<%= m_ReturnTitle1%>">
<%= m_ReturnTitle2%>
</A>
</STRONG></FONT>
</TD>
<TD VALIGN=MIDDLE WIDTH=200>
<FONT FACE="VERDANA, ARIAL, HELVETICA" COLOR="#0000FF" SIZE=3>
<%= m_strMainPrompt %>
</FONT>
</TD>
<TD VALIGN=MIDDLE WIDTH=200>
<FONT FACE="VERDANA, ARIAL, HELVETICA" COLOR="#0000FF" SIZE=5>
<%= m_BenefitLabel %>
</FONT>
</TD>
<TD VALIGN=TOP ALIGN=RIGHT>
<A HREF="../HowItWorks/HIWBenefitsDetail.asp">
<IMG SRC="../images/btssmall.gif" WIDTH="115" HEIGHT="52"
ALT="Click here to learn how this page works" BORDER=0>
</A>
</TD>
</TR>
</TABLE>
<!--END TABLE CONTAINING LOGO, TITLE AND NAVIGATIONAL LINK-->
<BR>
<BR>
<% 'Conditional HTML code for RDS
If Session("UseRDS") = "True" Then
%>
<!-- Non-visual controls - used for data binding -->
<OBJECT CLASSID="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33"
ID=dsoPlan
HEIGHT=1 WIDTH = 1>
</OBJECT>
<OBJECT CLASSID="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33"
ID=dsoField
HEIGHT=1 WIDTH = 1>
</OBJECT>
<!-- BEGIN TABLE CONTAINING THE EMPLOYEE'S BENEFITS INFO -->
<%= m_EnrollPrompt%>
<TABLE BORDER=1 WIDTH=90%>
<TR>
<TH>
Plan
</TH>
<TD>
<% If m_Change = 1 Then %>
<TABLE>
<TR ALIGN=CENTER>
<TD>
<INPUT TYPE=BUTTON NAME="MoveFirst" VALUE="First">
</TD>
<TD>
<INPUT TYPE=BUTTON NAME="MovePrevious" VALUE="Previous">
</TD>
<TD>
<SPAN NAME="PlanLabel" DATASRC="#dsoPlan" DATAFLD="PlanLabel"></SPAN>
</TD>
<TD>
<INPUT TYPE=BUTTON NAME="MoveNext" VALUE="Next">
</TD>
<TD>
<INPUT TYPE=BUTTON NAME="MoveLast" VALUE="Last">
</TD>
</TR>
</TABLE>
<% Else %>
<TD>
<SPAN NAME="PlanLabel" DATASRC="#dsoPlan" DATAFLD="PlanLabel"></SPAN>
</TD>
<% End If %>
</TD>
</TR>
</TABLE>
<!--BEGIN FORM-->
<FORM NAME="formPlan" METHOD=POST
ACTION="DetailInsurance.asp?BenefitId=<%= m_BenefitId %>&Review=<%= m_Review %>">
<DIV ID=RankZero>
<INPUT TYPE=HIDDEN NAME="RequestPlanId" DATASRC="#dsoPlan" DATAFLD="PlanId">
<TABLE BORDER=1 WIDTH=90%>
<TR>
<TH>
Description
</TH>
<TD>
<SPAN NAME="PlanDesc" DATASRC="#dsoPlan" DATAFLD="PlanDesc"></SPAN>
</TD>
</TR>
<TR>
<TH>
Cost per Period
</TH>
<TD>
$<SPAN NAME="PlanCost" DATASRC="#dsoPlan" DATAFLD="PlanCost"></SPAN>
</TD>
</TR>
</TABLE>
<TABLE DATASRC="#dsoField" BORDER=1 WIDTH=90%>
<TR>
<TH>
<SPAN NAME="FieldLabel" DATAFLD="FieldLabel"></SPAN>
</TH>
<TD>
<SPAN NAME="FieldValue" DATAFLD="FieldValue"></SPAN>
</TD>
</TR>
</TABLE>
<% ' Show dependent coverage information as appropriate
If m_DependentCovered = 1 Then %>
<TABLE WIDTH=90%>
<TR>
<TD>
</TD>
</TR>
<TR>
<TD>
<%= m_CoveredPrompt%>
</TD>
</TR>
<TR>
<TD>
<TABLE BORDER=1 WIDTH=100%>
<TR>
<TH COLSPAN=5>
<% If m_Change = 1 Then %>
Dependents
<% Else %>
Covered Persons
<% End If %>
</TH>
</TR>
<TR>
<% If m_Change = 1 Then %>
<TH>
Covered
</TH>
<% End If %>
<TH>
Relationship
</TH>
<TH>
Name
</TH>
<TH ID=PhysHead>
Physician
</TH>
</TR>
<% If m_Change = 1 Then
ListDependents
Else
ListCoveredPersons
End If
%>
</TABLE>
</TD>
</TR>
<% ' End Show dependent coverage information as appropriate
End If
%>
<TR>
<TD>
</TD>
</TR>
<TR>
<TD>
<%
If FindTaxChoice() Then
Response.Write m_TaxStatusPrompt
End If
%>
</TD>
</TR>
<TR>
<TD>
<TABLE BORDER=1 WIDTH=100%>
<TR>
<TH>
Tax Status
</TH>
<TD>
<%
If m_Change = 1 Then
BuildTaxStatusList
Else
Response.Write m_TaxStatusLabel
End If
%>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<!--End of hiding section-->
</DIV>
<P>
<%
If m_Change = 1 Then
Response.Write "<INPUT TYPE=Submit NAME=SubmitPlan VALUE=Save>"
Else
Response.Write "<INPUT TYPE=Submit NAME=SubmitPlan VALUE=Change>"
End If
%>
</FORM>
<% 'Conditional HTML code for RDS
Else
%>
<!-- BEGIN TABLE CONTAINING THE EMPLOYEE'S BENEFITS INFO -->
<CENTER>
<BR>
<%= m_EnrollPrompt%>
<TABLE WIDTH=90%>
<TR>
<TD>
<TABLE BORDER=1 WIDTH=100%>
<TR>
<TH>
Plan
</TH>
<TD>
<!--BEGIN FORM-->
<FORM NAME="formPlan" METHOD=POST
ACTION="DetailInsurance.asp?BenefitId=<%= m_BenefitId %>&Review=<%= m_Review %>">
<%
If m_Change = 1 Then
BuildPlanList
Else
Response.Write m_PlanLabel
End If
%>
</TD>
</TR>
<% 'Do not show the following if the benefit has "No Plan" selected
If m_ShowPlanRank > 0 Then %>
<TR>
<TH>
Description
</TH>
<TD>
<%= m_PlanDesc %>
</TD>
</TR>
<TR>
<TH>
Cost per Period
</TH>
<TD>
<% If IsNull(m_PlanCost) Then m_PlanCost = 0 %>
<% = FormatCurrency(m_PlanCost) %>
</TD>
</TR>
<!--Generate the PlanField lines-->
<% ListPlanField(m_ShowPlanId) %>
</TABLE>
</TD>
</TR>
<TR>
<TD>
</TD>
</TR>
<% ' Show dependent coverage information as appropriate
If m_DependentCovered = 1 Then %>
<TR>
<TD>
<%= m_CoveredPrompt%>
</TD>
</TR>
<TR>
<TD>
<TABLE BORDER=1 WIDTH=100%>
<TR>
<TH COLSPAN=5>
<% If m_Change = 1 Then %>
Dependents
<% Else %>
Covered Persons
<% End If %>
</TH>
</TR>
<TR>
<% If m_Change = 1 Then %>
<TH>
Covered
</TH>
<% End If %>
<TH>
Relationship
</TH>
<TH>
Name
</TH>
<% If m_PhysicianRequired = 1 Then %>
<TH>
Physician
</TH>
<% End If %>
</TR>
<%
If m_Change = 1 Then
ListDependents
Else
ListCoveredPersons
End If
%>
</TABLE>
</TD>
</TR>
<% ' End Show dependent coverage information as appropriate
End If %>
<TR>
<TD>
</TD>
</TR>
<TR>
<TD>
<%
If FindTaxChoice() Then
Response.Write m_TaxStatusPrompt
End If
%>
</TD>
</TR>
<TR>
<TD>
<TABLE BORDER=1 WIDTH=100%>
<TR>
<TH>
Tax Status
</TH>
<TD>
<%
If m_Change = 1 Then
BuildTaxStatusList
Else
Response.Write m_TaxStatusLabel
End If
%>
</TD>
</TR>
<% ' End of conditional code for if the benefit has "No Plan" selected
End If %>
</TABLE>
</TD>
</TR>
</TABLE>
<P>
<%
If m_Change = 1 Then
Response.Write "<INPUT TYPE=Submit NAME=SubmitPlan VALUE=Save>"
Else
Response.Write "<INPUT TYPE=Submit NAME=SubmitPlan VALUE=Change>"
End If
%>
</FORM>
</CENTER>
<BR>
<% 'End of conditional HTML code for RDS
End If
%>
</CENTER>
<BR>
<P>
<HR=400>
<P>
<CENTER>
<FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="1">
<A HREF="../legal.htm" TITLE="Click to view Copyright and Legal Information">
©1997 Microsoft Corporation. All rights reserved. Terms of Use.
</A>
</FONT>
</CENTER>
<P>
<!--BEGIN COLOR BANNER-->
<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD BGCOLOR="#C71585" WIDTH=100% HEIGHT=20>
</TD>
</TR>
</TABLE>
<!--END COLOR BANNER-->
<% 'Conditional Script for RDS
If Session("UseRDS") = "True" Then
%>
<!-- Script to run the RDS -->
<SCRIPT LANGUAGE="VBScript">
Option Explicit
'---- enum Values ----
Const adcExecSync = 1
Const adcExecAsync = 2
'---- enum Values ----
Const adcFetchUpFront = 1
Const adcFetchBackground = 2
Sub Window_OnLoad
' Get the Plan records
GetPlans
' Get the Field records corresponding to the Plan records
GetFields
' Show the Employee's current plan
ShowCurrentPlan
End Sub
Sub GetPlans
' Change the asynchronous options such that execution is synchronous
' and Fetching can occur in the background
dsoPlan.ExecuteOptions = adcExecSync
dsoPlan.FetchOptions = adcFetchBackground
dsoPlan.Server = "http://<%=Request.ServerVariables("SERVER_NAME")%>"
dsoPlan.Connect = "FILEDSN=<%= Application("DSNBenefits") %>"
dsoPlan.SQL = "SELECT p.PlanId, p.PlanLabel, p.PlanDesc, p.PlanCost, " & _
"p.PhysicianRequired, bp.PlanRank " & _
"FROM Plans p " & _
"JOIN BenefitPlan bp ON bp.BenefitId = <%=m_BenefitId%> " & _
"AND bp.PlanId = p.PlanId " & _
"ORDER BY bp.PlanRank"
'Get the data specified
dsoPlan.Refresh
End Sub
Sub GetFields
' Change the asynchronous options so that execution is synchronous
' and Fetching can occur in the background
dsoField.ExecuteOptions = adcExecSync
dsoField.FetchOptions = adcFetchBackground
dsoField.Server = "http://<%=Request.ServerVariables("SERVER_NAME")%>"
dsoField.Connect = "FILEDSN=<%= Application("DSNBenefits") %>"
dsoField.SQL = "SELECT p.PlanId, f.FieldLabel, pf.FieldValue " & _
"FROM Plans p " & _
"JOIN PlanField pf ON pf.PlanId = p.PlanId " & _
"JOIN Field f ON pf.FieldId = f.FieldId " & _
"JOIN BenefitPlan bp ON bp.BenefitId = <%=m_BenefitId%> " & _
"AND bp.PlanId = p.PlanId " & _
"ORDER BY pf.FieldRank"
'Get the data
dsoField.Refresh
End Sub
Sub ShowCurrentPlan
Dim intCurrent
On Error Resume Next
' Loop through recordset until get to the employee's current plan
intCurrent = 1
Do While dsoPlan.Recordset("PlanId") <> <%= m_CurrentPlanId %>
intCurrent = intCurrent + 1
dsoPlan.Recordset.MoveNext
' Will error if already at last
If Err.Number <> 0 Then
dsoPlan.Recordset.MoveLast
Exit Do
End If
Loop
SetRankZero
SetNavigationButtons
SetPhysInfo
' Show the Field records for this Plan
FilterPlanField(dsoPlan.Recordset("PlanId"))
End Sub
' Display DIV called RankZero as needed
Function SetRankZero
dim e
set e = document.all.RankZero
If dsoPlan.Recordset("PlanRank") > 0 Then
e.style.display = ""
Else
e.style.display = "none"
End If
End Function
' Set Display of Physician info as needed
Function SetPhysInfo
' Some plans will not have PhysHead in them
On Error Resume Next
Dim e, i, PhysIdCol
Set e = document.all.PhysHead
If dsoPlan.Recordset("PhysicianRequired") = 1 Then
e.style.display = ""
Else
e.style.display = "none"
End If
Set e = document.all.PhysId
If dsoPlan.Recordset("PhysicianRequired") = 1 Then
e.style.display = ""
Else
e.style.display = "none"
End If
Set PhysIdCol = document.all.item("PhysId")
For i = 0 to (PhysIdCol.length)
If dsoPlan.Recordset("PhysicianRequired") = 1 Then
PhysIdCol(i).style.display = ""
Else
PhysIdCol(i).style.display = "none"
End If
Next
End Function
Sub MoveFirst_OnClick
dsoPlan.Recordset.MoveFirst
SetNavigationButtons
SetRankZero
SetPhysInfo
' Show the Field records for this Plan
FilterPlanField(dsoPlan.Recordset("PlanId"))
End Sub
Sub MovePrevious_OnClick
dsoPlan.Recordset.MovePrevious
SetNavigationButtons
SetRankZero
SetPhysInfo
' Show the Field records for this Plan
FilterPlanField(dsoPlan.Recordset("PlanId"))
End Sub
Sub MoveNext_OnClick
dsoPlan.Recordset.MoveNext
SetNavigationButtons
SetRankZero
SetPhysInfo
' Show the Field records for this Plan
FilterPlanField(dsoPlan.Recordset("PlanId"))
End Sub
Sub MoveLast_OnClick
dsoPlan.Recordset.MoveLast
SetNavigationButtons
SetRankZero
SetPhysInfo
' Show the Field records for this Plan
FilterPlanField(dsoPlan.Recordset("PlanId"))
End Sub
Sub SetNavigationButtons
Dim intShowing, intNewShow
On Error Resume Next
'Save the record number we are about to show
intNewShow = dsoPlan.Recordset("PlanId")
' Loop through recordset until get to the currently displayed plan
dsoPlan.Recordset.MoveFirst
intShowing = 1
Do While dsoPlan.Recordset("PlanId") <> intNewShow
intShowing = intShowing + 1
dsoPlan.Recordset.MoveNext
' Will error if already at last
If Err.Number <> 0 Then
dsoPlan.Recordset.MoveLast
Exit Do
End If
Loop
' Disable or Enable buttons as needed
If intShowing = 1 Then
MoveFirst.Disabled = True
MovePrevious.Disabled = True
Else
MoveFirst.Disabled = False
MovePrevious.Disabled = False
End If
If intShowing = dsoPlan.Recordset.RecordCount Then
MoveLast.Disabled = True
MoveNext.Disabled = True
Else
MoveLast.Disabled = False
MoveNext.Disabled = False
End If
End Sub
' Filter Field records to show those for the current Plan
Sub FilterPlanField(byval PlanId)
dsoField.FilterColumn = "PlanId"
dsoField.FilterCriterion = "="
dsoField.FilterValue = PlanId
dsoField.Reset(False)
End Sub
</SCRIPT>
<% 'End of conditional Script for RDS
End If
%>
</BODY>
</HTML>
<!--END HTML-->
<%
'
'Determine if employee has a qualifier in effect
'
Sub CheckQualifier
Dim Benefit, rstActiveQualifier
Set Benefit = Server.CreateObject("Benefit.BenefitList")
Set rstActiveQualifier = Benefit.CheckQualifier(Application("DSNBenefits"), _
Session("EmployeeId"), m_BenefitId)
If Not rstActiveQualifier.EOF Then
m_ActiveQualifier = 1
End If
End Sub
'
' Get Current Plan
'
Sub GetCurrentPlan
Dim BenefitList, rstCurrentPlan
Set BenefitList = Server.CreateObject("Benefit.BenefitList")
Set rstCurrentPlan = BenefitList.CurrentPlan(Application("DSNBenefits"), Session("EmployeeID"), _
m_BenefitId)
If Not rstCurrentPlan.EOF Then
m_BenefitLabel = rstCurrentPlan("BenefitLabel")
m_CurrentPlanId = rstCurrentPlan("PlanId")
m_DependentCovered = rstCurrentPlan("DependentCovered")
m_TaxStatusId = rstCurrentPlan("TaxStatusId")
m_TaxStatusLabel = rstCurrentPlan("TaxStatusLabel")
End If
End Sub
'
' Get Plan info
'
Sub GetPlanInfo(byval PlanId)
Dim BenefitList, rstPlanInfo
Set BenefitList = Server.CreateObject("Benefit.BenefitList")
Set rstPlanInfo = BenefitList.PlanInfo(Application("DSNBenefits"), _
m_BenefitId, PlanId)
If Not rstPlanInfo.EOF Then
m_PlanLabel = rstPlanInfo("PlanLabel")
m_PlanDesc = rstPlanInfo("PlanDesc")
m_PlanCost = rstPlanInfo("PlanCost")
m_PhysicianRequired = rstPlanInfo("PhysicianRequired")
m_ShowPlanRank = rstPlanInfo("PlanRank")
End If
End Sub
'
' Create Select list of available Plans
'
Sub BuildPlanList
Dim BenefitList, rstPlanList
Set BenefitList = Server.CreateObject("Benefit.BenefitList")
Set rstPlanList = BenefitList.PlanList(Application("DSNBenefits"), m_BenefitId)
Response.Write "<SELECT NAME=RequestPlanId onChange=formPlan.submit() >" & Chr(13)
Do Until rstPlanList.EOF
Response.Write "<OPTION VALUE= "
Response.Write rstPlanList("PlanId")
If rstPlanList("PlanId") = m_ShowPlanId Then
Response.Write " SELECTED "
End If
Response.Write ">" & rstPlanList("PlanLabel") & Chr(13)
rstPlanList.MoveNext
Loop
Response.Write "</SELECT>" & Chr(13)
End Sub
'
' Generate the rows of the Fields for the current Plan.
'
Sub ListPlanField(byval PlanId)
Dim BenefitList, rstPlanField
Set BenefitList = Server.CreateObject("Benefit.BenefitList")
Set rstPlanField = BenefitList.PlanField(Application("DSNBenefits"), PlanId)
Do Until rstPlanField.EOF
Response.Write "<TR>" & Chr(13)
Response.Write "<TH>" & rstPlanField("FieldLabel") & "</TH>" & Chr(13)
Response.Write "<TD> " & rstPlanField("FieldValue") & "</TD>" & Chr(13)
Response.Write "</TR>" & Chr(13)
rstPlanField.MoveNext
Loop
End Sub
'
' Generate the rows for a table consisting of the Dependent info for the current Benefit.
'
Sub ListDependents
Dim BenefitList, rstDependents
Set BenefitList = Server.CreateObject("Benefit.BenefitList")
Set rstDependents = BenefitList.ListDependents(Application("DSNBenefits"), Session("EmployeeId"), _
m_BenefitId)
Do Until rstDependents.EOF
Response.Write "<TR>" & Chr(13)
Response.Write "<TD ALIGN=CENTER> <INPUT TYPE=CHECKBOX NAME=DepCovered " & _
"VALUE=" & rstDependents("DependentId")
If rstDependents("EBDStatusId") = 1 Then
Response.Write " CHECKED ></TD>" & Chr(13)
Else
Response.Write "></TD>" & Chr(13)
End If
Response.Write "<TD>" & rstDependents("DependentTypeLabel") & "</TD>" & Chr(13)
Response.Write "<TD>" & rstDependents("FirstName") & " " & rstDependents("LastName") & " " & "</TD>" & Chr(13)
If (m_PhysicianRequired = 1) OR (Session("UseRDS") = "True") Then
Response.Write "<TD ID=PhysId>"
BuildPhysicianList rstDependents("PhysicianId")
Response.Write "</TD>" & Chr(13)
End If
Response.Write "</TR>" & Chr(13)
rstDependents.MoveNext
Loop
End Sub
'
' Generate the rows for a table consisting of the Covered Persons for the current Benefit.
'
Sub ListCoveredPersons
Dim BenefitList, rstCovered
Set BenefitList = Server.CreateObject("Benefit.BenefitList")
Set rstCovered = BenefitList.ListCoveredPersons(Application("DSNBenefits"), _
Session("EmployeeId"), m_BenefitId)
Do Until rstCovered.EOF
Response.Write "<TR>" & Chr(13)
Response.Write "<TD>" & rstCovered("DependentTypeLabel") & "</TD>" & Chr(13)
Response.Write "<TD>" & rstCovered("FirstName") & " " & rstCovered("LastName") & " " & "</TD>" & Chr(13)
If (m_PhysicianRequired = 1) OR (Session("IEVersion") >= 4) Then
Response.Write "<TD ID=PhysId> "
Response.Write rstCovered("PhysicianLabel")
Response.Write " </TD>" & Chr(13)
End If
Response.Write "</TR>" & Chr(13)
rstCovered.MoveNext
Loop
End Sub
'
' Create Select list of Physicians
'
Sub BuildPhysicianList (ByVal DependentPhysicianId)
Dim BenefitList, rstPhysicianList
Set BenefitList = Server.CreateObject("Benefit.BenefitList")
Set rstPhysicianList = BenefitList.PhysicianList(Application("DSNBenefits"))
Response.Write "<SELECT NAME=PhysicianId >" & Chr(13)
Do Until rstPhysicianList.EOF
Response.Write "<OPTION VALUE=" & rstPhysicianList("PhysicianId")
If rstPhysicianList("PhysicianId") = DependentPhysicianId Then
Response.Write " SELECTED "
End If
Response.Write ">" & rstPhysicianList("PhysicianLabel") & Chr(13)
rstPhysicianList.MoveNext
Loop
Response.Write "</SELECT>" & Chr(13)
End Sub
'
' Determine count of available Tax Statuses
'
Function FindTaxChoice()
FindTaxChoice = True
Dim BenefitList, rstTaxStatusList
Set BenefitList = Server.CreateObject("Benefit.BenefitList")
Set rstTaxStatusList = BenefitList.TaxStatusList(Application("DSNBenefits"), m_BenefitId)
If rstTaxStatusList.RecordCount <2 And Not rstTaxStatusList.EOF Then
FindTaxChoice = False
End If
End Function
'
' Create Radio buttons of available Tax Statuses (or just output the only available status)
'
Sub BuildTaxStatusList
Dim BenefitList, rstTaxStatusList
Set BenefitList = Server.CreateObject("Benefit.BenefitList")
Set rstTaxStatusList = BenefitList.TaxStatusList(Application("DSNBenefits"), m_BenefitId)
If rstTaxStatusList.RecordCount <2 And Not rstTaxStatusList.EOF Then
Response.Write rstTaxStatusList("TaxStatusLabel")
Else
Do Until rstTaxStatusList.EOF
Response.Write "<INPUT TYPE=RADIO NAME=TaxStatus"
If Not IsNull(m_TaxStatusId) Then
If rstTaxStatusList("TaxStatusId") = m_TaxStatusId Then
Response.Write " CHECKED "
End If
Else
If rstTaxStatusList("TaxDefault") = 1 Then
Response.Write " CHECKED "
End If
End If
Response.Write " VALUE=" & rstTaxStatusList("TaxStatusId")
Response.Write ">" & rstTaxStatusList("TaxStatusLabel") & Chr(13)
rstTaxStatusList.MoveNext
Loop
End If
End Sub
'
' Take values from the submitted form and assign to page level variables.
'
Sub GetValuesFromForm
m_intRequestPlanId = Trim(Request.Form("RequestPlanId"))
'If "No Plan Selected" then Tax Status will not be on form
If Trim(Request.Form("TaxStatus")) <> "" Then
m_intTaxStatus = Trim(Request.Form("TaxStatus"))
Else
m_intTaxStatus = 1
End If
End Sub
'
' Update the database. Return 0 if successful or 1 if an error is encountered.
'
Function UpdateBenefit
On Error Resume Next
GetValuesFromForm
Dim Benefit, i
Set Benefit = Server.CreateObject("Benefit.BenefitList")
Benefit.Update Application("DSNBenefits"), Session("EmployeeId"), m_BenefitId, _
m_intRequestPlanId, m_intTaxStatus
' Mark all Dependents as Not Covered (Change status to 2 for InActive )
Benefit.InactivateDependents Application("DSNBenefits"), Session("EmployeeId"), _
m_BenefitId
' Process any Dependents marked as Covered (Change status to 1 for Active )
For i = 1 to Request.Form("DepCovered").Count
' PhysicianId is not included with some plans. If not bound, Count will be 0.
If Request.Form("PhysicianId").Count > 0 Then
Benefit.SaveDependents Application("DSNBenefits"), Session("EmployeeId"), _
m_BenefitId, Request.Form("DepCovered")(i), Request.Form("PhysicianId")(i)
Else
Benefit.SaveDependents Application("DSNBenefits"), Session("EmployeeId"), _
m_BenefitId, Request.Form("DepCovered")(i), m_NoPhysician
End If
Next
If Err.Number = 0 Then
UpdateBenefit = 0
Else
ContextObject.SetAbort
UpdateBenefit = 1
End If
End Function
Sub OnTransactionCommit
End Sub
Sub OnTransactionAbort
m_strMainPrompt = "A problem occurred while trying to update the database. Please try again later. "
End Sub
%>