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

PROJECT CASE STUDY AND DESIGN

Chapter 18

415

 

 

 

 

The relationships between tables in the schema that is shown in Figure 18-1 are explained in Table 18-8.

Table 18-8 Relationships in the SkyShark Airlines Database

Relationship Tables

Relationship

Remarks

dtUsersdtReservations

One-to-many

One line-of-business executive

 

 

can perform one or mor e

 

 

reservations.

dtUsersdtCancellations

One-to-many

One line-of-business executive

 

 

can perform one or mor e

 

 

cancellations.

dtFltDetailsdtReservations

One-to-many

Tickets on one flight can be

 

 

booked more than once in the

 

 

dtReservations table.

dtFltDetailsdtFltStatus

One-to-many

More than one entry for a flight

 

 

in the dtFltDetails table can

 

 

exist in the dtFltStatus table.

dtPassengerDetailsdtDepartedFlights

One-to-many

A passenger in the

 

 

dtPassengerDetails table could

 

 

have boarded a number of flights

 

 

in the dtDepartedFlights table.

dtPassengerDetailsdtFrequentFliers

One-to-one

An entry for the passenger in the

 

 

dtFrequentFliers table should

 

 

exist in the dtPassengerDetails

 

 

table.

 

 

 

You have examined each table of the SkyShark Airlines database and the database schema. Next, you will examine the interface of the application—the Web Forms that constitute the application.

Web Forms Design

As discussed in the previous sections, the Web application for SkyShark Airlines should provide different ASP.NET Web forms for different roles. In this section, I will show you the design of each Web form in the application.

416 Project 4 CREATING AN AIRLINE RESERVATION PORTAL

TIP

To create Web forms discussed in this section, refer to Chapter 20, “Designing the Application.”

The Login Form

The application has a single login form that allows users to log on by using their logon name and password.The login form, Default.aspx, is shown in Figure 18-2.

FIGURE 18-2 The login form for the Web application

The logon credentials specified by users are validated against the dtUsers table. If the logon credentials specified by the user are valid, the role of the user is retrieved from the dtUsers database. Next, the user is redirected to the default form for business managers, line-of-business executives, or network administrators, depending upon the user’s role.

PROJECT CASE STUDY AND DESIGN

Chapter 18

417

 

 

 

 

Forms for Business Managers

The Web application has four forms for business managers: AddFl.aspx, RequestID.aspx, Reports.aspx, and FreqFl.aspx.The next sections discuss each of these forms.

The AddFl.aspx Form

The AddFl.aspx form is used to add new flights to the airline. The information specified by business managers in the AddFl.aspx form is stored in the dtFltDetails table. The AddFl.aspx form is shown in Figure 18-3. Notice that the prefix SS is added to all flight numbers by default, because these initials represent SkyShark Airlines.

FIGURE 18-3 Adding new flights to the airline

The RequestID.aspx Form

Business managers use the RequestID.aspx form to request new user IDs. The request is sent to a network administrator by e-mail. The interface of the RequestID.aspx form is shown in Figure 18-4.

418 Project 4 CREATING AN AIRLINE RESERVATION PORTAL

 

 

Y

 

L

 

F

 

M

 

A

 

E

 

FIGURE 18-4 Requesting new user accounts

 

T

 

 

The Reports.aspx Form

 

 

The Reports.aspx form is used for generating reports. You can view a description of the reports that a business manager can generate in the “Project Requirements” section of this chapter. The Reports.aspx form is shown in Figure 18-5.

FIGURE 18-5 Generating reports for analysis

Team-Fly®

PROJECT CASE STUDY AND DESIGN

Chapter 18

 

419

 

 

 

 

 

 

As you can see in Figure 18-5, you can select parameters for generating reports in the Reports.aspx form. For example, in the monthly flight revenue report, business managers can select the month and year for which the report should be generated. These parameters are internally used by the application to generate the final report.

The FreqFl.aspx Form

The FreqFl.aspx form is used for managing the frequent fliers program.The form is shown in Figure 18-6.

FIGURE 18-6 Enabling the frequent fliers prog ram

The FreqFl.aspx form provides two parameters on which you can enable the frequent fliers program: the number of times that a passenger has flown the flight and the total amount paid by passengers as fare. When a business manager enables the frequent fliers program on these parameters, the eligible passengers are added to the dtFrequentFliers table of the SkyShark Airlines database, which is used for enabling discounts to the selected passengers at the time of reservation.

420 Project 4 CREATING AN AIRLINE RESERVATION PORTAL

Forms for Line-of-Business Executives

Line-of-business executives use four Web forms for their daily operations: CreateRes.aspx, CancelRes.aspx, QueryStat.aspx, and ConfirmRes.aspx. A description of these forms is given in this section.

The CreateRes.aspx Form

The CreateRes.aspx form is used for making reservations to flights. This is the most elaborate of all forms in the Web application. The reservation process is divided into three steps:

1.In Step 1, the line-of-business executive accepts the flight number, class, and date of journey. The information is used to query the status of the flight.

2.In Step 2, the details of the flight and the flight status are displayed to the passenger. If the passenger wants to proceed with the reservation after viewing the details, the line-of-business executive moves to the third step of the reservation process.

3.In Step 3, passengers provide their name and e-mail ID. If the passenger qualifies for the frequent flier program, the appropriate discount is applied to the fare. Finally, the ticket for the passenger is generated.

The CreateRes.aspx form is shown in Figure 18-7.

FIGURE 18-7 Making reservations to flights

PROJECT CASE STUDY AND DESIGN

Chapter 18

421

 

 

 

 

The CancelRes.aspx Form

The CancelRes.aspx form is used for canceling reservations. The only parameter required on this form is the ticket number. After the line-of-business executive specifies the ticket number and cancels the reservation, the ticket is marked as canceled and status of the flight is updated in the dtFltStatus table.The CancelRes.aspx form is shown in Figure 18-8.

FIGURE 18-8 Canceling reservations

The QueryStat.aspx Form

The QueryStat.aspx form is used for retrieving the status of flights and tickets. The status of flights is queried from the dtFltStatus table by using the date, class, and flight number. Similarly, the status of tickets is retrieved from the dtReservations table by using the ticket number. The QueryStat.aspx form is shown in Figure 18-9.

422 Project 4 CREATING AN AIRLINE RESERVATION PORTAL

FIGURE 18-9 Querying the status of flights and tickets

The ConfirmRes.aspx Form

The ConfirmRes.aspx form uses the ticket number to confirm the reservation of a passenger before the departure of a flight. When the line-of-business executive confirms the status of a passenger, the status is updated in the dtReservations table. The ConfirmRes.aspx form is shown in Figure 18-10.

FIGURE 18-10 Confirming reservations

PROJECT CASE STUDY AND DESIGN

Chapter 18

423

 

 

 

 

Forms for Network Administrators

Network administrators can use the SQL Server Enterprise Manager for archiving and backing up databases. However, the SkyShark Airlines application provides two Web forms for simplifying some of the tasks of network administrators. These forms are explained in this section.

The ManageUsers.aspx Form

The ManageUsers.aspx form is used for adding and deleting user accounts. The details of users added or deleted are updated in the dtUsers database.

I have divided the ManageUsers.aspx form into two sections. The first section is used for adding new users and the second one is used for deleting user accounts. The ManageUsers.aspx form is shown in Figure 18-11.

FIGURE 18-11 Adding and deleting user accounts

TIP

The ManageUsers.aspx form is divided into two sections by using DHTML.You will learn how to implement this functionality in Chapter 20.

dtReser-

424 Project 4 CREATING AN AIRLINE RESERVATION PORTAL

The ManageDatabases.aspx Form

The ManageDatabases.aspx form is used for two tasks:

Updating flight information for flights that have departed. Information for flights that have departed needs to be moved from the vations table to the dtDepartedFlights table. Network administrators can move this information by the click of a single button on the ManageDatabases.aspx form.

Updating customer for the frequent fliers program. Information pertaining to the frequent fliers program needs to be retrieved from the

dtDepartedFlights table and updated in the dtPassengerDetails table.

This information can also be updated from the ManageDatabases.aspx form.

The ManageDatabases.aspx form is shown in Figure 18-12.

FIGURE 18-12 Managing databases

Common Forms of the Application

Apart from the Default.aspx form, there are some forms that are common across all roles in the organization. These forms are explained in the following list: