Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Microsoft C# Professional Projects - Premier Press.pdf
Скачиваний:
177
Добавлен:
24.05.2014
Размер:
14.65 Mб
Скачать

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.

 

DESIGNING THE APPLICATION

Chapter 20

471

Table 20-5 Controls in the ManageUsers.aspx Form

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Control Type

ID

Properties Changed

 

 

 

 

 

 

 

 

 

 

Label

txtUser

Text=Changing Password for:

HyperLink

HyperLink1

NavigateUrl=ChangePassword.aspx

 

 

Text=Change Password

 

 

 

 

HyperLink

HyperLink2

NavigateUrl=../Logoff.aspx

 

 

Text=Logoff

 

 

 

 

Label

lblMessage

Text=""

 

 

 

 

 

 

ForeColor=Red

 

 

 

 

 

 

Font:Bold=True

 

 

 

 

Button (HTML)

AddUser

None (HTML control)

 

 

 

 

Button (HTML)

DeleteUser

None (HTML control)

 

 

 

 

TextBox

txtAddUserName

None

 

 

 

 

TextBox

txtAddPassword

TextMode=Password

 

 

 

 

TextBox

txtAddConfPassword

TextMode=Password

 

 

 

 

ListBox

lstAddRole

Items=BM, NA, LOB

 

 

 

 

Button

btnAddSubmit

Text=Submit

 

 

 

 

TextBox

txtDelUserName

None

 

 

 

 

Button

btnDelDelete

Text=Delete

 

 

 

 

 

 

 

 

 

 

 

TIP

In the ManageUsers.aspx form, items are added to the lstAddRole property by using the ListItem Collection Editor. The ListItem Collection Editor is invoked when you click on the ellipsis button in the Items property.

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.

474 Project 4 CREATING AN AIRLINE RESERVATION PORTAL

FIGURE 20-9 The AddFl.aspx form

RequestID.aspx

The RequestID.aspx form is used by business managers to request for new user IDs. The controls in the RequestID.aspx form are listed in Table 20-7.

Table 20-7 Controls in the RequestID.aspx Form

Control Type

ID

Properties Changed

TextBox

txtUserID

None

RequiredFieldValidator

RequiredFieldValidator1

ErrorMessage=Please specify a valid

 

 

user name.

 

 

ControlToValidate=txtUserID

ListBox

lstRole

Items=Admin,BM, NA

Button

btnSubmit

Text=Submit Mail

 

 

BackColor=Silver

 

 

BorderColor=Blue

 

 

 

The RequestID.aspx form is shown in Figure 20-10.

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.

DESIGNING THE APPLICATION

Chapter 20

477

 

 

 

 

FIGURE 20-11 The Reports.aspx form

FreqFl.aspx

The FreqFl.aspx form is used to make the frequent fliers program available to passengers. The form is similar to the Reports.aspx form.The FreqFl.aspx form uses the DataGrid control to list users entitled to the frequent fliers program. The design of the FreqFl.aspx form is shown in Figure 20-12.

FIGURE 20-12 The FreqFl.aspx form