home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / HIWBenefitsDetail.asp < prev    next >
Text File  |  1997-11-01  |  11KB  |  249 lines

  1. <%
  2.  
  3.   ' Save URL of calling page as needed
  4.   SetURLCallHIW
  5.  
  6. %>
  7.  
  8. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
  9. <HTML>
  10. <HEAD>
  11. <!--META TAGS ARE RECOMMENDED FOR THE SEARCH ENGINE-->
  12. <META NAME="DESCRIPTION" CONTENT="How It Works Page">
  13. <META NAME="KEYWORDS" CONTENT="help, code, source code, questions, explanation">
  14. <META NAME="GENERATOR" CONTENT="Microsoft Visual InterDev 1.0">
  15. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1">
  16. <!--END META TAGS-->
  17.  
  18. <TITLE>How The Benefits Detail Page Works</TITLE>
  19. </HEAD>
  20.  
  21. <BODY  BGCOLOR=#FFFFFF TOPMARGIN=0 LEFTMARGIN=0 ALINK=#23238E VLINK=#808080 LINK=#FFCC00>
  22. <BASEFONT FACE="VERDANA, ARIAL, HELVETICA" SIZE=2>
  23.  
  24. <!--Change link color on mouseover
  25.     Only if running Internet Explorer 4.0 or later -->
  26. <!--#include file=../libHighlight.inc-->
  27.  
  28. <!--BEGIN TOP TABLE HOLDING GRAPHIC, NAVIGATIONAL LINK, AND MAIN CONTENT-->
  29. <TABLE WIDTH="100%" HEIGHT="100%" CELLPADDING=0 CELLSPACING=0  BGCOLOR="#000000" BORDER=0>
  30.   <TR>
  31.     <TD BGCOLOR="#000000" ALIGN=CENTER VALIGN=TOP WIDTH=170>
  32.       <BR>
  33.       <IMG SRC="../images/btslarge.jpg" HEIGHT=119 WIDTH=171  
  34.         ALT="Behind the Scenes at Exploration Air" BORDER=0 >
  35.       <BR>
  36.       <BR>
  37.       <BR>
  38.       <!--BACK BUTTON AND VARIABLE TO RETURN TO ORIGINATING PAGE-->
  39.       <A HREF="<%=Session("URLCallHIW")%>">
  40.         <IMG SRC="../images/barrowy.gif" HEIGHT=8 WIDTH=8 ALT="Return to Exploration Air Benefits"  
  41.           HSPACE=2 BORDER=0>
  42.       </A>
  43.       <FONT SIZE=2 FACE="VERDANA, ARIAL, HELVETICA"><STRONG>
  44.         <A HREF="<%=Session("URLCallHIW")%>" TITLE="Return to Exploration Air Benefits">
  45.           B  A  C  K 
  46.         </A>
  47.       </STRONG></FONT>
  48.       <BR> 
  49.       <BR>
  50.       <!--JAVASCRIPT TO VIEW PAGE'S SOURCE CODE-->
  51.       <FONT SIZE=2 FACE="VERDANA, ARIAL, HELVETICA">
  52.         <A HREF="JavaScript:openWindow('../Benefits/DetailInsurance.asp')" 
  53.           TITLE="View the Source for the Default page">
  54.           V I E W   S O U R C E
  55.         </A>
  56.         <BR>
  57.       </FONT>
  58.     </TD>
  59.     <TD BGCOLOR="#FFFFFF" BACKGROUND="../images/btsbg.gif" VALIGN=top>
  60.       <BR CLEAR=ALL>
  61.       <TABLE CELLPADDING=10 CELLSPACING=0 BORDER=0>   
  62.         <TR>
  63.           <TD VALIGN=top>
  64.             <FONT FACE="VERDANA, ARIAL, HELVETICA" COLOR="#0000FF" SIZE=5>
  65.               How The Benefits Detail Page Works
  66.             </FONT>
  67.             <P>
  68.             <HR>
  69.             <FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="3">
  70.                         
  71.             <H2>The Big Picture</H2>
  72.  
  73.             The Benefits Detail page displays information about the benefit which was chosen by clicking 
  74.             a link on the 
  75.             Benefits Summary page. This page can be generated for different benefits, with the particular
  76.             benefit specified as a parameter in calling the ASP script. This page is updateable if 
  77.             the employee has a qualifying change in effect. A qualifying change means that the 
  78.             employee has experienced a recent marriage, childbirth, and so on. 
  79.  
  80.             <H2>Functional Overview</H2>
  81.  
  82.             As on most other pages in the Benefits application, a few standard tasks are
  83.             done at the top of the page. The first is that VBScript is declared the default 
  84.             scripting language for the page. Next, "TRANSACTION=REQUIRED" is specified to cause
  85.             Microsoft Transaction Server to wrap the actions of the page in a transaction.
  86.             Then, "Option Explicit" is specified so that an error will generate unless
  87.             all the variables on the page are explicitly declared. This protects against
  88.             errors caused by misspelling a variable name and having the server treat 
  89.             the misspelled variable name as a new variable declaration.
  90.         
  91.             <P>Next, libAuthenticate.inc checks whether the user has a Session variable containing
  92.             the EmployeeId. If not, then the request is redirected to Benefits/Default.asp 
  93.             to ensure that the application is properly initialized for the user.
  94.  
  95.             <P>Next, page variables are set according to whether the employee clicked <STRONG>Open
  96.             Enrollment</STRONG> or <STRONG>Review/Change Current Benefits</STRONG>. 
  97.             
  98.             <P>If the page is in review/change mode, then the subprocedure <STRONG>CheckQualifier</STRONG> 
  99.             is run to determine if the employee currently has a qualifying change in effect.
  100.             <STRONG>CheckQualifier</STRONG> calls the component method 
  101.             <STRONG><A HREF=HIWBenefitsComponent.asp#CheckQualifier>BenefitList.CheckQualifier</A></STRONG>
  102.             to return information from the database.
  103.             If the employee has a qualifier in effect, then the page will be generated to 
  104.             let the employee change benefit options, such as the plan they are covered 
  105.             under, which dependents are covered, and whether Pre-tax or After-tax earnings 
  106.             will be used to pay the cost of the insurance.
  107.              
  108.             <P>The next step is to process the incoming parameters if this page is calling itself.
  109.             ASP scripts commonly combine page generation and input processing on the same
  110.             page. This means that the same page may both generate the data input form, and also
  111.             update the database with the information that was input on the form.
  112.  
  113.             <P>This concept can take some time to get used to. The important point to remember is
  114.             that the page requires conditional code to know how to process incoming data,
  115.             and a different processing path if it is called from another page than if it calls
  116.             itself. In this page, this is accomplished by testing whether the Form input 
  117.             parameters include "SubmitPlan". If they do, then the page is being called
  118.             by itself, so the page correctly processes the input parameters.
  119.  
  120.             <P>Next, this page determines whether it should use Remote Data Services (RDS).
  121.             It does this by checking the Session
  122.             variable "UseRDS". If so, then the page will be generated 
  123.             to use RDS, otherwise it will be generated to use regular HTML. The advantage of
  124.             using RDS in this case is that all the relevant options for the 
  125.             different plans can be loaded on the client machine, so the client does not need a round trip
  126.             to the server to get information on other plans that the employee wants to see.
  127.  
  128.             <P>This page uses two data binding controls in RDS mode. The first is used to 
  129.             populate multiple HTML fields (SPAN elements). The second is used to populate a table.
  130.             Both controls present the data in view-only mode, with no update capabilities
  131.             implemented.
  132.  
  133.             <P>Whether the page uses RDS or not, the information displayed is conditioned on
  134.             the selected benefit and plan. For example, if the benefit does not cover dependents,
  135.             dependent information will not be displayed. If the plan does not require designation
  136.             of a physician, the physician field will not be displayed. This feature is accomplished 
  137.             through Dynamic HTML if RDS is used, or through server-side scripting if RDS is
  138.             not used. 
  139.  
  140.             <P>This page will accurately reflect the state of the
  141.             application and data. For example, if the client browser is at the end of the
  142.             RDS recordset, the "Next" and "Last" buttons are disabled. If the user is not
  143.             qualified to make changes, the fields all appear as display only.
  144.  
  145.             <H2>Data Model</H2>
  146.  
  147.             You can view a diagram of the <STRONG><A HREF="HIWBenefitsSchema.asp">database</A></STRONG>.
  148.  
  149.             <P>
  150.             <H2>Components Used</H2>
  151.  
  152.             This pages uses methods in the BenefitList class of the Benefit component.
  153.             <BR><STRONG><A HREF=HIWBenefitsComponent.asp#CheckQualifier>BenefitList.CheckQualifier</A></STRONG>
  154.             <BR><STRONG><A HREF=HIWBenefitsComponent.asp#CurrentPlan>BenefitList.CurrentPlan</A></STRONG>
  155.             <BR><STRONG><A HREF=HIWBenefitsComponent.asp#PlanInfo>BenefitList.PlanInfo</A></STRONG>
  156.             <BR><STRONG><A HREF=HIWBenefitsComponent.asp#PlanList>BenefitList.PlanList</A></STRONG>
  157.             <BR><STRONG><A HREF=HIWBenefitsComponent.asp#PlanField>BenefitList.PlanField</A></STRONG>
  158.             <BR><STRONG><A HREF=HIWBenefitsComponent.asp#ListDependents>BenefitList.ListDependents</A></STRONG>
  159.             <BR><STRONG><A HREF=HIWBenefitsComponent.asp#ListCoveredPersons>BenefitList.ListCoveredPersons</A></STRONG>
  160.             <BR><STRONG><A HREF=HIWBenefitsComponent.asp#PhysicianList>BenefitList.PhysicianList</A></STRONG>
  161.             <BR><STRONG><A HREF=HIWBenefitsComponent.asp#TaxStatusList>BenefitList.TaxStatusList</A></STRONG>
  162.             <BR><STRONG><A HREF=HIWBenefitsComponent.asp#UpdateBenefitList>BenefitList.Update</A></STRONG>
  163.             <BR><STRONG><A HREF=HIWBenefitsComponent.asp#InactivateDependents>BenefitList.InactivateDependents</A></STRONG>
  164.             <BR><STRONG><A HREF=HIWBenefitsComponent.asp#SaveDependents>BenefitList.SaveDependents</A></STRONG>
  165.  
  166.             <P>
  167.             </FONT>
  168.           </TD>
  169.         </TR>
  170.       </TABLE>
  171.       <!--END TOP TABLE HOLDING GRAPHIC, NAVIGATIONAL LINK, AND MAIN CONTENT-->
  172.  
  173.       <CENTER>
  174.       <!--BEGIN LEGAL INFORMATION-->
  175.       <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0>
  176.         <TR>
  177.           <TD>
  178.             <FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="1">
  179.               <A HREF="../legal.htm">
  180.                 ©1997 Microsoft Corporation. All rights reserved. Terms of Use.
  181.               </A>
  182.             </FONT>
  183.             <P>
  184.           </TD>
  185.         </TR>
  186.       </TABLE>
  187.       </CENTER>
  188.       <!--END LEGAL INFORMATION-->
  189.     </TD>
  190.   </TR>
  191. </TABLE>
  192.  
  193. </BODY>
  194. </HTML>
  195. <!--END HTML-->
  196.  
  197. <SCRIPT LANGUAGE="JavaScript">
  198. function openWindow(SourceURL)
  199. {
  200.     // Set some defaults
  201.     width=450;
  202.     height=450;
  203.  
  204.     url = "code.asp?Source=" + SourceURL;
  205.     window.open(url,"Sample","resizable=yes,scrollbars=yes,width=" + width + ",height=" + height);
  206. }
  207. </SCRIPT>
  208.  
  209. <%
  210.  
  211.   '
  212.   ' SetURLCallHIW saves the name of the page in the application that called HIW page
  213.   '
  214.   Sub SetURLCallHIW
  215.     ' Extract the last directory from path
  216.     Dim strPathInfo, strLastChar, intLocation, ShortString, strLastDir
  217.     strPathInfo = Request.ServerVariables("HTTP_REFERER")
  218.     ' now str has a value like: "http://servername/exair/benefits/Default.asp"
  219.     ' we need to extract "benefits"
  220.     strLastChar = ""
  221.     ShortString = strPathInfo
  222.     intLocation = 0
  223.     
  224.     If Len(ShortString) > 0 Then
  225.         ' Get position of beginning of file name
  226.         Do Until strLastChar = "/"
  227.           strLastChar = right(ShortString, 1)
  228.           ShortString = left(ShortString, len(ShortString)-1)
  229.           intLocation = intLocation + 1
  230.         Loop
  231.     
  232.         ' Now get position of beginning of last directory name
  233.         strLastChar = ""
  234.         Do Until strLastChar = "/"
  235.           strLastChar = right(ShortString, 1)
  236.           ShortString = left(ShortString, len(ShortString)-1)
  237.           intLocation = intLocation + 1
  238.         Loop
  239.         strLastDir = mid(strPathInfo, len(strPathInfo) - (intLocation - 2), 10)
  240.     
  241.         ' If last directory not 'HowItWorks', then save the calling URL
  242.         If strLastDir <> "HowItWorks" Then
  243.           Session("URLCallHIW") = strPathInfo
  244.         End If
  245.     End If
  246.   End Sub
  247.  
  248. %>
  249.