
C# ПІДРУЧНИКИ / c# / Premier Press - C# Professional Projects
.pdf

DESIGNING THE APPLICATION |
Chapter 20 |
469 |
|
|
|
|
|
ChangePassword.aspx
The ChangePassword.aspx form is used by authenticated users to change their passwords. The controls you need to add to the ChangePassword.aspx form are given in Table 20-4.
Table 20-4 Controls in the ChangePassword.aspx Form
Control Type |
ID |
Properties Changed |
Label |
txtUser |
Text=Changing Password for: |
TextBox |
txtPassword |
TextMode=Password |
TextBox |
txtConfPassword |
TextMode=Password |
Button |
btnSubmit |
Text=Submit |
RequiredFieldValidator |
RequiredFieldValidator1 |
ErrorMessage=Please specify a valid |
|
|
password. |
|
|
ControlToValidate=txtPassword |
RequiredFieldValidator |
RequiredFieldValidator2 |
ErrorMessage=Please specify a valid |
|
|
password. |
|
|
ControlToValidate=txtConfPassword |
CompareValidator |
CompareValidator1 |
ErrorMessage=The passwords |
|
|
specified by you do not match. |
|
|
Please try again. |
|
|
ControlToValidate=txtConfPassword |
|
|
ControlToCompare=txtPassword |
|
|
|
In the ChangePassword.aspx form,the txtUser control is used to display the logon name of the user who is currently logged on.This control is common to all forms in the application. The CompareValidator1 control is used to ensure that the user specifies identical values in the txtPassword and txtConfPassword controls. The completed ChangePassword.aspx form is shown in Figure 20-7.

470 Project 4 CREATING AN AIRLINE RESERVATION PORTAL
FIGURE 20-7 The ChangePassword.aspx form
Forms for Network Administrators
The SkyShark Airlines application provides two forms for business managers, ManageUsers.aspx and ManageDatabases.aspx. The ManageUsers.aspx form is used to add and remove user accounts, and the ManageDatabases.aspx form is used to update databases. I will discuss the design of these two forms in this section.
ManageUsers.aspx
The ManageUsers.aspx form is divided into two sections. One section is used to add user accounts and the other is used to remove user accounts.The controls you need to add to the ManageUsers.aspx form are given in Table 20-5.


472 Project 4 CREATING AN AIRLINE RESERVATION PORTAL
After you add the controls specified in Table 20-5, the design of the ManageUsers.aspx form is complete and is shown in Figure 20-8.
FIGURE 20-8 The ManageUsers.aspx form
ManageDatabases.aspx
The ManageDatabases.aspx form includes two Button controls used for moving information pertaining to flight departure from the dtReservations table to the
dtDepartedFlights table and from the dtDepartedFlights table to the dtPassen-
gerDetails table. Apart from the first four controls consistent in all forms and mentioned in Table 20-5, I have added two Button controls to the form. These controls are described in Table 20-6.

|
DESIGNING THE APPLICATION |
Chapter 20 |
473 |
|||
Table 20-6 Controls in the ManageDatabases.aspx Form |
|
|
|
|
||
|
|
|
|
|||
|
|
|
|
|
|
|
Control Type |
ID |
Properties Changed |
|
|
|
|
|
|
|
|
|
|
|
Button |
btnArchive |
Text=Archive information pertaining |
||||
|
|
to flights that have departed. |
||||
|
|
BackColor=Silver |
|
|
|
|
|
|
BorderColor=Blue |
|
|
|
|
|
|
Font:Name=Bookman Old Style |
||||
Button |
btnUpdate |
Text=Update customer information |
for the frequent fliers program. BackColor=Silver BorderColor=Blue Font:Name=Bookman Old Style
Forms for Business Managers
SkyShark Airlines provides four forms for business managers: AddFl.aspx, RequestID.aspx, Reports.aspx, and FreqFl.aspx.The design of these forms is discussed in this section.
AddFl.aspx
The AddFl.aspx form is used to add details of any new flights introduced by SkyShark Airlines. The design of the AddFl.aspx form is straightforward. Apart from including the first four controls mentioned in Table 20-5, I have added text boxes and validation controls for the flight number, departure time and place, arrival time and destination, aircraft type, number of seats in the executive and business classes, and the fares of the executive and business class fields. I have also added two buttons for submitting and canceling the form. The design of the AddFl.aspx form is shown in Figure 20-9.


DESIGNING THE APPLICATION |
Chapter 20 |
475 |
|
|
|
|
|
FIGURE 20-10 The RequestID.aspx form
Reports.aspx
The Reports.aspx form is used to generate reports. The form uses a DataGrid control to display reports corresponding to the type of report selected by the business manager. You can assign a DataView control to the DataGrid control so that data can be formatted and displayed in the form. A DataView control, in turn, retrieves data from a DataSet control. You will learn about using the DataGrid control in Chapter 21, “Implementing the Business Logic.”
The controls you need to add to the Reports.aspx page are listed in Table 20-8.

476 |
Project 4 |
CREATING AN AIRLINE RESERVATION PORTAL |
||||
|
|
|
|
|
||
|
|
Table 20-8 Controls in the Reports.aspx Form |
|
|||
|
|
|
|
|
|
|
|
|
Control Type |
ID |
Properties Changed |
||
|
|
|
|
|
|
|
|
|
Label |
|
Label1 |
Text=Select a report: |
|
|
|
Label |
|
Label2 |
Text=Generate a flight usage report |
|
|
|
|
|
|
|
for all flights flown by the airline. |
|
|
Label |
|
Label3 |
Generate a customer affinity report |
|
|
|
|
|
|
|
for top 100 customers |
|
|
Label |
|
Label4 |
Generate a total revenue report from |
|
|
|
|
|
|
|
the month |
|
|
Buttons (3) |
Button1, 2, 3 |
Text=Generate |
||
|
|
|
|
|
|
BackColor=Silver |
|
|
|
|
|
|
BorderColor=Blue |
|
|
ListBox |
lstMonth |
Items=1, 2, 3, 4, 5, 6, 7,8, 9, 10, 11, |
||
|
|
|
|
|
|
12 |
|
|
ListBox |
lstYear |
Items=2002, 2003, 2004, 2005 |
||
|
|
DataGrid |
DataGrid1 |
BorderColor=#8080FF |
||
|
|
|
|
|
|
Font:Name=Bookman Old Style |
|
|
|
|
|
|
BorderStyle=Inset |
|
|
|
|
|
|
BorderWidth=2px |
|
|
|
|
|
|
|
The completed Reports.aspx form is shown in Figure 20-11.
