The Big Picture
This page is used to enter employee information such as address, phone number, etc.
It also has a button that will take you to the page for adding a dependent.
Functional Overview
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.
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.
Next, page variables are initialized, then the subprocedure GetValuesFromDatabase
is called to get the current employee profile information from the database
by calling the component method
Employee.GetForID.
The subprocedure BuildGenderList is called to create a select list of
the available Genders from the database by calling the component method
BenefitList.GenderList
A table of dependent records for the employee
are created by the subprocedure ListDependents, which retrieves records from
the database by calling
Employee.GetDependents.
The page is sent to the client
browser for entry of the dependent information. A client-side script is run to validate
the data entered, then the data is sent to the server. The server runs a
subprocedure to get the data into the appropriate fields, then calls the function
"UpdateDatabase". The UpdateDatabase function calls
the component method
Employee.Update to update the employee records.
The UpdateDatabase function calls the component method
Employee.UpdateDependent
to update dependent records.
The UpdateDatabase function then calls the component method
Employee.RemoveDependent to remove any dependents who are marked for
removal from the employee records.
If the Add Dependent button is clicked, the page will redirect to
DependentAdd.asp after updating the employee tables.
Data Model
You can view a diagram of the database.
Components Used
This pages uses methods in the BenefitList class of the Benefit component.
Employee.GetForID
BenefitList.GenderList
Employee.GetDependents
Employee.Update
Employee.UpdateDependent
Employee.RemoveDependent