- •About the Authors
- •Contents at a Glance
- •Contents
- •Introduction
- •Goal of the Book
- •How to Use this Book
- •Introduction to the .NET Framework
- •Common Language Runtime (CLR)
- •Class Library
- •Assembly
- •Versioning
- •Exceptions
- •Threads
- •Delegates
- •Summary
- •Introduction to C#
- •Variables
- •Initializing Variables
- •Variable Modifiers
- •Variable Data Types
- •Types of Variables
- •Variable Scope
- •Types of Data Type Casting
- •Arrays
- •Strings
- •Initializing Strings
- •Working with Strings
- •Statements and Expressions
- •Types of Statements
- •Expressions
- •Summary
- •Classes
- •Declaring Classes
- •Inheritance
- •Constructors
- •Destructors
- •Methods
- •Declaring a Method
- •Calling a Method
- •Passing Parameters to Methods
- •Method Modifiers
- •Overloading a Method
- •Namespaces
- •Declaring Namespaces
- •Aliases
- •Structs
- •Enumerations
- •Interfaces
- •Writing, Compiling, and Executing
- •Writing a C# Program
- •Compiling a C# Program
- •Executing a C# Program
- •Summary
- •Arrays
- •Single-Dimensional Arrays
- •Multidimensional Arrays
- •Methods in Arrays
- •Collections
- •Creating Collections
- •Working with Collections
- •Indexers
- •Boxing and Unboxing
- •Preprocessor Directives
- •Summary
- •Attributes
- •Declaring Attributes
- •Attribute Class
- •Attribute Parameters
- •Default Attributes
- •Properties
- •Declaring Properties
- •Accessors
- •Types of Properties
- •Summary
- •Introduction to Threads
- •Creating Threads
- •Aborting Threads
- •Joining Threads
- •Suspending Threads
- •Making Threads Sleep
- •Thread States
- •Thread Priorities
- •Synchronization
- •Summary
- •Case Study
- •Project Life Cycle
- •Analyzing Requirements
- •High-Level Design
- •Primary and Foreign Keys
- •Referential Integrity
- •Normalization
- •Designing a Database
- •Low-Level Design
- •Construction
- •Integration and Testing
- •User Acceptance Testing
- •Implementation
- •Operations and Maintenance
- •Summary
- •Creating a New Project
- •Console Application
- •Windows Applications
- •Creating a Windows Application for the Customer Maintenance Project
- •Creating an Interface for Form1
- •Creating an Interface for WorkerForm
- •Creating an Interface for CustomerForm
- •Creating an Interface for ReportsForm
- •Creating an Interface for JobDetailsForm
- •Summary
- •Performing Validations
- •Identifying the Validation Mechanism
- •Using the ErrorProvider Control
- •Handling Exceptions
- •Using the try and catch Statements
- •Using the Debug and Trace Classes
- •Using the Debugging Features of Visual Studio .NET
- •Using the Task List
- •Summary
- •Creating Form1
- •Connecting WorkerForm to the Workers Table
- •Connecting CustomerForm to the tblCustomer Table
- •Connecting the JobDetails Form
- •to the tblJobDetails Table
- •Summary
- •Introduction to the Crystal Reports Designer Tool
- •Creating the Reports Form
- •Creating Crystal Reports
- •Creating the Windows Forms Viewer Control
- •Creating the Monthly Worker Report
- •Summary
- •Introduction to Deploying a Windows Application
- •Deployment Projects Available in Visual Studio .NET
- •Deployment Project Editors
- •Summary
- •Case Study
- •Project Life Cycle
- •Analyzing Requirements
- •High-Level Design
- •Low-Level Design
- •Summary
- •Populating the TreeView Control
- •Displaying Employee Codes in the TreeView Control
- •Event Handling
- •Displaying Employee Details in the ListView Control
- •Summary
- •Case Study
- •Project Life Cycle
- •Analyzing Requirements
- •High-Level Design
- •Low-Level Design
- •Summary
- •Adding the Programming Logic to the Application
- •Adding Code to the Form Load() Method
- •Adding Code to the OK Button
- •Adding Code to the Exit Button
- •Summary
- •The Created Event
- •Adding Code to the Created Event
- •Overview of XML
- •The XmlReader Class
- •The XmlWriter Class
- •Displaying Data in an XML Document
- •Displaying an Error Message in the Event Log
- •Displaying Event Entries from Event Viewer
- •Displaying Data from the Summary.xml Document in a Message Box
- •Summary
- •Airline Profile
- •Role of a Business Manager
- •Role of a Network Administrator
- •Role of a Line-of-Business Executive
- •Project Requirements
- •Creation and Deletion of User Accounts
- •Addition of Flight Details
- •Reservations
- •Cancellations
- •Query of Status
- •Confirmation of Tickets
- •Creation of Reports
- •Launch of Frequent Flier Programs
- •Summarizing the Tasks
- •Project Design
- •Database Design
- •Web Forms Design
- •Enabling Security with the Directory Structure
- •Summary
- •Getting Started with ASP.NET
- •Prerequisites for ASP.NET Applications
- •New Features in ASP.NET
- •Types of ASP.NET Applications
- •Exploring ASP.NET Web Applications
- •Introducing Web Forms
- •Web Form Server Controls
- •Configuring ASP.NET Applications
- •Configuring Security for ASP.NET Applications
- •Deploying ASP.NET Applications
- •Creating a Sample ASP.NET Application
- •Creating a New Project
- •Adding Controls to the Project
- •Coding the Application
- •Summary
- •Creating the Database Schema
- •Creating Database Tables
- •Managing Primary Keys and Relationships
- •Viewing the Database Schema
- •Designing Application Forms
- •Standardizing the Interface of the Application
- •Common Forms in the Application
- •Forms for Network Administrators
- •Forms for Business Managers
- •Forms for Line-of-Business Executives
- •Summary
- •The Default.aspx Form
- •The Logoff.aspx Form
- •The ManageUsers.aspx Form
- •The ManageDatabases.aspx Form
- •The ChangePassword.aspx Form
- •Restricting Access to Web Forms
- •The AddFl.aspx Form
- •The RequestID.aspx Form
- •The Reports.aspx Form
- •The FreqFl.aspx Form
- •Coding the Forms for LOB Executives
- •The CreateRes.aspx Form
- •The CancelRes.aspx Form
- •The QueryStat.aspx Form
- •The ConfirmRes.aspx Form
- •Summary
- •Designing the Form
- •The View New Flights Option
- •The View Ticket Status Option
- •The View Flight Status Option
- •The Confirm Reservation Option
- •Testing the Application
- •Summary
- •Locating Errors in Programs
- •Watch Window
- •Locals Window
- •Call Stack Window
- •Autos Window
- •Command Window
- •Testing the Application
- •Summary
- •Managing the Databases
- •Backing Up the SkyShark Airlines Databases
- •Exporting Data from Databases
- •Examining Database Logs
- •Scheduling Database Maintenance Tasks
- •Managing Internet Information Server
- •Configuring IIS Error Pages
- •Managing Web Server Log Files
- •Summary
- •Authentication Mechanisms
- •Securing a Web Site with IIS and ASP.NET
- •Configuring IIS Authentication
- •Configuring Authentication in ASP.NET
- •Securing SQL Server
- •Summary
- •Deployment Scenarios
- •Deployment Editors
- •Creating a Deployment Project
- •Adding the Output of SkySharkDeploy to the Deployment Project
- •Deploying the Project to a Web Server on Another Computer
- •Summary
- •Organization Profile
- •Project Requirements
- •Querying for Information about All Books
- •Querying for Information about Books Based on Criteria
- •Ordering a Book on the Web Site
- •Project Design
- •Database Design
- •Database Schema
- •Web Forms Design
- •Flowcharts for the Web Forms Modules
- •Summary
- •Introduction to ASP.NET Web Services
- •Web Service Architecture
- •Working of a Web Service
- •Technologies Used in Web Services
- •XML in a Web Service
- •WSDL in a Web Service
- •SOAP in a Web Service
- •UDDI in a Web Service
- •Web Services in the .NET Framework
- •The Default Code Generated for a Web Service
- •Testing the SampleWebService Web Service
- •Summary
- •Creating the SearchAll() Web Method
- •Creating the SrchISBN() Web Method
- •Creating the AcceptDetails() Web Method
- •Creating the GenerateOrder() Web Method
- •Testing the Web Service
- •Securing a Web Service
- •Summary
- •Creating the Web Forms for the Bookers Paradise Web Site
- •Adding Code to the Web Forms
- •Summary
- •Case Study
- •Project Life Cycle
- •Analyzing Requirements
- •High-Level Design
- •Low-Level Design
- •Summary
- •Overview of Mobile Applications
- •The Microsoft Mobile Internet Toolkit
- •Overview of WAP
- •The WAP Architecture
- •Overview of WML
- •The Mobile Web Form
- •The Design of the MobileTimeRetriever Application
- •Creating the Interface for the Mobile Web Forms
- •Adding Code to the MobileTimeRetriever Application
- •Summary
- •Creating the Forms Required for the MobileCallStatus Application
- •Creating the frmLogon Form
- •Creating the frmSelectOption Form
- •Creating the frmPending Form
- •Creating the frmUnattended Form
- •Adding Code to the Submit Button in the frmLogon Form
- •Adding Code to the Query Button in the frmSelectOption Form
- •Adding Code to the Mark checked as complete Button in the frmPending Form
- •Adding Code to the Back Button in the frmPending Form
- •Adding Code to the Accept checked call(s) Button in the frmUnattended Form
- •Adding Code to the Back Button in the frmUnattended Form
- •Summary
- •What Is COM?
- •Windows DNA
- •Microsoft Transaction Server (MTS)
- •.NET Interoperability
- •COM Interoperability
- •Messaging
- •Benefits of Message Queues
- •Limitations
- •Key Messaging Terms
- •Summary
- •Pointers
- •Declaring Pointers
- •Types of Code
- •Implementing Pointers
- •Using Pointers with Managed Code
- •Working with Pointers
- •Compiling Unsafe Code
- •Summary
- •Introduction to the Languages of Visual Studio .NET
- •Visual C# .NET
- •Visual Basic .NET
- •Visual C++ .NET
- •Overview of Visual Basic .NET
- •Abstraction
- •Encapsulation
- •Inheritance
- •Polymorphism
- •Components of Visual Basic .NET
- •Variables
- •Constants
- •Operators
- •Arrays
- •Collections
- •Procedures
- •Arguments
- •Functions
- •Adding Code to the Submit Button
- •Adding Code to the Exit Button
- •Summary
- •Introduction to Visual Studio .NET IDE
- •Menu Bar
- •Toolbars
- •Visual Studio .NET IDE Windows
- •Toolbox
- •The Task List Window
- •Managing Windows
- •Customizing Visual Studio .NET IDE
- •The Options Dialog Box
- •The Customize Dialog Box
- •Summary
- •Index
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 |
dtUsers—dtReservations |
One-to-many |
One line-of-business executive |
|
|
can perform one or mor e |
|
|
reservations. |
dtUsers—dtCancellations |
One-to-many |
One line-of-business executive |
|
|
can perform one or mor e |
|
|
cancellations. |
dtFltDetails—dtReservations |
One-to-many |
Tickets on one flight can be |
|
|
booked more than once in the |
|
|
dtReservations table. |
dtFltDetails—dtFltStatus |
One-to-many |
More than one entry for a flight |
|
|
in the dtFltDetails table can |
|
|
exist in the dtFltStatus table. |
dtPassengerDetails—dtDepartedFlights |
One-to-many |
A passenger in the |
|
|
dtPassengerDetails table could |
|
|
have boarded a number of flights |
|
|
in the dtDepartedFlights table. |
dtPassengerDetails—dtFrequentFliers |
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.
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: