Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

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

.pdf
Скачиваний:
475
Добавлен:
12.02.2016
Размер:
14.7 Mб
Скачать

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:

PROJECT CASE STUDY AND DESIGN

Chapter 18

425

 

 

 

 

ChangePassword.aspx. The ChangePassword.aspx form is used for changing the password of a user. This form has a consistent interface across all roles in the airline.

Header.aspx. The Header.aspx form is used for displaying the header of every form, which contains the banner.

Logoff.aspx. The Logoff.aspx form is used for logging off a user from the Web application. The Logoff.aspx form is shown in Figure 18-13.

FIGURE 18-13 Logging off users from the Web application

Enabling Security with the Directory Structure

Whenever you create a new application, you need to secure it. This especially holds true for ASP.NET applications because they need to be protected from unauthorized intruders from the Internet. Security is not an issue that can be dealt with only after applications are complete. Instead, you need to plan for the security of the application from the conception stage.

ASP.NET enables you to implement directory-level security. Thus, you can grant permissions to different uses for accessing forms stored in different directories. This ability of ASP.NET is especially useful for your airline application.

426 Project 4 CREATING AN AIRLINE RESERVATION PORTAL

SkyShark Airlines has different roles defined for its executives. Each role has a set of tasks defined for it. These tasks do not overlap. Therefore, your application should not allow a line-of-business executive to add a new flight by using the ASP.NET forms that is to be used by business managers. As a result, you need to authenticate users to access the Web site and restrict users from accessing forms based upon their respective roles.

To enable such a security model on your Web site, you can implement either of the following methods:

Place ASP.NET forms into different folders based upon the roles of users who need to access these forms and use different security settings for the folders.

Programmatically manage access to ASP.NET forms of the Web application.

In the airline application, I implement both the methods described above. Different folders are created for forms pertaining to different roles and access to ASP.NET forms is controlled programmatically. You can learn about restricting access to ASP.NET forms programmatically in Chapter 25,“Securing the Application.” However, I will examine the directory structure of the application, which is always finalized in the early phases of the project.

In the SkyShark Airlines application, the ASP.NET forms pertaining to the three business roles are given as follows:

Business managers. AddFl.aspx, RequestID.aspx, Reports.aspx, and FreqFl.aspx

Line-of-business executives. CreateRes.aspx, CancelRes.aspx, QueryStat.aspx, and ConfirmRes.aspx

Network administrators. ManageUsers.aspx and ManageDatabases.aspx

The application root directory should therefore have three subdirectories: BM, LOB,and NA.Each of these subdirectories will store files as per the scheme given in the previous list. The final directory structure for the SkyShark Airlines application is given in Figure 18-14.

PROJECT CASE STUDY AND DESIGN

Chapter 18

427

 

 

 

 

FIGURE 18-14 Directory structure for the SkyShark Airlines application

Note that in the preceding directory structure, I have not shown the Images folder, but in the final application, the Images folder is present in all subdirectories and holds figures that are used on Web pages.

Summary

The ASP.NET professional project is based upon the business transactions of a fictitious airline, SkyShark Airlines. Executives in SkyShark Airlines can be categorized into three roles: business management, line-of-business operations, and network administrators.

Business managers are responsible for framing policies and analyzing the performance of the airline. Similarly, line-of-business executives are responsible for