Sie sind auf Seite 1von 118

School of Computer Science

MASTER OF SCIENCE IN (Computer Science)

Project Report

Flight Reservation System

Author
A.ALANAZI
07169574

Supervisor: Dr Boekhorst, Rene te


Second Marker: Bennett, Steve

Month and year of submission


01/2011

Table of content
Abstract...........................................................................................................................4
Acknowledgement........5
Chapter 1: Introduction........6
1.1 Background to the Project....6
1.2 Project Objectives.....6
1.3 Overview of This Report......7
Chapter 2: Literature review and background research.........10
2.1 Pricing Factors.....15
2.1.1 Jet Fuel.....................................................................................................16
2.1.2 Season..............19
2.1.3 Time of flight................19
2.1.4 Time of Purchase............19
2.1.5 Day of Flight.................24
2.1.6 Route popularity...............28
2.1.7 Plane Loads..............28
2.1.8 Airport Congestion...............28
2.1.9 Local Events.................29
Chapter 3: Requirements................31
3.1 Interview Technique................31
3.2 Survey...............31
3.3 Questionnaire ..............31
3.4 Functional Requirements..............................................................................32
3.5 None Functional Requirements.............33
Chapter 4: Methodology..............34
Chapter 5: Analysis..............35
5.1 Domain Analysis..............35
5.2 Use Case..............35
Chapter 6: Design............................................................................................................37
6.1 Prototype Modelling............37
6.1.1 Main Page Layout...........39
6.1.2 Select Flight Page...........40
6.2 Object Modelling.............40
6.3 Modelling Behaviour of the prototype..........44
6.4 ER Modelling...................................................................................................45
6.5 Normalization...................................................................................................46
Chapter 7: Implementation .............51
7.1 Data Layer.....................................................................................................51
7.2 Presentation Layer...........52
7.3 Business Layer.............54
Chapter 8: Testing ...........................................................................................................56
8.1 Unit Testing...............56
8.2 System Testing.............57
Chapter 9: Critical Appraisal ..............58
9.1 Evaluation of Project against Objectives..........58
9.2 Heuristic Evaluation ...........60
Chapter 10: Conclusion...................................................................................................62
2

Bibliography and References...........................................................................................64


Appendix .........................................................................................................................66

Table of figures
index
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

Figure
Figure 2.1: Jet Fuel Price
Figure 2.2: Fuel Cost and Consumption
Figure 2.3: Fourth Quarter Average
Figure 2.4: Flight prices for 26 week ahead
Figure 2.5: Price reduction for the first 26 week ahead
Figure 2.6: Flight prices LHR - JFK
Figure 2.7: Weekends and weekdays prices and trends (London Amsterdam)
Figure 2.8: Weekends and weekdays prices and trends(London-Zurich)
Figure 2.9: Weekends and weekdays prices percentage average prices
Figure 4.1: Process Structure of RUP
Figure 5.1: Admin use case
Figure 5.2: Customer use case
Figure 6.1: Fly BMI System
Figure 6.2: Easy Jet System
Figure 6.3: Main page layout
Figure 6.4: Select Flight page
Figure 6.5: Presentation Layer
Figure 6.6: Data Layer
Figure 6.7: Business Layer
Figure 6.8: Customer modelling behaviour
Figure 6.9 :Flight location new tables
Figure 6.10 :Payment new tables
Figure 6.11: Database diagram before normalization
Figure 6.12: Database diagram after normalization

page
17
17
18
22
23
24
26
27
27
34
36
36
38
38
39
40
41
42
43
44
47
48
49
50

Abstract
The airline industry is characterised by rapid change, innovation and new technology. It is a
dynamic growth industry which archives millions of dollars each year. My focus is on the factors
that enter into determining a fare rate, whether domestic or international. Two broader terms
are used when we talk about these factors i.e. Cost of Service and Value of Service. The first
one is easy to get as it says that airline should only have to charge against its services and by
value of service it means that a carrier should charge what the traffic will bear. Fare rates are
determined by a complex interaction of both Cost of Service and Value of Service. The
project aims to develop an airline reservation system which will provide customers a facility to
reserve there tickets without any hassle. It is a web based system developed using current
software industry standards which gives its users most of the online. The secondary aim of this
project develop a pricing algorithm for my application based on the current pricing system
which airlines are using and the factors which impact these pricing systems.

Acknowledgment
I would like to thank my family who always support me in my study. They were the reason that
keeps me go further and to be successful in my life. Also I would like to take the chances to
thank my supervisor Dr. Rene, who was the light that I use in the darkness which guides me to
the right way. He has been the most helpful to me and supports me when I need him. Finally I
would like to thank the University of Hertfordshire and its staff that provide us a perfect
environment and good facility to help us in our projects and researches.

Chapter 1: Introduction
1.1 Project Background
The basic intend of this project is to build up an Airline Reservation System which will help
people to book tickets for their trips. Airline reservation system is complex system and making
it to be managed by software system instead of human will help to avoid a big percents of
mistakes. It will make process of scheduling trips more easer and prevent conflicting in times,
also it will help customers to book their tickets from their homes and the pricing system will be
automated to increase and decrease depending of the season and availability and time of
booking, also depending of the class that customer select and all these factors will be calculated
automatically and instantly. It will be a web based system which will be available 24/7 to allow
customers to book their tickets anytime. I have divided this project into two major phases
which are

Research on air lines pricing factors.


In this phase a research had been done on the factors involved in calculating fare of a
ticket such as fuel price, flight schedule, season etc.

Software Development

For the software development I have adopted Rational Unified Process (RUP) as the
development process and Prototype as development model. For implementation I have
used N tier architecture which is a standard now a day for the development of web
solutions.

1.2 Project Objectives


The project objectives should be set before the start of project because they provide a
guideline during the whole project and prevent researcher/developer to progress in wrong
6

direction. I have divided my project objectives into two parts; Core and Advance. My core
objectives are those which I must need to achieve to do this project successfully and advance
objectives are the ones which I will attempt based on the time frame of this project.

Following are the main tasks to be performed to achieve the objective of this project.

Investigate the pricing factors in airlines industry.

Identify all the user, software and system requirements for the Airline Reservation
System.

To understand web technologies.

To explore .NET technology standards that can help in developing system.

Use current software development process and model for the development of the
system.

Design and implement a website which will cover initial requirements of the system.

To effectively plan, control and achieve project objectives.

These milestones gradually produce the final objective of the project to develop a system that
could handle the complex procedures of flight reservation system that

Allowing customers to confirm tickets by doing payment for their trips.

Allowing customers to get ticket electronically (e-ticket).

Giving customers seasonal and other discount offers.

Giving customers a price comparison for the trip they want to book.

The advanced objective of this project is to include an automatic price update using a model
that is based on observations from a real airline company.
1.3 Project Overview
Below I have mentioned the structure of my dissertation which describes the way I have done
my research and applied it on the development of prototype.
Chapter 1: Introduction

The first chapter provides user an understanding about the project scope, problem area and the
structure which would be followed in the dissertation. I have also set the basic and advance
objectives of the project in this chapter.
Chapter 2: Literature Review
The main areas of my research focus on determining the factors which impact on the ticket
pricing and developing understanding how my system will do pricing. In this section I will
investigate the background of flight reservation system and pricing factors and impacts of these
factors.

Chapter 3: Requirement Gathering


Requirement gathering is a process which comes in the beginning of the project. In this chapter
I have discussed the techniques I have adopted for data and requirement gathering. With that I
have also developed a questioner from which I will get initial idea about the customer problems
which they face while booking their tickets. Using that information I will try to bring the
common functionalities which user wants in a system and avoid those which makes system
complex for the customers.

Chapter 4: Methodology
For development of any software application we must have to adopt some kind of technique
which handles all the project development phases. To handle the project development life cycle
I have used Rational Unified Process and the model which I adopted is prototype model. I have
discussed both of them in this chapter and also provided reasons why I have selected these
two.

Chapter 5: Analysis
Design and analysis is always an important phase of the project. More strong the design and
analysis are the more stable and reliable application would be developed. All the analysis I have
done for this project is described in this chapter.

Chapter 6: Design
This is the stage where I have listed down my system functionalities. What I have to do now is
to design how customers will interact with my system and how system unit will perform their
functionalities. In this chapter I have used UML diagrams to model user requirements and
system functionalities. Furthermore, in this chapter I am going to write a brief paragraph about
data modelling and normalization. Also I will include database ER design then I am planning to
show database graph before and after normalization process.

Chapter 7: Implementation
This is the section in which I have discussed the architecture I adopted for the implementation.
I have also described how I have divided my code into layers, responsibility of each layer and
what I have included in each layer.

Chapter 8: Testing
Once the implementation phase is done, I will perform testing to locate errors which need to
remove before system goes live. In this section, I have described the testing techniques I have
used and the way I have done testing of the prototype developed.

Chapter 9: Critical Appraisal


In this section I have discussed the objectives I defined in the start and how I have achieved
those while moving forward in the project.

Chapter 10: Conclusion


In conclusion I have provided reader the overall conclusion of this project. I have mentioned my
achievements and the future work required which I concluded after doing whole research and
development for this project.

Chapter 2: Literature review and background research


By convergence of the world into a global village, travelling several thousand miles has
become so common for not only business but also for pleasure purposes. Due to the fast paced
nature of the world today, air travel is considered as one of the first choice among several
modes of travels to save time. Modern air travel industry has advanced to a level, where fleets
and services are shared among the system of systems being run by independent vendors or
service providers. This has resulted in tough competition among the airlines in the world to
attract more and more passengers by offering discounts in conjunction with a great deal of
luxuries to the clients. Keeping in mind the fact that people might not have enough time out of
their busy routine to go and visit a travel agent in order to make a reservation, most airlines
have offered their services over the World Wide Web. By having all companies their flights and
fleets data available to the end users over the web, it is now possible for the third party web
agent websites to make use of services and data shared by different airlines and replicate the
role of a travel agent sitting in the market. There are also several third parties web agents who
facilitate the reservation with an airline for a particular trip. Therefore internet has become the
integral part of the flight reservation not only for travel agents, who sitting in the office make
use of web servers of different airlines to find out the most suitable flight for a particular
customer, but also for the customers who want to reserve flight online without necessarily
having to contact air travel agents (Jones 2004). There are several phases for a particular air
travel; however reservation and check-in are the most important points of attachment between
customers and the airlines. The efficiency of the process of booking results in better customer
experience (Hexaware Technologies n.d).
10

Most of the airlines in the world are making use of IT to facilitate customization of client
trips and to better manage the airline operations. An online airline reservation system
comprises of other sub systems to perform a range of tasks from start to end of a journey.
Computer based passenger reservations systems provide accurate as well as timely information
concerning passenger number and flights involved (Jones 2004). This information is then used
as an input for the other systems to make strategic decisions by the airline management.
Through linking airlines, computerized flight reservation system can practically link almost all
airlines in addition to providing advantage of efficiency, reliability and labour cost reduction
(Jones 2004). Automation of flight reservation process allows airlines to simulate alterations in
flight schedules and also predict the effect of those alterations on the revenue base (Vidgen,
Avison, and Wood 2002). In the past applications have been developed using the distributed
systems technology but these apps were lacking adaptability in the business process changes
and reusability factor was also too low. The modern airline systems built on web technologies
offer centralized reusable services based on SOA (Service Oriented Architecture). These systems
dramatically enhance the system flexibility along with providing a mechanism for information
sharing with other systems. These services are achieved through development and
implementation of flight reservation web service (Lang, Wojtkowski and Wojtkowski 2008).
A typical flight reservation system asks information from the customers about origin,
destination, passengers, flight dates and travel document identity. Some of the vital details
include: name, gender, age, address, passport number, the type of plane the customer would
like to travel in and the customers destination point (Jones 2004). The most important part of
any reservation system is its search functionality in able to find out several direct and indirect
flight options for a client according to the given parameters. During the search phase,
additional information may also be presented to the customer such as the lowest fare on a
11

particular date, number of available seats at the point of search. System should also display the
unavailability of seats meeting the desired criteria but in a polite manner (Lang, Wojtkowski nd
Wojtkowski 2008). Cancellation of reserved seat and any permissible changes in the reservation
should also be part of reservation system. Flight reservation system should be efficient enough
to re-track the number of available seat as soon as a cancellation is made. The flight reservation
system should possess the capacity to print tickets with all the details such as flight details,
passenger data, the class, name of the plane, in addition to destination. Price list of various
tickets should also be included in the system (Vidgen, Avison, and Wood 2002). An adequate
search from a typical reservation system returns enough number of flights having different
price class to meet the needs of passengers according to their budget. Online reservation
system has the strong capability to reduce errors that might have occurred when using a
manual system of reservation. The online system makes it suitable for customers to book the
flights as when they require. Customers can therefore make use of this system to make
reservations, modify reservations in addition to cancel reservations. The flight reservation
system software should be specially developed so as to function as an independent application.
It should be established as a self-contained product (Milde 2008).
Flight reservation system should be capable of interacting with hardware and software
interfaces. Customers should be able to share the permissible data from the reservation
database in a predefined format and mechanism. As this system is meant to be used by a huge
group of audience having different levels of capabilities and exposure to the IT, system must be
easy to use, self explanatory and user friendly. It should guide the user properly both through
the regular process of reservation and any exceptional cases that may come across. Lang,
Wojtkowski and Wojtkowsk (2008), states that a local area network should be incorporated into
the system for communication between the various client systems that are used for flight
12

reservations. Flight reservation system should be able to handle the task to reserve a multi
flight trip for a customer on a particular date and time without any restrictions. Once the
reservation process is complete, system should be able to generate a reference number that
can be communicated to the customer in order for them to cancel or to make any changes to
the trip at a later stage. Some of the vital details available to the customers through the use of
provided reference number are origin, destination, and flight data and time, and passenger
details. The system should allow for modification or cancellation of reservations provided the
action meets the terms and conditions set at the time of reservation. (Lang, Wojtkowski and
Wojtkowsk 2008).
User interface of the flight reservation system should be clear and easy to understand.
User interface comprise of several screens that runs the user through different stages of the
reservation. Initial interface should have information about the airline, any discounts and offers
available at that time along with a section for flight search which allows for the users to select a
variety of options including viewing a flight and booking a ticket (Lang, Wojtkowski and
Wojtkowsk 2008). The other interface for flight reservation system is the window based view
which makes sure that all information concerning the customers choice is opened in a new
window. Multiple windows can be displayed on the screen and clients can switch between
them. System should be able to handle the validation and processing errors and should display
the proper error message to the customer as soon as the error occurs. The system should be
designed in such a way so as to support a variety of input and output devices including
keyboard and printers. System should be able to process, store and manage the information
entered by customer such as personal data and flight details. System response time should be
good enough to find the reliable travel option for the customer in shortest possible time (Milde
2008).
13

System should be able to present the flight and scheduling information to the user in a
friendly and easy to understand manner. It should be easy enough to be used by a layman to
for finding the different flight options available and then choosing one of them to reserve a
seat. The aspect that system should display all flights available along with their respective
destinations and cost, makes it easy for customers to book a ticket (Vidgen, Avison, and Wood
2002).
Reservation system deals with sensitive information and key processes of an airline.
Therefore security and stability are considered the most crucial aspects of any reservation
system and these should be designed to suit the modern nature of airline industry. It should
allow simultaneous access to the key functionalities for different users across various
geographical locations. The system, according to Lang, Wojtkowski and Wojtkowski (2008),
should have the ability to keep track of account and passenger bookings in a real time
environment, and provide instant updates of all transactions. An efficient airline reservation
system should offer modern and flexible experience to the end customers along with providing
useful input data to the other systems and sources used by an airline such as inventory, travel
agencies, call centre, interlining booking and many others. Interlining interface makes it easy
for airlines to receive bookings from, as well as make bookings on, other airlines through other
reservation systems (Vidgen, Avison, and Wood 2002).
It would be beneficial for the reservation system to offer other related additional
services such as hotel room booking, pick and drop service and car rental. System should also
be able to provide customization of the user trip by offering different services such as e-tickets,
provision for special meal requests, holiday tour plans booking and frequent flyer programs
(Jones 2004). It would be important that the system be able to calculate the rewards and points
for certain schemes offered by airline such as frequent flyer program. Thus a flight reservation
14

system would not only perform the primary task of reservation but also provide the airline
management a way to increase the efficiency of several other operations of the airline and
increase profitability. In this way, flight reservation system provides assistance to the airline
management for addressing back office, administrative, financial matters along with providing
solution to several problems typically faced by any airline such as airline load, scheduling,
overbooking, discounted seats and fine tuning the number of special fare seats in accordance
with number of reservations (Milde 2008). Due to the fact that a short interruption in the
system could cost an airline millions, airline reservation system should be designed to meet the
high standards of reliability in order to reduce the failure rate to bare minimum.

2.1 Pricing Factors

The complex mechanism of air fares, flight schedules and availability of seats has moved
directly to the consumers from the hand of trained travel agents over the past few years. A
common man usually makes buying decision using incomplete information because he is
usually armed with little more than a set of internet query forms and a comparison chart for
airfare prices. (Doganis, R, 2006)

On average, a consumer consults with 4 air travel sites for price quotes before making a
purchase. These quote charts enable us to cross compare the airfare but do not tell us if the
price is reasonable based on history and real time pricing factors. Although it is disheartening to
find out that the person sitting next to you on a flight has paid much less than what you have
paid, but it is extremely hard to determine the exact impact of airfare deciding factors.
However in our research earlier, we have tried to make a set of deciding factors that are quite
eminent. We will now discuss them in detail and try to find out how these can attribute
towards the final cost of a trip.
15

During our early research, we have chosen following pricing factors from a list of many complex
inter related direct and indirect attributes that cause the air fare change dramatically.

1. Jet fuel price


2. Season
3. Time of flight
4. Time of purchase
5. Day of flight
6. Route popularity
7. Plane loads
8. Airport Congestion
9. Local events

Although it is too hard to determine how exactly each of these factors may affect the airfare.
We will be discussing these factors with the help of historical and real data publicly available to
us.

1.1.1 Jet Fuel


Jet Fuel is no doubt the major expense of any airline. A plane like B747 does around 10,000
kilos per hour which approximately covers 550 to 650 miles. We can imagine from this that how
much will be overall cost of the fuel for one one-way trip. Jet fuel is the major factor in pricing
of the ticket.

We have seen a sharp price hike as well as other charges imposed by all airlines during the year
2007-2008 when oil prices were at the all time high. Following chart shows the average jet fuel
price from year 2000 to 2008. We can see that oil prices have gone up by 216% on average.

16

Figure: 2.1: (Jet Fuel Price, 2010)


:
This price hike has drastically increased the per gallon cost of the airlines as shown in the below
graph. We can see that despite the minimal change in the domestic and international fuel
consumption, there is huge difference in the cost that ranges from $0.8 to above $4.

Figure2.2:Airline Fuel Cost and Consumption (U.S. Carriers - Scheduled) (Fare Compare, 2010)

17

During the year 2007-2008, there were many measures taken by almost every airline to curb
the high cost of fuel. These measures include rising the airfare and adding different surcharges
to the base fare. Following statistics from year 2007-2008 shows the impact of fuel price in
various parts of the world:

Round-trip domestic fares were increased by $20 by: American Airlines, Continental
Airlines, Northwest Airlines, United Airlines, US Airways, Delta Airlines.

AirTran increased round-trip prices by $10 on last minute tickets (within 7 days of
travel). $20 round-trip fare increases for longer flights.

In India, airlines are reported to have increased airfares by Rs150 per flight
(approximately $3.80 USD) to reflect the higher cost of oil.

In the UK, airlines are looking at increasing airfare costs as well, largely because they
budgeted costs for 2008 based on early 2007 fuel costs, when crude oil was still around
$75 a barrel.

(Fare Compare, 2010)


Following table shows that average domestic airfare for the 4th quarter 2007 had an increase
by 4% over the same quarter in 2006.

Figure2.3:Fourth Quarter Average Domestic Fares from Year-to-Year (Fare Compare, 2010)

18

1.1.2 Session
Season for the flight ticket purchase and flight time also matters. However there is no definite
rule about this for the airlines. Every airline may follow its own timings to reflect the seasonal
change in the airfare and it could be different for different routes as well. In general season
Christmas and Easter is referred by off-season however history data shows that October and
November are also inexpensive. It has also been observed that few airlines do not give any
weigh to the season.

1.1.3 Time of Flight


Day and time of flight can cause a major change in the airfare. On a typical route, a flight over
the weekend may cause up to more than $100 as compared to the similar flight during the
weekdays. According to FareCompare, Saturday, Tuesday and Wednesday, typically early
morning, are the cheapest days and times to fly. Up to a $30 surcharge has been observed on
some of the most popular travel days to fly, including Spring Break, Memorial Day and
Christmas. (Fare Compare, 2010)

1.1.4 Time of Purchase


On a similar pattern, time of purchase also does matters. It is a common rule followed by
travellers all across the globe to purchase the ticket well in advance to get the best deal.
However, according to research, common wisdom of buying tickets farther in advance usually
does not save money. The lowest price tends to hit between eight and two weeks before
departure. (Morrell, P.S., 2007)
I have done extensive research on the time of purchase factor. For this purpose we have
gathered real time price quote from EasyJet website for its flights from London to Amsterdam
and from London to Zurich. Below table shows the price quote for the economy class journey
from London to Amsterdam. I have gathered this data for six months of time period.

19

Date
8-Dec
9-Dec
10-Dec
11-Dec
12-Dec
13-Dec
14-Dec
15-Dec
16-Dec
17-Dec
18-Dec
19-Dec
20-Dec
21-Dec
22-Dec
23-Dec
24-Dec
25-Dec
26-Dec
27-Dec
28-Dec
29-Dec
30-Dec
31-Dec

Day
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri

Reading- Reading1
2
8 Dec
9 Dec
Date
1-Jan
53.99
2-Jan
63.99
78.99
3-Jan
73.99
78.99
4-Jan
83.99
83.99
5-Jan
53.99
63.99
6-Jan
37.99
37.99
7-Jan
37.99
37.99
8-Jan
37.99
37.99
9-Jan
42.99
43.99 10-Jan
57.99
63.99 11-Jan
65.99
65.99 12-Jan
43.99
41.99 13-Jan
4.00
4.00 14-Jan
40.99
38.99 15-Jan
51.99
50.99 16-Jan
63.99
65.99 17-Jan
NFA
NFA
18-Jan
65.99
65.99 19-Jan
55.99
55.99 20-Jan
55.99
55.99 21-Jan
55.99
53.99 22-Jan
63.99
62.99 23-Jan
65.99
65.99 24-Jan
25-Jan

Day
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue

Reading- Reading1
2
8 Dec
9 Dec
40.99
41.99
83.99
87.99
43.99
40.99
28.99
27.99
25.99
26.99
25.99
26.99
28.99
28.99
26.99
26.99
26.99
26.99
26.99
26.99
25.99
25.99
25.99
25.99
26.99
26.99
30.99
31.99
25.99
26.99
26.99
26.99
25.99
25.99
26.99
26.99
25.99
25.99
25.99
25.99
30.99
30.99
25.99
26.99
25.99
25.99
25.99
25.99
25.99
25.99

I have done some statistical analysis of the data to determine the time of purchase factor for
our flight reservation system. These statistical analysis includes the calculation of percentage of
reduction in price of the flight based on how many weeks do we have before the actual flight
departure time and the time of the booking.
Below table shows the analysis data that is based on the actual price quote listed in the above
table spanning across six months time period. Weeks ahead column shows the number of
weeks we have between the time of the booking and the actual flight departure time. Average
price column shows the average price for the specific week based on the value in the weeks
ahead column. This average value is calculated based on the two readings for example 14 price
quotes for a single week. Any day less than a week distance away from the flight departure

20

time is considered in the zero weeks ahead category. Average for this week is considered as the
base price for our analysis.

Weeks Average Base


Ahead Price
Price
0 73.99 73.99
1 49.06 73.99
2 44.91 73.99
3 60.56 73.99
4 29.56 73.99
5 27.28 73.99
6 26.92 73.99
7 26.20 73.99
8 26.42 73.99
9 26.35 73.99
10 26.70 73.99
11 27.06 73.99
12 26.13 73.99
13 26.28 73.99
14 26.56 73.99
15 27.20 73.99
16 26.42 73.99
17 26.42 73.99
18 27.13 73.99
19 26.28 73.99
20 29.28 73.99
21 27.42 73.99
22 26.28 73.99
23 26.99 73.99
24 31.70 73.99
25 26.99 73.99
26 25.99 73.99

Difference
with
Previous
Reduction Week
0.00%
33.69%
33.69%
39.31%
5.61%
18.15%
-21.16%
60.05%
41.90%
63.14%
3.09%
63.62%
0.48%
64.58%
0.96%
64.29%
-0.29%
64.39%
0.10%
63.91%
-0.48%
63.43%
-0.48%
64.68%
1.25%
64.49%
-0.19%
64.10%
-0.39%
63.23%
-0.87%
64.29%
1.06%
64.29%
0.00%
63.33%
-0.97%
64.49%
1.16%
60.43%
-4.05%
62.94%
2.51%
64.49%
1.54%
63.52%
-0.97%
57.15%
-6.37%
63.52%
6.37%
64.87%
1.35%

Reduction column shows weekly reduction in price in percentage. Last column of the table
above shows the percentage difference of current week as compared to the previous week.
With this analysis table we have drawn a graph like below.

21

Figure 2.4: Flight prices for 26 week ahead


With the help of above graph, we can see that price of a flight is high if the time of the booking
is near to the flight departure time. There is typically a sharp decline in flight price for the first
few weeks and then flight price converges to a linear line. This linear trend however shows a
slight fluctuation sometimes due to some other parameter such as a public holiday or a local
event.
Let us have a look at another graph below. This graph shows the price reduction in percentage
with reference to the base price of the flight.

22

Figure 2.5: Price reduction for the first 26 week ahead


We can easily identify three trends across the graph line. These sections have been marked
with label A, B and C. Section labelled A shows the high reduction rate of 30%-60% for the first
four weeks for a particular flight. Section B shows that the price of the flight converges to
approx 40% of base price, when the flight booking time is more than four weeks ahead of flight
departure time. Similarly section C shows that the linear trend of the flight price from fourth
week onward may have a slight fluctuation of up to 5% due to some other factors.
From this analysis, keeping the data error in mind, I have determined the following table to
reflect the flight prices with respect to the Date factor for example the no. of weeks ahead
before the actual flight time calculated at the time of booking.

weeks
ahead

Discount on base
price

0-Jan
1-Jan
2-Jan
3-Jan
4-Jan
5 or more

0
30%
35%
40%
50%
60%
23

1.1.5 Day of Flight


Following tables shows air fare difference for a flight from London, Heathrow to New York, JFK
from July 2010 to September 2010.

Figure2.6: (Flight Schedules, 2010)


We can see that typically low price have been reported during the week days. Also note that
the average airfare for the flight whose departure time is far away from now is cheap. Similarly
a flight during the late night hours can be little cheaper than the same flight during the day
time.
Following table shows the average price for the flight from London to Amsterdam for working
days (Monday to Friday) and weekend (Saturday and Sunday). First column represents the
number of weeks we have before the actual flight departure time.
Weeks
Ahead
0
1
2
3
4
5
6
7
8
9
10

Avg Price Working


Avg Price
Day
Weekend
42.19
40.99
59.59
30.79
27.39
27.19
27.99
26.39
26.39
26.39
27.19
24

61.99
65.99
62.49
26.99
26.49
25.99
27.99
25.99
25.99
27.49
25.99

Difference Avg of
%
Avgs
46.93%
60.98%
4.87%
-12.34%
25.11%
-3.29%
-4.41%
0.00%
-1.52%
-1.52%
4.17%
-4.41%

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

25.99
26.39
26.39
26.79
25.99
25.99
25.99
25.99
29.39
26.99
26.39
26.99
27.99
25.99
25.99

25.99
25.99
26.99
28.49
27.49
27.49
29.99
26.99
29.49
28.49
25.99
26.99
40.99
29.49
25.99
Net Avg

0.00%
-1.52%
2.27%
6.35%
5.77%
5.77%
15.39%
3.85%
0.34%
5.56%
-1.52%
0.00%
46.45%
13.47%
0.00%
7.37%

4.15%

Column labelled Avg Price Working day represents the average price for the current week for
working days only. Next column shows the price quote for the weekend for the current week.
Difference column shows the percentage of the difference between the average price of
weekdays and weekend flight for the same origin and destination. We can see that the price
over the weekend is generally higher than what we get during the working days. However there
are few exceptions like in week 3, where we can see a decline of 12% over the weekend flight
price. For our analysis in this project, we will take this as the exceptional case that might have
occurred due to some other factor involved.
For our project, we will take the average of averages method to determine the feasible value
for the day factor that we implement in the code. We will discuss it later after we have a look at
few related graphs. Let us have a look at the weekend vs. weekday price graph below. We can
see that weekday and weekend price vary by a narrow margin except in the start of the graph
where we have less time left before the actual flight time. After the 3 rd week ahead, we can see
a minimal difference between the flight price on different days. If we draw the trend line of the
weekdays price (black dotted line in the below graph), we can see that price tends to be higher
for first six weeks at any time and then price converges to a narrow fluctuation state. Similarly if
we draw a trend line for the weekend flight price(solid yellow line in the below chart), we can
see that the pattern of the trend is almost same as of the trend of the weekday flight price.
However the difference between the two is high for initial five weeks and then the line moves
on the curve close to the other trend line.
25

Figure 2.7: Weekends and weekdays prices and trends(London-Amsterdam)


The same trend of prices can be seen in the price comparison graph for flight from London to
Zurich. In the below graph, we can notice that the difference between the two lines is higher
than the previous graph.

26

Figure 2.8: Weekends and weekdays prices and trends(London-Zurich)


This is because we have measured this on single reading values for this particular origin and
destination. We can also notice that the difference is very huge for the 9 th week entry. This is
probably due to some other factor involved and will not be part of our research.
To determine the value of the factor that we will implement in our project, let us have a look at
another graph below showing price difference averages.

Figure 2.9: Weekends and weekdays prices percentage average prices


27

We can see that difference is very high for the first two weeks. Then it comes out to be negative
for a while before it starts moving in a narrow band above and below the reference line. If we
calculate the average of averages, we can see from the table at the start of this section that
average of the average prices for first four weeks comes out to be as high as 25% of the
weekday price. Similarly average for the remaining weeks of our six month time span, the
difference comes out to be just 4.15% of the weekday price quote. Therefore I will use the day
factor as per the below table in the implementation of the project.
Weeks
Ahead
0-4
4 or more

Difference
25%
4%

1.1.6 Route popularity


Popularity of the route of the flight plays an important role in determining the flight fare. It has
been observed that on a popular route, fares do not fluctuate as much as on any other
destination. This is because of the fact that on these routes, flights are already running at the
lowest levels due to heavy competition. Even huge fuel price hike has impacted such flights to a
minimal level and airlines try to save on the costs by adopting other methods such as lowering
the baggage allowance. (Morrell, P.S., 2007)

1.1.7 Plane loads


Plane loads is a measure to determine the occupancy rate of the seats on flights. Flights with
high plane load enable the airlines to offer low fare. Generally speaking overall cost is divided
among more passengers than fewer.

1.1.8 Airport Congestion


Airport congestion also play vital role. A flight from one origin to a specific destination can be
cheaper if it lands on the airport with less flights load as compared to the same flight to the
28

different airport on the same city (Morrell, P.S., 2007). Many major cities of the world have
more than one airport to cope with the high volume of travellers. The main airport of the city
usually charges congestion surcharges thus adding additional cost to the basic fare.

1.1.9 Local events


Many events that attract more traffic to a particular location may also impact the fares of the
flights destined to the same location if the event is occurring near the flight time. For example
many travellers were trying to reach South Africa to watch football world cup early this month.
Usually price for such destinations goes up as the demand is too high.
1.1.10 Pricing Manager Class
This class is responsible for implementing the pricing factors for our system. Few parameters
are set across the data layer and then price is adjusted according to the factors we have
researched out such as date factor and the day of the week factor. Below is the code snippet
for the class code.
namespace FRS.BusinessLayer
{
public class PricingManager
{
/*This class will be used to implement the pricing factors
that are further to what we already have in database.
For instance if company policy is to give 10% disc if the ticket it
being purchased
more than one month earlier than the flight time.*/
public double getFlightPrice(List<FlightPricesData> pricesList,
string flightID, DateTime flightDate, string origin, string dest)
{
double priceQuote = 0.0;
foreach (FlightPricesData fpd in pricesList)
{
if (fpd.flight_id == flightID
&& flightDate >= fpd.effective_from
&& flightDate <= fpd.effective_to
)
{
/*This is the flight that is applicable out of the
list.*/
//get the fixed price first
priceQuote = fpd.FixedPrice;
/*Add the discount according to our findings through
analysis

29

Chart constructed in terms of weeks ahead (No of weeks


left in the flight date at the
* time of booking with a discount % on the base price
*Weeks ahead
Discount
*0
0%
*1
30%
*2
35%
*3
40%
*4
50%
*5 or more
60%
* */
TimeSpan ts = flightDate - DateTime.Now;
/*We will also do the day of the flight factor here*/
if (isWeekEnd(flightDate))
//flight on a weekend
{
if (ts.Days < 4 * 7 )
//less than 4 weeks or more
priceQuote *= 1.25;
//25% increase
else if (ts.Days >= 4 * 7) //4 weeks or more
priceQuote *= 1.04;
//4% increase
}
if (ts.Days > 5* 7 )
//5 weeks or more
priceQuote *= 0.40;
else if (ts.Days > 4 * 7) //4 weeks or more
priceQuote *= 0.50;
else if (ts.Days > 3 * 7) //3 weeks or more
priceQuote *= 0.60;
else if (ts.Days > 2 * 7) //2 weeks or more
priceQuote *= 0.65;
else if (ts.Days > 1 * 7) //1 weeks or more
priceQuote *= 0.70;
//origin and dest specific discount if any
if (origin == "9" && dest == "11")
priceQuote -= 10.00; //further 10 discount for flight
from 9 to 11
if (flightClass == "Business")
priceQuote *= 1.5;
else if (flightClass == "First")
priceQuote *= 2;
break;
}
}
return priceQuote;
}
}
}

30

Chapter 3: Requirements
First of all, we would review the merits and demerits of each of the common research
techniques used and adopt the best one for going about this project. Project members need
requirement gathering techniques that they would apply on the stakeholders - the customers
who would be using this system in order to gather the required information. Several
information gathering techniques are commonly used for research purpose, such as interviews,
surveys, questionnaires, experiments, observation.

3.1 Interview Technique


An interview is a real-time dialogue between two or more people. It is usually face to face or
telephonic. The interviewer asks the interviewee questions whose answers can draw out the
required information. The interviewer can further discuss a critical topic that would ultimately
unfold crucial points related to the project. A list of pre-prepared questions can be made to
cover all areas of significance. If the interviewer feels that a certain topic needs more
discussion, it can be done on the spot.

3.2 Survey
It is also known as the pencil and paper technique. It is the method of gathering information in
which written communication is used. Questions are written on a paper or an email and sent to
potential respondents. It can be open-ended, in which respondents can express their opinions
in their own words, or close-ended, in answer choices are already given and the respondent
needs to tick the best option. The survey method comprises of a questionnaire as the
instrument.

3.3 User Questionnaire


A questionnaire can be defined as a number of questions that can be handed out by a
researcher to a number of people in order to gather information from respondents. I have
designed a questionnaire that can be use in future, see appendix 3.
31

I have divided system requirements into two major stages, functional requirements and nonfunctional requirements.
3.4 Functional Requirements:

Supports searching for flights throw the system.

Customers can use the search engine in the system in order to find suitable flight for them.
They interact with the system by filling the search form in the main page. After Clicking search
flight button, the system will redirect the customer to the result page.

Customers can choose any ticket from flight calendar.

In the flight calendar, customers can view all available flights. They can select a flight by
checking the radio buttons in the flight calendar.

Both customers and admin can insert their personal details in the system.

In order to interact with the system, customers can add their information in the system.

The system supports purchasing process.

Customers can make payment in order to book a flight. They can insert their card details and
confirm the payment. Also they receive the booking reference code after they make the payment
successfully.

Customers can print E-ticket.

When customers finish the booking process, they receive their ticket directly. Also they can
print the ticket.

32

3.5 None Functional requirements:

Usability

The flight reservation system is used by wide range of people. The usability features
must be implemented in the system. To achieve the system goals and target, it
should be simple and usable by users. It should not contain any complexity.
The system will be developed in certain way that supports learnability and will be
easy to use and easy to navigate. Also the system will provide help and guide to
users.

Reliability

The system should be reliable this is essential as flight reservation system can be
accessed by thousands of people who search for a flight regularly. This is one of the
most important features of any system. The system should perform in stable level at
any time users interact with the system.

Performance

The system should perform in accurate and satisfied way. Also this type of system
should response quickly because it deals with huge process in short time.

Accessibility

Applying accessibility features will make the system available to wide range of
customers. Sometimes they access to the system using their mobile phones or
screen readers.
The flight reservation system should be designed in a simpler way. All system tools,
menus and navigation buttons should not be complex.

33

Chapter 4: Methodology
Methodology can be defined as a combination of process model and the technique that used.
To effectively develop and manage of a project we must have to adopt some kind of software
engineering methodology. For this project I have used prototype as a technique and RUP
(Rational Unified Process) as a model. I have chosen prototype as a development technique
because I want to see the output of the application while I progress in the implementing the
requirements. The application I have developed is the combination of different modules, some
of them are depended on each other and some of them are not. In this scenario prototype
technique is the most appropriate option left for me.
Rational Unified Process (RUP) is the model which perfectly matches with the design of my
project and it covers best practices of the modern software development. In RUP, responsibility
of each development area is clearly defined and well structured (Bergstrom, S. & Raberg, L.,
2004). This model covers almost all the attributes which I desired to accomplish before and
during the application development, which are

Identification of risk factors in the start and continuously.

Ensures that we map the exact customer requirements.

Always focus on exact progress which is the executable software.

Most of changes are identified and accommodated in the development phase.

Architectural changes are also identified in early stage.

Force to build system with components.

Figure 4.1: Process Structure of RUP (Kruchten, P., 2000)

34

Chapter 5: Analysis
5.1 Domain Analysis
To learn project background information; domain analysis is the process which software
engineers apply (Lethbridge, T.C. and Laganiere, R., 2001).

Domain analysis gives developer an understanding about the problem domain and the actual
functionality which client requires. At this point developer also gets an understanding for whom
this system is developed and why this system is required. Following are the functionalities I
gathered after the domain analysis

Customer can search flights.

Customer can select flight out the search performed.

After fight selection, customer put required passenger information.

When all the process is done then customer will be routed to the payment page
and he or she will perform payment of the fare calculated through the price
algorithm implemented in the system.

Once payment is done, system will mark the flight seats and show booking
confirmation.

System will also allow printing of e-tickets.

Separate GUI will be provided to administrator to manage locations and flight


pricing.

5.2 Use Cases


Use case can describe how the system behaves. The person role that interacts with the system
called an actor. Here I have designed two use cases diagrams.

35

For Admin:

Figure 5.1: Admin use case


As can be seen from the diagram, the admin can play two significant roles. He can manage
flights location by adding airline route. Also the system admin can manage flights prices.
For Customer:

Figure 5.2: Customer use case


Customers can do:
-

Search for flight


Choose particular flight
Insert passenger details
Make payment
Make booking
Print E- ticket

36

Chapter 6: Design
In the previous chapter I have done domain analysis to get complete idea about the problem to
be solved. For the design phase, I will use object oriented designing and UML modelling
technique. Below I have mentioned the approach I followed.

6.1 Prototype Modelling


Following are benefits which I gained from modelling the design of the application

Graphical representation is always user friendly and easy to understand as


compared to text. This helps developer to easily grab the requirement and
transform it to the actual code.

Visual model gives client a better understating of system information.

Helps in managing large system

It is easy to locate any type functionality, feature or anything within large system
which makes it highly maintainable.

Before I start designing the prototype model I have done a research on many similar systems
such as Fly BMI system and Easy Jet system.

37

Figure 6.1: Fly BMI System

Figure 6.2: Easy Jet System

I have found the following design features:

Most of flight reservation systems have advanced search facilities which help
customers to search on a specific flight. The search engine is located on the main
page of the system which makes the site easy to use by customers.

Search results appear as a calendar that contains all available flight. This helps
customer to find their flights by days and times.
38

Registration is not required. Customers can view, search and book a flight
without need to be registered users.

Systems are designed in simple layout which makes the system usable by wide
range of people. This supports the usability and accessibility of the system.

As a result of this research I have implemented all the characteristics and the findings above in
the prototype model of the system.

6.1.1 Main Page Layout

Header

From:

Admin login

To:

Name:

Depart

One way only

Return

My dates are fixed

Password:
login

Flight class
Adult
Children
Infant
Get flight

Figure 6.3: Main page layout


The main page contains the flight search engine which includes drop down lists, textboxes,
checkboxes and buttons to help customers to search for flights in system database. Also it
contains the main header of the system. In addition, the main page includes admin login tool
which enables the system administrator to login to the system.

39

6.1.2 Select Flight Page

Header
Select flight

Outbound flight
calendar

Inbound flight
calendar
Serch again

Next

Figure 6.4: Select Flight page


Select flight page shows results of the search that has been done by a customer. This page
displays all the available flights as a calendar. Customers must choose outbound flight and
inbound flight before they can book a flight.

6.2 Object Modelling


For the object modelling I have created class diagram which represents how the objects are
group together and associated with each other. Diagram also includes attributes and operations
for each class. Below I have mentioned the class diagram for the prototype developed. All the
diagrams are generated through visual studio after the complete development.

40

Presentation Layer
Presentation layer of the prototype contains all the code related to its user interface.
AdminMaster is the master page which has content place holder which will act as a work area
for the application. All the other pages like Flights, Passengers, Payment etc. will be show
in the work area. Below I have mentioned class diagram for the presentation layer.

Figure 6.5: Presentation Layer


41

Data Layer
All the classes which will interact with the airline reservation database are included in this layer.
SQLHelper is the class which is responsible of establishing connection with the database and
executing queries after that. All the other classes will use SQLHelper class to perform their
CRUD procedures.

Figure 6.6: Data Layer

42

Business Layer
Business Layer of the application includes classes which connects presentation layer with the
data layer. Let me mention FlightManager class and all the other classes perform similar kind
of operations but with different responsibility. FlightManager class connects Flights page in
the presentation layer with the FlightBooking class in the data layer. All the database
operations are routed through FlightManager class and it also performs any type of business
rule validation and conversion required.

Figure 6.7: Business Layer


43

6.3 Modelling behaviour of the prototype


Applications always build up for some purpose: to provide behaviour, or functionality, which
satisfies the requirement and needs of the customer or users (Britton, C. and Doake, J., 2000).
Below I have modelled the behaviour of the main scenario of application which is about making
flight reservation.
Below is the behaviour diagram which covers following scenarios

Search for a flight.

Select fight from the search result.

Enter passenger information for ticket booking.

Make payment for the tickets.

Print e-ticket.

Figure 6.8: Customer modelling behaviour

44

6.4 ER Modelling
An entity-relationship model (ERM) is an abstract and conceptual representation of data. This
modelling technique is used to generate conceptual schema of the database. There are many
ERM tools that help generate the schema definition of several relational databases. This
modelling helps us during the requirements analysis phase to overview the information needed
by the system and type of information that needs to be stored in database.
ER diagrams consist of entities, relationships and associated attributes. An entity may be
defined as a thing which is recognized as being capable of an independent existence and which
can be uniquely identified. These entities are extracted from the domain of the project. An
entity may be a physical object, an event or even a concept that will turn into reality during
later stages of the project development. Entities are typically drawn as rectangles. An entity
may have several associated attributes that are drawn as oval and are connected by a line such
as in image below.

A relationship is drawn as a diamond with attributes drawn as oval connected by a line such as
in image below.

ER diagrams are made in three steps. First step to think is that what are the entities do we have
in the business domain and what are the relationships that exist between them. Second step is
to consider the attributes of the entities that we need to store in the database for the
operations of the application. Next step is to consider the integrity constraints or business rules
that hold true for the application. Relational constraint between different entities could be 1to-1, 1-to-many, Many-to-1 and Many-to-Many as shown below in the diagram.

45

Last step is to map the ER diagram into a relational schema. In the next section, we will present
the database diagram that has been generated as a result of the ER mapping to the relational
schema.

6.5 Normalization:
Organizing the data in database in an efficient manner is called normalization. Normalization
process ensures that we eliminate the redundant data (same data stored in more than one
table) and that only the related data is stored in a table. This way database consumes less
amount of space and its performance is improved.
Normal Forms

Normalization process is to follow the guidelines of making database design efficient at


different levels. These levels are numbered from one thorough five. The lowest form of
normalization is called first normal form or 1NF and similarly the highest is called the fifth
normal form or 5NF. However one key rule to the normalization is that the normalization
guidelines are merely guidelines only. Sometimes, it might be necessary to keep a relation in
de-normalized form to better meet the business scenario.

First Normal form or 1NF ensures that there are no duplicative columns in any table and the key
attributes are defined. That means all attributes in a table are dependent on the primary key of
the table.

Second Normal form or 2NF ensures that we meet the requirements for 1NF and there is not
any partial dependency in a table. This means there should not be any attribute in a table which
is dependent only on a part of primary key instead of the whole primary key.

To meet the Third Normal form or 3NF level, database must be in 2NF and it should contain no
transitive dependencies. There should not be any non-key attribute that is dependent on
another non-key attribute of the same table.

46

Here in our Flight database, we know that we need to apply normalization to well-structure our
relations and tables. Here we will try to normalize our database up to 3NF if required. After
doing some analysis on our database, we realize that there are two relations that need to be
normalized because they contain more than one real world concepts. These two tables are
flight_location and payment. Let us normalize them one by one.

In case of flight_location, we know that this relation have information about the flight city and
airport from which the flight will go. We also know that city and airport are two different real
world entities and they should be recorded separately. So for this reason, we make two new
tables City and Airport and we add relevant attributes to each of them from the flight_location
table. Now we just simply add the primary keys of both of these new tables to the
flight_location table as foreign keys. Now we have successfully separated both real world
concepts and our logical design is same.

Figure 6.9 :Flight location new tables

In case of payment, we know that this relation have information about the payments. It will
record billing and card information also. We also know that bill and card are two different real
world entities and they should be recorded separately. So for this reason, we make two new

47

tables Bill and Card and we add relevant attributes to each of them from the payment table.
Now we just simply add the primary keys of both of these new tables to the payment table as
foreign keys. Now we have successfully separated both real world concepts and our logical
design is same.

Figure 6.10 :Payment new tables

48

Database (ER Diagram) before normalization:

Figure 6.11: Database diagram before normalization

49

Database (ER Diagram) after normalization:

Figure 6.12: Database diagram after normalization

50

Chapter 7: Implementation
For the implementation I have adopt 3-tier architecture which is widely used by software
industry for the development of web applications. I have divided the code into three layers i.e.
data, business and presentation. When we talk about the layer then it is not more than a
module which includes the code which will be reused on multiple locations. In .Net terms each
layer is a separate project that represents specific functionality to achieve some goals.
7.1 Data Layer
Data is always the key part of any application and the responsibility of this layer is to get or set
any database field. My code will never bypass this layer while interacting with the database.
Any correspondence with the database would be done using this layer code. Let me discuss one
of the classes I have implemented in this layer. Rest of the classes follows the same type of
structure but with different responsibility.

Class Name: FlightDL.cs

Method: getFlights(string origin, string dest)

This method will access the database and get flight information

Query :
select

a.flight_id , a.flightCode , b.weekday, b.effective_from ,isnull("

(select max(effective_from) from flight_schedule


where flight_id = b.flight_id and effective_from> b.effective_from)
, dateadd(month,12,b.effective_from) ) as effective_to from flight a
join flight_schedule b on a.flight_id=b.flight_id where a.flight_origin= " + origin

51

+ " and a.flight_destination=" + dest;

Method: getFlightPrices(string origin, string dest)

This method will access the database and get flight price information

Query :
select

a.flight_id , a.effective_from ,isnull(

(select max(effective_from) from flight_price


where flight_id = a.flight_id and effective_from> a.effective_from )
dateadd(month,12,a.effective_from) ) as effective_to ,baseprice
+ "+fuel" + "+localEvent" + "+competitorAdjustment" + "+loadAdjustment" + "+misc as FixedPrice"
+ " from flight_price a"
+ " where a.flight_id in ("select flight_id from flight"
+ " where " + "(flight_origin="+origin + " and flight_destination="+dest + ")" + " or"
+ "(" + " flight_origin="+dest + " and flight_destination="+origin + ")" + ")";

7.2 Presentation Layer


All the UI related forms and classes will be placed in this layer. This layer is important because it
interacts with the users. It contains all the interfaces, client side functionalities and validations.
This layer is also very important for the project because most of the times users dont like
airlines websites because those are not much user friendly. This layer will request business
layer for any type of operation on the system data and will not call data layer directly.

Class Name: Flights.aspx

Method: Page_Load(object sender, EventArgs e)

In the below mentioned code I have accessed the business object and fetched the data which I
need to show on the page

if (Session["SearchData"] != null)
{
srchData = (SearchData)Session["SearchData"];

52

Calendar2.VisibleDate = srchData.Depart;
if (!srchData.IsOneWayOnly)
{
InboundPanel.Visible = true;
inboundCalendar.VisibleDate = srchData.Return;
}
}

if (!IsPostBack)
{
FlightsBL FlghtBL = new FlightsBL();
outBoundFlightsList = FlghtBL.getFlights(srchData.From, srchData.To);
ViewState["outBoundFlightsList"] = outBoundFlightsList;

if (InboundPanel.Visible && srchData!=null)


{
inBoundFlightsList = FlghtBL.getFlights(srchData.To, srchData.From);
ViewState["inBoundFlightsList"] = inBoundFlightsList;
}
flightPricesList = FlghtBL.getFlightPrices(srchData.From, srchData.To);
ViewState["flightPricesList"] = flightPricesList;
}
else
{
outBoundFlightsList = (List<FlightsData>) ViewState["outBoundFlightsList"];
if (InboundPanel.Visible)
inBoundFlightsList = (List<FlightsData>) ViewState["inBoundFlightsList"];
flightPricesList = (List<FlightPricesData>)ViewState["flightPricesList"];
}

53

7.3 Business Layer


This is the layer which sits between the presentation and data layer. You cannot allow
presentation layer to talk directly to the data layer. The presentation layer will request business
layer for the data and business layer will perform all the business operation such as calculation
or any kind of business rules validations on that. Once all the business operations are
performed, it will fetch the required data using the data layer objects. After getting the data
from data layer it will again apply any kind of business logic if required and pass it to the
presentation layer.

Class Name: FlightBL.cs

Method: List<FlightsData> getFlights(string origin, string destination)

In the below mentioned code I have accessed the data layer object and fetched the data which
presentation layer requires.
Code:

FlightsDL flghtDL = new FlightsDL();


DataTable flightsDT = flghtDL.getFlights(origin, destination);
if (flightsDT.Rows.Count > 0)
{
List<FlightsData> flightsLst = new List<FlightsData>();

for (int i = 0; i < flightsDT.Rows.Count; i++)


{

54

FlightsData flightDataRecord = new FlightsData();

//initialize the obbject before we insert into list


flightDataRecord.flightID = flightsDT.Rows[i]["flight_id"].ToString();
flightDataRecord.flightCode = flightsDT.Rows[i]["flightCode"].ToString();
flightDataRecord.weekday = flightsDT.Rows[i]["weekday"].ToString();
flightDataRecord.effectiveFrom = DateTime.Parse(flightsDT.Rows[i]["effective_from"].ToString());
flightDataRecord.effectiveTo = DateTime.Parse(flightsDT.Rows[i]["effective_to"].ToString());
flightsLst.Add(flightDataRecord);
}
return flightsLst;
}

55

Chapter 8: Testing
Testing is defined as being narrowly confined to testing the program code which is a process of
locating and fixing errors. This is the procedure which we perform once the application or any
module of application is developed. It totally depends on the project manager when he wants
to trigger this process. The current software development methodologies suggest that this
process should be attached with all of the development phases to catch errors in the early
stage of project.

Lethbridge, T.C. et al (2001) quoted two important points in his book for doing testing
effectively and efficiently.
To test effectively, you must use a strategy that uncovers as many defects as possible and to
test efficiently, you must find the largest number of possible defects using the fewest number
of tests (Lethbridge, T.C. et al, 2001)

I have done unit and system testing of the prototype I developed.


8.1 Unit Testing
Unit testing focuses on the building blocks of the software system that is objects and
subsystems (Pressman, R.S., 2001). To unit test a program I have followed following steps

Check the module code for any kind of data, syntax and algorithm errors.

Check that code and confirm that it fulfils all the requirements determined in the
start.

Remove any kind of remaining syntax errors after compilation of code.

At the end create a test case and check that it is getting the required input and
producing the desired output.

56

8.2 System Testing


System testing ensures that the complete system compiles with the functional and nonfunctional requirements. In the system testing I have designed the test cases first and then
executed it to check that it is giving the desire output. System testing has different types such
as performance testing, installation testing, functional testing and many other. Along with the
unit testing I have also done installation and functional testing. In the functional testing I have
made sure that the requirements which I identified in analysis stage are totally mapped.

57

Chapter 9: Critical Appraisal

The importance of web technologies is well known in various engineering fields. With the
growth in the requirement of web applications, advancement in these technologies was also
seen. People started demanding stable and advance functionalities for the web environment.
At this point software industry a lot of stable, mature and advice web development
technologies using which we can create a good quality web application. In the research phase I
have studied two of the most popular web development technologies and explored the way I
can use their facilities for the development of my project. ASP.NET and JSF are the two
technologies which offer same as well as some different set of features. Out of these two I have
selected ASP.NET because when it comes to the development of the small scale projects then
ASP.NET is easily maintainable, provide rich set of controls and libraries to allow rapid
application development. For the prototype development I have used many of the basic and
advance features of ASP.NET.

9.1 Evaluate Project against system Objectives:


In the start of the project I have set some basic and advanced objectives which represent what I
want to achieve from this project. In order to achieve project objectives, first I must complete
all project tasks successfully. Below I have mentioned how I have accomplished my tasks.

Task 1: Investigate the pricing factors in airlines industry.

In order to achieve this task I have researched all the pricing factors that could affect flight
prices.

Task 2: Identify all the user, software and system requirements for the Airline
Reservation System.

My first task was to identify all the requirements of the prototype which I have to develop. To
achieve this task I have researched on different technologies which I could used for the
development, studied existing systems and explored the problems which customers face while
booking their tickets.
58

Task 3: To Use current software development process and model for the development
of the system

After I have analyzed the requirements and I have chosen Rational Unified Process (RUP) as a
process model and prototyping as a development technique. I have mentioned many reasons in
chapter three that why I have selected these methodologies for the development. This process
and model helped me a lot to control the project development and to avoid different obstacles
which I might face.

Task 4: Design and implement a website which will cover initial requirements of the
system.

I have mentioned all the design techniques and the approach I have followed for the prototype
development in chapter seven. I have also included the UML diagrams I made to model the
design of the prototype. I have tried my level best to follow the current software industry
standards with the timeframe of this project and I believe that I have achieved this objective up
to some extent.

Tasks 5 and 6: To effectively plan, control and achieve project objectives.

By completing all project tasks I was able to achieve project objectives.

59

9.2 Heuristic Evaluation


In this section I am going to evaluate the system on the basis of Jacob Nielsons Heuristic
Evaluation.

Visibility of system status:

The system has been designed in certain way that makes it visible by its
customers. All customers can interact with the system easily and they can
understand all its features. It shows feedback and informs customers
whenever they do something right or wrong. For example, if there is no
available flight the system shows message indicates that the search has not
found any result.

Match between system and the real world:

All commands, text and labels that are used in the system are commonly
used in the real world. Customers will easily understand how the system
works.

User control and freedom:

In many airlines reservation systems there are restrictions on user control


and freedom. They cannot move to a particular page before they confirm the
pervious page. For example customers only can access payment page if they
book a flight. My system also does the same process.

Error prevention:

The system was developed in simple way that prevents customers from
causing errors. For example if a customer has entered invalid date format, an
error massage appears to show the correct format.

60

Recognition rather than recall

This system is not complicated system. Customers do not need to memorize


how they use the system. They can navigate through the system easily.

Flexibility and efficiency of use

The system is straightforward to operate. However, it could be better if the


system can be more flexible. For example, implementing keyboard shortcuts
might support the use of the system. Regular and advanced customers can
easily navigate throw system pages using their keyboard.

Aesthetic and minimalist design:

The system has simple design and layout. All tools and buttons are necessary
for customers. The system does not contain unrequited information or
dialogs.

Help and documentation:

Help section was not implemented in the system. Creating this section might
help customers who need help and guide such as inexperienced users.

61

Chapter 10: Conclusion

.NET is one of the proven software development technologies which now play a major role
when it comes to rapid application development. I have studied and used many .NET facilities in
my project. With comparison to java I think .NET provides more stable tools and facilities using
which you can develop a reliable web application quickly without hassle. After doing research
on the pricing systems and the factors which affects the flight pricing I found that there are
some problems which airlines could fix but some of the problems did not lie on their end. The
major problem which most of the customers might face is high fluctuation in the ticket pricing
and after study I found that airlines pricing systems are developed in such a way that it includes
many external factor while fare calculation. The factors which these systems consider are also
variable and fluctuates too much because of which we also see fluctuation in the airline pricing.
I have mentioned these factors in my literature review.

Achievements

By the end of this project I have achieved the entire core and advanced objectives of the
project. I have learnt basic and advanced skills of research, analysis and fundamentals of project
management.

Skills to write thesis effectively as previously it was unclear.

Overall learned skills to become a professional software engineer.

Future Work
After successfully completion of dissertation I reached to the conclusion the following studies
and development required in this area.

I have not studied the .NET framework 4.0 facilities and how it can help me to improve
the system I have developed.
62

There are a lot of others complex variable pricing systems which currently airlines are
using. Due to limited timeframe I have not studied them but in future I will go through
those and improve pricing system of my application.

The functionalities which I have planned for the future are allowing user to:

Check-in online

Confirmation E-mail and SMS reminder.

Linking between Google calendar and customers reservations.

Request for any type of transportation, hotel booking and price comparison with other
airlines.

63

Bibliography and References

Hexaware Technologies, n.d, Airlines and airports, viewed on September 4, 2010 from
http://www.hexaware.com/passenger.htm

Jones, P 2004, Flight catering, 2nd edn, ISBN 0750662166: Butterworth-Heinemann,

Lang, M Wojtkowski, G and Wojtkowski, W 2008, Information Systems Development:


Challenges in Practice, Theory and Education, ISBN 0387304037

Milde, M 2008, International Air Law and ICAO, ISBN 9077596542: Eleven International
Publishing

Vidgen, R Avison, D and Wood, B 2002, Developing Web information systems: from strategy to
implementation, ISBN 0750657634: Butterworth-Heinemann

Doganis, R. (2001). The airline business in the twenty-first century. NY: Routledge.

Morrison, S.A. & Winston, C. (1995). The Evolution of the Airline Industry. Washington: The
Brookings Institution.

Lethbridge, T.C. and Laganiere, R. (2001). Object-Oriented Software Engineering. Glasgow:


McGraw-Hill.

Doganis, R. (2006). The airline business. NY: Routledge.

Connor, W.E. (2001). An Introduction to Airline Economics, Sixth Edition. CT: Greenwood
Publishing.

Britton, C. and Doake, J. (2000). Object-Oriented Systems Development: A Gentle Introduction.


Cambridge: McGraw-Hill.

Morrell, P.S. (2007). Airline Finance. Hampshire: Ashgate Publishing Limited.

Jet Fuel Price.[Online] Available at: <www.aviationfuelprices.net> [Accessed 10 August 2010]

Fare Compare.[Online] Available at: < www.farecompare.com > [Accessed 10 August 2010]

Centro, A. (2009). The Airline Industry: Challenges in the 21st Century. Frankfurt: Springer Ltd.

Rosenblatt, H.J. et al. (2007). System analysis and design. NY: Cengage Learning.

Lam, H.Q. & Thai, T.L. (2003). .NET framework essentials. USA: O'Reilly Media, Inc.

Ernst, C.G. (2004). Next Generation Airline Information: Using Consumer Devices to Keep
Passengers Informed and as an Additional Channel to Market In: 2004 IEEE International

64

Conference on Mobile Data Management. Kaifeng: IEEE Press, [Online] Portal, IEEE Digital
Library [Accessed on] 12 August 2010.

McFadden, F.R. et al. (2007). Modern Database Management. India: Pearson Education.

Hurwitz, D. & Liberty, J. (2006). Programming ASP.NET. USA: O'Reilly Media, Inc.

Bergsten, H. (2004). JavaServer faces. USA: O'Reilly Media, Inc.

Kurniawan, B. (2004). JavaServer Faces programming. Glasgow: McGraw-Hill.

Bergstrom, S. & Raberg, L. (2004). Adopting the Rational Unified Process: Success with the
RUP. USA: Addison Wesley.

Nielsen, J. (1994b). Heuristic evaluation. In Nielsen, J., and Mack, L. Usability Inspection
Methods, John Wiley & Sons, New York, NY.

Wooley, Jim. et al. (2008). LINQ in Action. USA: Manning.

Flight Schedule.[Online] Available at: < www.kayak.com > [Accessed 11 August 2010]

Snasel, S. et al. (2009). Web site assessment in the airline industry: An empirical study of GCC
airline companies In: Applications of Digital Information and Web Technologies, 2009.
ICADIWT '09. Kaifeng: IEEE Press, pp. 193-198 [Online] Portal, IEEE Digital Library
[Accessed on] 12 August 2010.

C.J. Date, An Introduction to Database Systems (third edition), Addison-Wesley, 1981.

E.F. Codd, "Normalized Data Base Structure: A Brief Tutorial", ACM SIGFIDET
Workshop on Data Description, Access, and Control, Nov. 11-12, 1971, San Diego,
California, E.F. Codd and A.L. Dean (eds.).

Relational model for data base DEHENEFFE, HENNEBERT, et al. - 1974

65

Appendix
1. Price data for London-Zurich flight

Date
8-Dec
9-Dec
10-Dec
11-Dec
12-Dec
13-Dec
14-Dec
15-Dec
16-Dec
17-Dec
18-Dec
19-Dec
20-Dec
21-Dec
22-Dec
23-Dec
24-Dec
25-Dec
26-Dec
27-Dec
28-Dec
29-Dec
30-Dec
31-Dec

Day
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri

Reading1
8 Dec

Reading-2
9 Dec

Date
1-Jan
2-Jan
3-Jan
4-Jan
5-Jan
6-Jan
7-Jan
8-Jan
9-Jan
10-Jan
11-Jan
12-Jan
13-Jan
14-Jan
15-Jan
16-Jan
17-Jan
18-Jan
19-Jan
20-Jan
21-Jan
22-Jan
23-Jan
24-Jan
25-Jan

53.99
63.99
78.99
73.99
78.99
83.99
83.99
53.99
63.99
37.99
37.99
37.99
37.99
37.99
37.99
42.99
43.99
57.99
63.99
65.99
65.99
43.99
41.99
4.00
4.00
40.99
38.99
51.99
50.99
63.99
65.99
NFA*
NFA
65.99
65.99
55.99
55.99
55.99
55.99
55.99
53.99
63.99
62.99
65.99
65.99

Day
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue

Reading- Reading1
2
8 Dec
9 Dec
40.99
41.99
83.99
87.99
43.99
40.99
28.99
27.99
25.99
26.99
25.99
26.99
28.99
28.99
26.99
26.99
26.99
26.99
26.99
26.99
25.99
25.99
25.99
25.99
26.99
26.99
30.99
31.99
25.99
26.99
26.99
26.99
25.99
25.99
26.99
26.99
25.99
25.99
25.99
25.99
30.99
30.99
25.99
26.99
25.99
25.99
25.99
25.99
25.99
25.99

* NFA No flight available.

Date
26-Jan
27-Jan
28-Jan

Day
Wed
Thu
Fri

Reading- Reading1
2
8 Dec
9 Dec
Date
25.99
25.99
20-Feb
25.99
25.99
21-Feb
35.99
36.99
22-Feb
66

Day
Sun
Mon
Tue

Reading- Reading1
2
8 Dec
9 Dec
28.99
28.99
25.99
25.99
25.99
25.99

29-Jan
30-Jan
31-Jan
1-Feb
2-Feb
3-Feb
4-Feb
5-Feb
6-Feb
7-Feb
8-Feb
9-Feb
10-Feb
11-Feb
12-Feb
13-Feb
14-Feb
15-Feb
16-Feb
17-Feb
18-Feb
19-Feb

Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat

28.99
26.99
25.99
25.99
25.99
26.99
26.99
25.99
25.99
25.99
25.99
25.99
25.99
27.99
25.99
25.99
25.99
25.99
25.99
25.99
27.99
25.99

30.00
26.99
25.99
25.99
25.99
26.99
28.99
25.99
25.99
25.99
25.99
25.99
25.99
28.99
25.99
25.99
25.99
25.99
25.99
25.99
27.99
25.99

23-Feb
24-Feb
25-Feb
26-Feb
27-Feb
28-Feb
1-Mar
2-Mar
3-Mar
4-Mar
5-Mar
6-Mar
7-Mar
8-Mar
9-Mar
10-Mar
11-Mar
12-Mar
13-Mar
14-Mar
15-Mar
16-Mar

67

Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed

25.99
25.99
31.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
27.99
25.99
25.99
25.99
25.99
25.99

25.99
25.99
32.99
27.99
25.99
25.99
25.99
25.99
25.99
27.99
25.99
25.99
25.99
25.99
25.99
25.99
27.99
25.99
25.99
25.99
25.99
25.99

Date
17-Mar
18-Mar
19-Mar
20-Mar
21-Mar
22-Mar
23-Mar
24-Mar
25-Mar
26-Mar
27-Mar
28-Mar
29-Mar
30-Mar
31-Mar
1-Apr
2-Apr
3-Apr
4-Apr
5-Apr
6-Apr
7-Apr
8-Apr
9-Apr
10-Apr

Day
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun

Reading- Reading1
2
8 Dec
9 Dec
Date
25.99
25.99
11-Apr
27.99
27.99
12-Apr
27.99
27.99
13-Apr
25.99
25.99
14-Apr
27.99
27.99
15-Apr
25.99
25.99
16-Apr
25.99
25.99
17-Apr
25.99
25.99
18-Apr
27.99
27.99
19-Apr
27.99
27.99
20-Apr
28.99
27.99
21-Apr
25.99
25.99
22-Apr
25.99
25.99
23-Apr
25.99
25.99
24-Apr
25.99
25.99
25-Apr
25.99
25.99
26-Apr
25.99
25.99
27-Apr
28.99
28.99
28-Apr
25.99
25.99
29-Apr
25.99
25.99
30-Apr
25.99
25.99
1-May
25.99
25.99
2-May
25.99
25.99
3-May
25.99
25.99
4-May
28.99
28.99
5-May

68

Day
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu

Reading- Reading1
2
8 Dec
9 Dec
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
28.99
28.99
30.99
30.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
27.99
27.99
28.99
28.99
25.99
25.99
25.99
25.99
27.99
25.99
37.99
37.99
32.99
32.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99

Date
6-May
7-May
8-May
9-May
10-May
11-May
12-May
13-May
14-May
15-May
16-May
17-May
18-May
19-May
20-May
21-May
22-May
23-May
24-May
25-May
26-May
27-May
28-May
29-May
30-May

Day
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon

Reading- Reading1
2
8 Dec
9 Dec
Date
30.99
30.99 31-May
25.99
25.99
1-Jun
30.99
30.99
2-Jun
25.99
25.99
3-Jun
25.99
25.99
4-Jun
25.99
25.99
5-Jun
25.99
25.99
6-Jun
27.99
27.99
7-Jun
25.99
25.99
8-Jun
25.99
25.99
9-Jun
28.99
28.99
10-Jun
25.99
25.99
11-Jun
25.99
25.99
12-Jun
25.99
25.99
27.99
27.99
25.99
25.99
27.99
27.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
35.99
35.99
43.99
43.99
37.99
37.99
25.99
25.99

Day
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun

Reading- Reading1
2
8 Dec
9 Dec
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
32.99
32.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99
25.99

2. Price data for London-Amsterdam flight


Date
9-Dec
10-Dec
11-Dec
12-Dec
13-Dec
14-Dec
15-Dec
16-Dec
17-Dec

Day
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat

Date
Day
5-Jan Thu

Price
Date
68.99
18-Dec
58.99
19-Dec
228.99
20-Dec
72.99
21-Dec
38.99
22-Dec
38.99
23-Dec
38.99
24-Dec
68.99
25-Dec
78.99
26-Dec

Day
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon

Price
Date
78.99
27-Dec
71.99
28-Dec
50.99
29-Dec
60.99
30-Dec
68.99
31-Dec
80.99
1-Jan
NFA
2-Jan
78.99
3-Jan
76.99
4-Jan

Price
Date
Day
25.99
16-Feb Thu

Day
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed

Price
Date
Day
31.99 30-Mar Thu
69

Price
60.99
60.99
71.99
64.99
50.99
101.99
58.99
34.99
25.99
Price
25.99

6-Jan
7-Jan
8-Jan
9-Jan
10-Jan
11-Jan
12-Jan
13-Jan
14-Jan
15-Jan
16-Jan
17-Jan
18-Jan
19-Jan
20-Jan
21-Jan
22-Jan
23-Jan
24-Jan
25-Jan
26-Jan
27-Jan
28-Jan
29-Jan
30-Jan
31-Jan
1-Feb
2-Feb
3-Feb
4-Feb
5-Feb
6-Feb
7-Feb
8-Feb
9-Feb
10-Feb
11-Feb
12-Feb
13-Feb
14-Feb
15-Feb
Date
11-May
12-May
13-May
14-May

Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Day
Thu
Fri
Sat
Sun

26.99
31.99
50.99
26.99
26.99
26.99
26.99
26.99
28.99
30.99
25.99
26.99
26.99
25.99
26.99
26.99
26.99
25.99
26.99
26.99
31.99
32.99
26.99
26.99
25.99
25.99
26.99
26.99
31.99
26.99
26.99
25.99
25.99
25.99
25.99
25.99
36.99
27.99
26.99
25.99
25.99
Price
27.99
27.99
27.99
44.99

17-Feb
18-Feb
19-Feb
20-Feb
21-Feb
22-Feb
23-Feb
24-Feb
25-Feb
26-Feb
27-Feb
28-Feb
1-Mar
2-Mar
3-Mar
4-Mar
5-Mar
6-Mar
7-Mar
8-Mar
9-Mar
10-Mar
11-Mar
12-Mar
13-Mar
14-Mar
15-Mar
16-Mar
17-Mar
18-Mar
19-Mar
20-Mar
21-Mar
22-Mar
23-Mar
24-Mar
25-Mar
26-Mar
27-Mar
28-Mar
29-Mar

Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed

82.99
228.99
78.99
30.99
25.99
25.99
25.99
26.99
25.99
26.99
25.99
25.99
25.99
27.99
25.99
25.99
28.99
25.99
25.99
25.99
25.99
25.99
26.99
28.99
25.99
25.99
25.99
26.99
25.99
25.99
35.99
25.99
25.99
25.99
25.99
25.99
34.99
45.99
30.99
25.99
27.99

70

31-Mar
1-Apr
2-Apr
3-Apr
4-Apr
5-Apr
6-Apr
7-Apr
8-Apr
9-Apr
10-Apr
11-Apr
12-Apr
13-Apr
14-Apr
15-Apr
16-Apr
17-Apr
18-Apr
19-Apr
20-Apr
21-Apr
22-Apr
23-Apr
24-Apr
25-Apr
26-Apr
27-Apr
28-Apr
29-Apr
30-Apr
1-May
2-May
3-May
4-May
5-May
6-May
7-May
8-May
9-May
10-May

Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed

28.99
43.99
39.99
26.99
25.99
25.99
27.99
27.99
40.99
43.99
27.99
26.99
25.99
27.99
27.99
27.99
37.99
27.99
25.99
25.99
27.99
35.99
27.99
41.99
27.99
27.99
26.99
27.99
35.99
27.99
46.99
27.99
25.99
25.99
25.99
27.99
27.99
55.99
27.99
27.99
25.99

15-May
16-May
17-May
18-May
19-May
20-May
21-May
22-May
23-May
24-May
25-May
26-May
27-May
28-May
29-May
30-May
31-May
1-Jun
2-Jun
3-Jun
4-Jun
5-Jun
6-Jun
7-Jun
8-Jun
9-Jun
10-Jun
11-Jun

Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun

30.99
27.99
25.99
25.99
27.99
25.99
30.99
27.99
25.99
25.99
25.99
35.99
49.99
39.99
30.99
27.99
25.99
25.99
25.99
27.99
163.99
78.99
26.99
25.99
25.99
27.99
27.99
35.99

71

3. Questionnaire
1. How often you travel?
a. Frequently
b. Rarely
c. Never

2. What method you use for booking tickets?


a. Buy ticket Online
b. Go to airline franchise
c. Buy ticket through phone
d. Both

3. How often you book ticket online?


a. Almost every week
b. Once in a month
c. More than once in a month
d. Once or twice in a year

4. If you buy ticket online, which method you prefer?


a. Visit airlines web site directly
b. Visit website which offers different airline services
c. Both

5. Do you think airlines web site provides all the facilities customer requires?
a. Yes
b. No
c. Cant say

6. Do you think website which offers different airline services provides all the facilities customer
requires?
a. Yes
b. No
c. Cant say

72

7. Do you think airline websites are user friendly?


a. Yes
b. No
c. Cant say

8. What do you think should be included to make airline websites friendlier?

___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___


___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___

9. Do you think airline websites are user friendly?


a. Yes
b. No
c. Cant say

10. Are you comfortable with the flight search methods which airlines provide?
a. Yes
b. No
c. Cant say

11. What do you think should be included to make flight search friendlier?

___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___


___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___

12. Are you comfortable with the flight reservation process which airlines provide?
a. Yes
b. No
c. Cant say

13. What do you think should be included to make flight reservation process more comfortable?

___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___

73

___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___

14. Are you comfortable with the airline pricing system?


a. Yes
b. No
c. Cant say

15. Do you think airline pricing system should be variable i.e. based on the external factors such as fuel
pricing, flight season etc?
a. Yes
b. No
c. Cant say

16. What do you think should be included to make airline pricing better?

___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___


___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___

17. What do you think airlines are charging extra for their flights?

___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___


___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___

18. Have you ever faced any type of system down issue?
a. Yes
b. No
c. Cant say

19. Did the airline provide any type of alternate solution while there system was down?
a. Yes
b. No
c. Cant say

74

20. What was the solution if answer to Question 19 is Yes?

___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___


___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___

21. What you have done why system was down?

___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___


___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___

22. Do you think airlines flight scheduling is up to the mark according to the customer requirements?
a. Yes
b. No
c. Cant say

23. If answer to Question 22 is No, then please provide the problem you faced while booking tickets?

___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___


___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___

24. Do the airlines give on time season offers?


a. Yes
b. No
c. Cant say

25. Do you found these offers attractive?


a. Yes
b. No
c. Cant say

26. Are the fares in the season offers are reasonable?


75

a. Yes
b. No
c. Cant say

27. What do you suggest to improve the season offers and things which should be included?
___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___
___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___

28. Any other suggestions?


___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___
___________ _____ ___ ____ _ __ __ __ __ ____ __ _____ ____ ___

76

4. Extended project proposal

Computer Science Modular Masters Project May 2010


Extended Project Proposal
Student Family Name:
ALANAZI

Student First Name:


AHMED

Student Registration Number:


07169574

Supervisor Name:
Dr Boekhorst, Rene te

Award Title:
Computer science

Second Marker Name:


Dr Bennett, Steve

Project Title/Research Question:


Flight Reservation System
-

Which factors behind airlines prices changes?


To what extent these factors might change in various airlines?

Student Signature:

Date: 28 June 2010

77

Table of Contents

Index

Section

Page
Number

Introduction

Methodology

Functions

Objectives

Time plan

Hardware/Software Requirements

Bibliography

78

Introduction
Over the last years, the evolution of airline industry has shown a significant increase of
number of customers. This huge increment was the main reason of the severe demand
for developing automatic system which provides fast and easy service for those
customers. (Morrison & Winston, 1995)
Flight reservation is one of the first systems that we interact with in order to plan a trip.
Be it a leisure trip with flexible schedule or an emergency travel, reservation system
plays a vital role in facilitating the potential customers of an airline. It helps the airlines
by streamlining their process of reservation without human interaction thus enabling
them to perform well in the highly competitive market place. (Shaw, 2004)
The need of this system was realized since the early ages of air line industry when
information such as route, aircraft, schedule and fare about flight was published by
airlines in large books. Travel agents had the tough job to look into separate books for
reservations that involve multiple airlines. It was a dream to get a real time picture of
available seats because airlines share information at day end only. American Airline
was the first to build the computerized system to allow access to real time data to all its
offices. In 1964, Semi-Automated Business Research Environment (SABRE) was
developed with the help of IBM. (Desmond, 1989)
A typical flight reservation system provides functionalities such as flight schedule
information, seats availability, fare quote, reservation information, ticket information,
refunds and cancellation. Modern systems extend its services to provide features such
as hotel and car reservation in order to make the itinerary complete.
Pricing system is one of the most complex systems that people deal with. Each airline
has different pricing strategy and there are several factors might affect prices. For
example flight fares might change as a result of timing, seasons, availability,
competition and demand.

79

Scope and Methodology


The aim of this project is to understand how does pricing system work and try to figure
out which factors that affect airlines prices. Also it aims to produce and develop an
airline reservation system which will help people to book tickets for their trips. Airline
reservation system is complex system and making it to be managed by software system
instead of human will reduce the error percentage by a huge margin. It will make
process of scheduling trips easier and prevent clashes of confirmed bookings; times
overlap and so many other problems associated with the mass scale reservation tasks.
More importantly it will help the airline to see the real time picture of the available seats
and perform analytical processing to determine the feasibility of current flight schedules.
It will help customers to book their tickets from their homes and the pricing system will
be automated to increase or decrease depending on the parameters of choice such as
season, availability of seats and time of booking. This system may also enable the
airline to implement special processes for their corporate customers. Our intended
system would be a web based system which will be available 24/7 to allow customers to
book their tickets anytime. I have divided this project into 3 major phases which are
Requirement Gathering
This phase includes identification of all the functionalities which will be covered in
the prototype for the scope of this project. Reading previous researches about
airlines pricing systems in order to gain more knowledge.
Research on the current web technologies
As this will be the web application I will do research on I have choose ASP.NET with
C Sharp for the development of this prototype. (Sanderson, 2009)
Software Development and Reports
For the software development I will use RUP (Rational Unified Process) as the
development process and Prototype as development model. (Bergstrom & Raberg,
2004)

80

Figure 1: System Analysis Diagram

Function
System functionality is divided into two main scopes which are User Functionality and
Administrator Functionality.
-

User Functionality
Register
Login
Search for flight
Book flight
View booking details
Cancellation

Administrator Functionality
Login
View Flight
Add Flight
Edit / Delete Flight
View Reservations
Edit / Delete Reservation

81

Objectives
The project objectives should be set before the start of project because they provide a
guideline during the whole project and prevent researcher/developer to progress in
wrong direction. I have divided my project objectives into two parts; Core and Advance.
My core objectives are those which I must need to achieve to do this project
successfully and advance objectives are the ones which I will attempt based on the time
frame of this project.

- basic objectives of the project


Doing a research for Investigating and understanding the airlines
pricing mechanism.
Implementing an airline reservation system depends on the research
findings:

Allowing customers to register to the system.


Allowing customers to log in.
Customers can search for flight by date.
Customers can book flight and make reservation.
Customers can view their reservation status and details.
Customers can cancel their reservation.

- advanced objectives of the project


Allowing customers to confirm tickets by doing payment for their trips.
Allowing customers to get ticket electronically (e-ticket).
Giving customers seasonal and other discount offers.
Giving customers a price comparison for the trip they want to book.
All Bookings will be shown for Admin.
A waiting list customers will be activated.

82

Time Plan for the Project


Work Description

Days

Requirement Analysis
Investigating and research the airlines pricing system

10

System and software requirements

Producing draft document

Literature Review
Software development processes and models

Current Web technologies and its use in the software industry

.NET technology standards and how it can help in developing web based
systems
.NET technology comparisons with other available technologies

How I can use .NET technologies for the development of Airline Reservation
System
Producing draft document

Design and Analysis Phase


Design database schema

Model user and system requirements (UML diagrams)

Produce GUI mockups

Producing draft document

System Development
Implementation of Airline Reservation System

15
1

Producing draft document

Evaluation and Testing


Testing of the system

Critical analysis

Evaluation of the system against objectives

Producing draft document

Dissertation Report
Writing dissertation report using all the draft documents

10
1

Producing appendixes section

64

Total

83

Hardware/Software Requirements
Following are the software requirements for the project
Microsoft Visual Studio 2008
SQL Server 2005
.NET framework 3.5
Windows XP SP2 (Including IIS)
Microsoft Office 2007 (Office/Visio/Project)
ASP.NET- C sharp
Photoshp CS3

84

Bibliography

Books
1. Bergstrom & Raberg (2004). Adopting the Rational Unified Process:
Success with the RUP. USA: Addison Wesley.
2. Sanderson (2009). Pro ASP.NET MVC Framework: Apress Series Expert's
voice in .NET. USA: Apress.
3. Shaw (2004). Airline Marketing and Management. 5th ed. England: Ashgate.
4. Morrison & Winston (1995). The evolution of the airline industry. US.
Washington: The Brookings Institution.

Articles
1.

Desmond (1989). Max Hopper knows Sabre's 'software guts': American


pushing limits of software at 2,000+ TPS - transactions per second.
Available:
http://findarticles.com/p/articles/mi_m0SMG/is_n2_v9/ai_7349011. Last
accessed June 2010.

85

5. Progress report 1

Modular Masters Programme in Computer Science


Project Modules - Progress Report 1

Name: Ahmed ALANAZI


Rene te

Supervisor: Boekhorst,

Title of Project: Flight Reservation System

Date: 09/07/10

Work completed since last report


Our first task on this project was to find out the factors that changes the air ticket prices and to
some extent see how much these factors may differ across different airlines.
I have started with searching out the factors by visiting different airlines websites and also
consulting the statistical agencies that publish the historical data regarding the ticket price
change for several destinations.
After all the research and evaluation of historical data, I believe following are the major factors
that we can use in our project either in full or partial state.
1. Jet Fuel Prices in international market.
2. Season
3. Time of flight
4. Time of purchase (usually early birds gets discount)
5. Day of flight
6. Route popularity
7. Plane loads (how full planes are)
8. Similar flight fare from competitor
9. Airport congestion
10. Local events near the flight time (such as the world cup)

86

What I have learnt


There are so many interesting pricing factors and myths are now part of our knowledgebase.
Such as not only the day we travel but the day we purchase matters. According to research by
wired.com, price drop usually come early in the week. Common wisdom of buying tickets farther
in advance usually does not save money. According to research, the lowest price tends to hit
between eight and two weeks before departure.
The price from one origin to a particular destination varies giving seemingly random fares
depending on unknown factors. As the prices change so rapidly and based on several known
and unknown factors, it is very hard to predict the air fare in advance. Also different airlines can
weigh a particular price factor differently.
In short prices of a particular trip are calculated based on some BASE FARE and then applying
the different factors such as described above. So at different times, fare of a particular trip might
be 150% of the base price or just the 50% of the base price. It all depends how we weigh
different factors.

Problems encountered and impact of these on schedule


Although we have so many data available about the fare from one particular origin to a
particular destination but it is hard to analyze as what factor exactly caused the price change.
We have historical statistical data such as average prices and ATPI (Air Travel Price Index)
available on Bureau of transportation statistics site for all major airport of US comparing pricing
each quarter for several years. However learning about the exact pricing factor(s) and how they
influence may require consultation with some airline. I believe this will lead us to another way
and would be out of the scope of this project.

Work to be done over next period


I will be working out next about how these factors can be formulated to calculate a fare. Also I
will be dealing with the architectural and database design of the application.

87

6. Progress report 2
Modular Masters Program in Computer Science
Project Modules - Progress Report 2
Name: Ahmed ALANAZI

Supervisor: Dr Rene

Title of Project: Flight Reservation System

Date: 26/07/10

Work completed since last report


In the last period, I had found some factors that may cause the airfare to fluctuate. In current
period, I continued to research about the history of air pricing and its hidden mechanics. I have
found that the air ticket pricing is a complex procedure that would involve extensive numerical
analysis. I have tried to formulate the method that would tell the system that how these factors
will be used to make pricing decisions. Though this algorithm just a simplest step of what
airlines would actually do to quote a fare, but this will serve our purpose.
Apart of algorithm development, I have worked on two major parts of the report writing. By now I
have completed draft for introduction and literature review sections of the report and both of
these are close to the final shape.

What I have learnt


Pricing methods.
Pricing algorithms and underlying mathematical calculations.
Professional report writing.

Problems encountered and impact of these on schedule


Major problem I have faced in this period is to understand the mechanics of the pricing. There
were little problems related to report structuring and transforming the raw information into
professional and readers friendly report sections, but I successfully managed to sort these
problems following the industry standards. I do not see any problem with my progress to meet
the project schedule.

88

Work to be done over next period


Now I will be working on the design of the application and some of the implementation
diagrams. I will also be working on the next sections in my report document.

89

7. Progress report 3

Modular Masters Programme in Computer Science


Project Modules - Progress Report 3
Name: Ahmed Alanazi

Supervisor: Dr Rene

Title of Project: Flight Reservation System

Date: 10/08/10

Work completed since last report


Since the start of the project, I have found the factors that influence on the airfare. By now I
have the final shape of the pricing algorithm that will be implemented in our system. In report
writing, I have finalized the introduction and literature review section. Apart from these, I have
worked on the DB design of the project. DB schema has been prepared along with the basic
UML (use cases diagrams). I have worked on the GUI design of the application and all
functional screens have been designed. An abstract site navigation flow has been designed and
is in process of implementation now. Now I am progressing with the implementation of business
rules and application data flow.

What I have learnt


Database Design and schema generation.
Basic UML diagrams such as use case diagram and navigation flow.
GUI designing.
Web pages development (design only) in Visual studio .net and implementing navigation.
Research on the usage of built in login controls available in MS .Net.
Writing code in C# to implement the business logic.

Problems encountered and impact of these on schedule


I am having little problem with getting familiar to more advance controls in .Net. I am trying to
get the grid controls work so that I can implement the search results screen which is the major
screen of this project. At the moment I do not see any major risk that would impact the project
schedule.

90

Work to be done over next period


I will be working on the report writing and implementation of the business logic of the project.

91

8. Progress report 4
Modular Masters Programme in Computer Science
Project Modules - Progress Report 4
Name: Ahmed ALANAZI

Supervisor: Dr Rene

Title of Project: Flight Reservation System

Date: 24/08/10

Work completed since last report


In the past two weeks I have been working mainly on the implementation of the web application.
Major functionality for searching and reserving the seat has been completed by now. I am
progressing with few of the pages that need to be implemented for the administrator of the web
application to set up the basic data about flights, its locations and pricing of a particular flight.

What I have learnt


Web pages implementation.
Design and implementation of three tier architecture for our application.

Problems encountered and impact of these on schedule


Problems with implementations of the three tier architecture using separate projects for each
layer. I also faced little problem with the handling of inline and external design sheets (css) for
the site.

92

Work to be done over next period


After completion of the administration module, I will resume the documentation and report
writing for the project.

93

9. Project code

Index.aspx
using
using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections;
System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Web.UI.HtmlControls;
System.Xml.Linq;

using FRS.BusinessLayer;
namespace FRSWeb
{
public partial class index : System.Web.UI.Page
{
protected void btnGetFlights_Click(object sender, EventArgs e)
{
SearchData srchData = new SearchData();
srchData.From = ddlFrom.SelectedValue;
srchData.To = ddlTo.SelectedValue;
srchData.Depart =
DateTime.ParseExact(txtDepartDate.Text,"d/M/yyyy",null);
srchData.IsFixedDates = chkbFixedDates.Checked;
srchData.IsOneWayOnly = chkbOneWayOnly.Checked;
if(!srchData.IsOneWayOnly )
srchData.Return = DateTime.ParseExact(txtReturnDate.Text,
"d/M/yyyy", null);
else
srchData.Return = srchData.Depart;
srchData.FlightClass = ddlFlightClass.SelectedValue;
srchData.NoOfAdults = ddlNoOfAdults.SelectedValue;
srchData.NoOfChildren = ddlNoOfChildren.SelectedValue;
srchData.NoOfInfants = ddlNoOfInfants.SelectedValue;
srchData.NoOfPassengers =
Int32.Parse(ddlNoOfAdults.SelectedValue)
+
Int32.Parse(ddlNoOfChildren.SelectedValue)
+
Int32.Parse(ddlNoOfInfants.SelectedValue);
srchData.FromText = ddlFrom.SelectedItem.Text;
srchData.ToText = ddlTo.SelectedItem.Text;
srchData.FlightClassText = ddlFlightClass.SelectedItem.Text;
Session["SearchData"] = srchData;
Response.Redirect("Flights.aspx");
}

94

protected void chkbOneWayOnly_CheckedChanged(object sender, EventArgs


e)
{
if (chkbOneWayOnly.Checked)
rfvReturn.Enabled = false;
else
rfvReturn.Enabled = true;
}
}
}

Flight.aspx
using
using
using
using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections;
System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Web.UI.HtmlControls;
System.Xml.Linq;
System.Collections.Generic;
FRS.BusinessLayer;

namespace FRSWeb
{
public partial class Flights : System.Web.UI.Page
{
List<FlightsData> outBoundFlightsList ;
List<FlightsData> inBoundFlightsList;
List<FlightPricesData> flightPricesList;
SearchData srchData = null;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["SearchData"] != null)
{
srchData = (SearchData)Session["SearchData"];
if (!srchData.IsOneWayOnly)
{
InboundPanel.Visible = true;
}
}
if (!IsPostBack)
{
FlightsBL FlghtBL = new FlightsBL();
outBoundFlightsList = FlghtBL.getFlights(srchData.From,
srchData.To);
ViewState["outBoundFlightsList"] = outBoundFlightsList;
Calendar2.VisibleDate = srchData.Depart;

95

if (InboundPanel.Visible && srchData!=null)


{
inBoundFlightsList = FlghtBL.getFlights(srchData.To,
srchData.From);
ViewState["inBoundFlightsList"] = inBoundFlightsList;
inboundCalendar.VisibleDate = srchData.Return;
}
flightPricesList = FlghtBL.getFlightPrices(srchData.From,
srchData.To);
ViewState["flightPricesList"] = flightPricesList;
}
else
{
outBoundFlightsList = (List<FlightsData>)
ViewState["outBoundFlightsList"];
if (InboundPanel.Visible)
inBoundFlightsList = (List<FlightsData>)
ViewState["inBoundFlightsList"];
flightPricesList =
(List<FlightPricesData>)ViewState["flightPricesList"];
}
}
protected void Calendar2_DayRender(object sender, DayRenderEventArgs
e)
{
//outbound
CalendarDay cDay = e.Day;
TableCell tCell = e.Cell;
PricingManager pricingMngr = new PricingManager();
if (cDay.IsOtherMonth)
{
tCell.Text = String.Empty;
return;
}
if (cDay.Date <= DateTime.Now)
{
tCell.Text = String.Empty;
return;
}
if (outBoundFlightsList != null)
{
foreach (FlightsData fd in outBoundFlightsList)
{
if (cDay.Date >= fd.effectiveFrom
&& cDay.Date <= fd.effectiveTo
&& cDay.Date.DayOfWeek ==
ConvertToDayOfWeek(fd.weekday)
)
{
//dispay label
//caculate price
//store price and display it.

96

Label blanklbl = new Label();


blanklbl.Text = "<br/>";
tCell.Controls.Add(blanklbl);
Label lbl = new Label();
lbl.Text = fd.flightCode;
lbl.Font.Bold = true;
tCell.Controls.Add(lbl);
Label blanklbl2 = new Label();
blanklbl2.Text = "<br/>";
tCell.Controls.Add(blanklbl2);
Label pricelbl = new Label();
double flightPrice =
pricingMngr.getFlightPrice(flightPricesList, fd.flightID,
cDay.Date,
srchData.From, srchData.To);
pricelbl.Text = "" + flightPrice.ToString();
tCell.Controls.Add(pricelbl);
RadioButton rdBtn = new RadioButton();
rdBtn.GroupName = "FLIGHTS";
rdBtn.Attributes.Add("onclick", e.SelectUrl);
if (cDay.IsSelected)
{
rdBtn.Checked = true;
//update hidden value.
selectedOutBoundFlight.Value = fd.flightID + ","
+ cDay.Date.ToString()
+ "," + pricelbl.Text;
Session["SelectedOutBoundFlightID"] =
fd.flightID;
Session["SelectedOutBoundFlightDate"] =
cDay.Date;
Session["SelectedOutBoundFlightPrice"] =
flightPrice;
fd.FlightDate = cDay.Date;
Session["SelectedFlightsDataOutBound"] = fd;
lblOutBoundFlightError.Visible = false;
}
tCell.Controls.Add(rdBtn);
break;
}
}
}
else
{
//hide calendar and display message about no flights
//hide next button and ask user to hit prev button
lblOutBoundFlightError.Text = "No flights available, please
search again";
lblOutBoundFlightError.Visible = true;
}
}
private DayOfWeek ConvertToDayOfWeek(string weekday)
{

97

switch (weekday)
{
case "1":
return DayOfWeek.Monday;
case "2":
return DayOfWeek.Tuesday;
case "3":
return DayOfWeek.Wednesday;
case "4":
return DayOfWeek.Thursday;
case "5":
return DayOfWeek.Friday;
case "6":
return DayOfWeek.Saturday;
case "7":
return DayOfWeek.Sunday;
}
return DayOfWeek.Sunday; //just to avoid compiler error. It wont
execute ever
}
protected void inboundCalendar_DayRender(object sender,
DayRenderEventArgs e)
{
CalendarDay cDay = e.Day;
TableCell tCell = e.Cell;
PricingManager pricingMngr = new PricingManager();
if (cDay.IsOtherMonth)
{
tCell.Text = String.Empty;
return;
}
if (cDay.Date <= DateTime.Now)
{
tCell.Text = String.Empty;
return;
}

if (inBoundFlightsList != null)
{
foreach (FlightsData fd in inBoundFlightsList)
{
if (cDay.Date >= fd.effectiveFrom
&& cDay.Date <= fd.effectiveTo
&& cDay.Date.DayOfWeek ==
ConvertToDayOfWeek(fd.weekday)
)
{
//dispay label
//caculate price
//store price and display it.
Label blanklbl = new Label();
blanklbl.Text = "<br/>";
tCell.Controls.Add(blanklbl);
Label lbl = new Label();

98

lbl.Text = fd.flightCode;
lbl.Font.Bold = true;
tCell.Controls.Add(lbl);
Label blanklbl2 = new Label();
blanklbl2.Text = "<br/>";
tCell.Controls.Add(blanklbl2);
Label pricelbl = new Label();
double flightPrice =
pricingMngr.getFlightPrice(flightPricesList, fd.flightID,
cDay.Date,
srchData.To, srchData.From);
pricelbl.Text = "" + flightPrice.ToString();
tCell.Controls.Add(pricelbl);
RadioButton rdBtn = new RadioButton();
rdBtn.GroupName = "INBOUNDFLIGHTS";
rdBtn.Attributes.Add("onclick", e.SelectUrl);
if (cDay.IsSelected)
{
rdBtn.Checked = true;
//update hidden value.
selectedInBoundFlight.Value = fd.flightID + "," +
cDay.Date.ToString()
+ "," +
pricelbl.Text;
Session["SelectedInBoundFlightID"] = fd.flightID;
Session["SelectedInBoundFlightDate"] = cDay.Date;
Session["SelectedInBoundFlightPrice"] =
flightPrice;
fd.FlightDate = cDay.Date;
Session["SelectedFlightsDataInBound"] = fd;
lblInBoundFlightError.Visible = false;
}
tCell.Controls.Add(rdBtn);
break;
}
}
}
else
{
//hide calendar and display message about no flights
//hide next button and ask user to hit prev button
lblInBoundFlightError.Text = "No flights available, please
search again";
lblInBoundFlightError.Visible = true;
}
}
protected void btnNext_Click(object sender, EventArgs e)
{
if (selectedOutBoundFlight.Value == String.Empty)
{
//plz select outbound flight

99

lblOutBoundFlightError.Text = "Please select outbound


flight";
lblOutBoundFlightError.Visible = true;
}
else if(InboundPanel.Visible==true &&
selectedInBoundFlight.Value==String.Empty)
{
//plz select inbound flight
lblInBoundFlightError.Text = "Please select inbound flight";
lblInBoundFlightError.Visible = true;
}
else
Response.Redirect("Itinerary.aspx");
}
protected void btnSearchAgain_Click(object sender, EventArgs e)
{
Response.Redirect("index.aspx");
}
}
}

Passengers.aspx
using
using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections;
System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Web.UI.HtmlControls;
System.Xml.Linq;

using FRS.BusinessLayer;
namespace FRSWeb
{
public partial class Passengers : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SearchData srchData=null;
if (Session["SearchData"] != null)
{
srchData = (SearchData)Session["SearchData"];
}
if (srchData != null)
{
//generate controls for adult passengers
for (int i = 2; i <= Int32.Parse(srchData.NoOfAdults); i++)
{//start loop with 2 as we already have placed one control on
main page for first adult

100

Control passengerInfoUserControl =
LoadControl("PassengerInfo.ascx");
((Label)passengerInfoUserControl.FindControl("passengerInfoHeaderLbl")).Text
= Digit_In_Words(i) + " Adult";
passengerInfoUserControl.ID = "PassengerInfo" + "A" +
i.ToString(); //A=Adult, C=Child, I=Infant
PlaceHolder1.Controls.Add(passengerInfoUserControl);
}
//generate controls for child passengers
for (int i = 1; i <= Int32.Parse(srchData.NoOfChildren); i++)
{
Control passengerInfoUserControl =
LoadControl("PassengerInfo.ascx");
((Label)passengerInfoUserControl.FindControl("passengerInfoHeaderLbl")).Text
= Digit_In_Words(i) + " Child";
passengerInfoUserControl.ID = "PassengerInfo" + "C" +
i.ToString();
PlaceHolder1.Controls.Add(passengerInfoUserControl);
}
//generate controls for infant passengers
for (int i = 1; i <= Int32.Parse(srchData.NoOfInfants); i++)
{
Control passengerInfoUserControl =
LoadControl("PassengerInfo.ascx");
((Label)passengerInfoUserControl.FindControl("passengerInfoHeaderLbl")).Text
= Digit_In_Words(i) + " Infant";
passengerInfoUserControl.ID = "PassengerInfo" + "I" +
i.ToString();
PlaceHolder1.Controls.Add(passengerInfoUserControl);
}
}
}
private string Digit_In_Words(int i)
{
switch (i)
{
case 1:
return "First";
case 2:
return "Second";
case 3:
return "Third";
case 4:
return "Fourth";
case 5:
return "Fifth";
case 6:
return "Sixth";
case 7:
return "Seventh";
case 8:
return "Eigth";
case 9:
return "Ninth";
case 10:

101

return "Tenth";
}
return String.Empty;
}
protected void btnChooseFlight_Click(object sender, EventArgs e)
{
Response.Redirect("Flights.aspx");
}
protected void btnNext_Click(object sender, EventArgs e)
{
PassengersBL psngrBL = new PassengersBL();
string PassengersNames = String.Empty;
psngrBL.AddPassenger(ucPassengerInfo1.Gender,
ucPassengerInfo1.Title, ucPassengerInfo1.FirstName
, ucPassengerInfo1.LastName,
ucPassengerInfo1.Dob, ucPassengerInfo1.PhoneNo
, ucPassengerInfo1.CellNo,String.Empty);
PassengersNames += ucPassengerInfo1.LastName + ", "
+ ucPassengerInfo1.FirstName + " "
+ ucPassengerInfo1.Title;
for (int i = 0; i < PlaceHolder1.Controls.Count; i++)
{
PassengerInfo ucPsngerInfo =
(PassengerInfo)PlaceHolder1.Controls[i];
psngrBL.AddPassenger(ucPsngerInfo.Gender, ucPsngerInfo.Title,
ucPsngerInfo.FirstName,
ucPsngerInfo.LastName, ucPsngerInfo.Dob,
ucPsngerInfo.PhoneNo,
ucPsngerInfo.CellNo,String.Empty);
PassengersNames += "<br/>"+ucPsngerInfo.LastName + ", "
+ ucPsngerInfo.FirstName + " "
+ ucPsngerInfo.Title;
}

Session["psngrBL"] = psngrBL;
Session["PassengersNames"] = PassengersNames;
Response.Redirect("Payment.aspx");
}
}
}

Payment.aspx
using
using
using
using

System;
System.Collections;
System.Configuration;
System.Data;

102

using
using
using
using
using
using
using
using

System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Web.UI.HtmlControls;
System.Xml.Linq;

using FRS.BusinessLayer;
namespace FRSWeb
{
public partial class Payment : System.Web.UI.Page
{
PaymentBL myPymentBL;
double totalFare;
protected void Page_Load(object sender, EventArgs e)
{
totalFare = (double)Session["totalFare"];
lblPaymentAmount.Text = totalFare.ToString();
}
protected void btnMakeBooking_Click(object sender, EventArgs e)
{
/*<Begin transaction>
* 1-make payment entry and get the payment id
2- generate booking reference no
3- make entry into flight_booking table
4- make entry into flight passengers
* <end transaction>
5- Show e-ticket page.*/
#region Get Session Data
SearchData srchData = (SearchData)Session["SearchData"];
string outBoundFlightID =
(string)Session["SelectedOutBoundFlightID"];
DateTime outBoundFlightDate =
(DateTime)Session["SelectedOutBoundFlightDate"];
double outBoundFlightPrice =
(double)Session["SelectedOutBoundFlightPrice"];
string inBoundFlightID=string.Empty ;
DateTime inBoundFlightDate;
double inBoundFlightPrice;
#endregion
bool operationSuccess = false;
try
{
myPymentBL = new PaymentBL();
beginTransaction();
// 1-make payment entry and get the payment id
int paymentID = MakePayment();
//2- generate booking reference no
string bookRef = BookingManager.generateBoookingReference();
Session["MyBookingRef"] = bookRef;
//3-a insert outbound flight booking

103

myPymentBL.InsertFlightBooking(outBoundFlightID,
outBoundFlightDate, srchData.FlightClass
, bookRef,
srchData.NoOfPassengers, paymentID);
//3-b if applicable, insert inbound flight booking
if (!srchData.IsOneWayOnly)
{
inBoundFlightID =
(string)Session["SelectedInBoundFlightID"];
inBoundFlightDate =
(DateTime)Session["SelectedInBoundFlightDate"];
inBoundFlightPrice =
(double)Session["SelectedInBoundFlightPrice"];
myPymentBL.InsertFlightBooking(inBoundFlightID,
inBoundFlightDate, srchData.FlightClass
, bookRef,
srchData.NoOfPassengers, paymentID);
}
//4- make entry into passengers & flight passengers
//get passengers that user had entered on last screen
PassengersBL myPassengerBL =
(PassengersBL)Session["psngrBL"];
myPymentBL.InsertFlightPassengers(outBoundFlightID,
srchData.IsOneWayOnly, inBoundFlightID
, bookRef, myPassengerBL);
commitTransaction();
operationSuccess = true;
}
catch (Exception ex)
{
string errMsg = ex.Message;
rollBackTransaction();
}
finally
{
if(operationSuccess)
Response.Redirect("eTicket.aspx");
}
}
private void beginTransaction()
{
myPymentBL.beginTransaction();
}
private void commitTransaction()
{
myPymentBL.commitTransaction();
}
private void rollBackTransaction()
{
myPymentBL.rollBackTransaction();
}

104

private int MakePayment()


{
return myPymentBL.MakePayment(txtBillingAddLine1.Text,
txtBillingAddLine2.Text
, txtBillingAddLine3.Text,
txtBillingAddLine4.Text
, ddlCountry.SelectedValue,
txtCardHolderName.Text
, txtCardNo.Text,
Int32.Parse(ddlCardType.SelectedValue)
,
Int32.Parse(ddlExpiryMonth.SelectedValue)
, ddlExpYear.SelectedValue,
txtSecNo.Text, totalFare);
}
}
}

FlightLocationMgmnt.aspx
using
using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections;
System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Web.UI.HtmlControls;
System.Xml.Linq;

using FRS.BusinessLayer.Admin;
namespace FRSWeb.Admin
{
public partial class FlightLocationMgmnt : System.Web.UI.Page
{
FlightLocationMgmntBL flmBL = new FlightLocationMgmntBL();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
FillFlightLocationsGrid();
}
private void FillFlightLocationsGrid()
{
DataTable dtFL= flmBL.FetchAllRecords();
if (dtFL.Rows.Count > 0)
{
GridView1.DataSource = dtFL;
GridView1.DataBind();
}
else
{
dtFL.Rows.Add(dtFL.NewRow());
GridView1.DataSource = dtFL;
GridView1.DataBind();

105

int TotalColumns = GridView1.Rows[0].Cells.Count;


GridView1.Rows[0].Cells.Clear();
GridView1.Rows[0].Cells.Add(new TableCell());
GridView1.Rows[0].Cells[0].ColumnSpan = TotalColumns;
GridView1.Rows[0].Cells[0].Text = "No Locations Available
yet";
}
}
protected void GridView1_RowCancelingEdit(object sender,
GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
FillFlightLocationsGrid();
}
protected void GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
if (e.CommandName.Equals("AddNew"))
{
string airportCode =
((TextBox)GridView1.FooterRow.FindControl("txtNewAirportCode")).Text;
string airportName =
((TextBox)GridView1.FooterRow.FindControl("txtNewAirportName")).Text;
string cityCode =
((TextBox)GridView1.FooterRow.FindControl("txtNewCityCode")).Text;
string cityName =
((TextBox)GridView1.FooterRow.FindControl("txtNewCityName")).Text;
int timeZone =
Int32.Parse(((DropDownList)GridView1.FooterRow.FindControl("ddlNewTimeZone"))
.SelectedValue);
flmBL.Insert(airportCode,cityCode,timeZone,cityName,airportName);
showFooter.Value = "N";
FillFlightLocationsGrid();
}
else if (e.CommandName.Equals("CancelAddNew"))
{
showFooter.Value = "N";
FillFlightLocationsGrid();
}
}
protected void GridView1_RowDeleting(object sender,
GridViewDeleteEventArgs e)
{
flmBL.Delete(Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString())
);
FillFlightLocationsGrid();
}
protected void GridView1_RowEditing(object sender,
GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
FillFlightLocationsGrid();
}

106

protected void GridView1_RowUpdating(object sender,


GridViewUpdateEventArgs e)
{
string airportCode =
((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtAirportCode")).Text;
string airportName =
((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtAirportName")).Text;
string cityCode =
((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtCityCode")).Text;
string cityName =
((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtCityName")).Text;
int timeZone =
Int32.Parse(((DropDownList)GridView1.Rows[e.RowIndex].FindControl("ddlTimeZon
e")).SelectedValue);
int key =
Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
flmBL.Update(key, airportCode, cityCode, timeZone, cityName,
airportName);
GridView1.EditIndex = -1;
FillFlightLocationsGrid();
}
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Footer)
{
if (showFooter.Value == "N")
e.Row.Visible = false;
}
}
protected void btnAddNew_Click(object sender, EventArgs e)
{
showFooter.Value = "Y";
FillFlightLocationsGrid();
}
}
}

FlightManagement.aspx
using
using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections;
System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Web.UI.HtmlControls;
System.Xml.Linq;

namespace FRSWeb.Admin
{

107

public partial class FlightManagement : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}

FlightPriceMgmnt.aspx
using
using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections;
System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Web.UI.HtmlControls;
System.Xml.Linq;

using FRS.BusinessLayer.Admin;
namespace FRSWeb.Admin
{
public partial class FlightPriceMgmnt : System.Web.UI.Page
{
int selectedFlightID;
protected void Page_Load(object sender, EventArgs e)
{
}
private void FillFlightPricesGrid()
{
DataTable dtFLPrices =
FlightPriceManager.FetchAllRecords(selectedFlightID);
if (dtFLPrices.Rows.Count > 0)
{
GridView1.DataSource = dtFLPrices;
GridView1.DataBind();
}
else
{
/*No data found. Add a blank row to display the message to
user*/
dtFLPrices.Rows.Add(dtFLPrices.NewRow());
GridView1.DataSource = dtFLPrices;
GridView1.DataBind();
int TotalColumns = GridView1.Rows[0].Cells.Count;
GridView1.Rows[0].Cells.Clear();
GridView1.Rows[0].Cells.Add(new TableCell());
GridView1.Rows[0].Cells[0].ColumnSpan = TotalColumns;
GridView1.Rows[0].Cells[0].Text = "Price is not recoreded yet
for the selected flight";

108

}
}
protected void GridView1_RowCancelingEdit(object sender,
GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
selectedFlightID = Int32.Parse(ddlSelectFlight.SelectedValue);
FillFlightPricesGrid();
}
protected void GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
if (e.CommandName.Equals("AddNew"))
{
string strEffectiveFrom =
((TextBox)GridView1.FooterRow.FindControl("txtEffectiveFrom")).Text;
DateTime effectiveFrom =
DateTime.ParseExact(strEffectiveFrom, "dd/MM/yyyy", null);
double basePrice
=Double.Parse(((TextBox)GridView1.FooterRow.FindControl("txtBasePrice")).Text
);
double fuelprice =
Double.Parse(((TextBox)GridView1.FooterRow.FindControl("txtFuel")).Text);
double localEvent
=Double.Parse(((TextBox)GridView1.FooterRow.FindControl("txtLocalEvent")).Tex
t);
double competitorAdjustment =
Double.Parse(((TextBox)GridView1.FooterRow.FindControl("txtCompetitorAdjustme
nt")).Text);
double loadAdjustment
=Double.Parse(((TextBox)GridView1.FooterRow.FindControl("txtLoadAdjustment"))
.Text);
double misc =
Double.Parse(((TextBox)GridView1.FooterRow.FindControl("txtMisc")).Text);
selectedFlightID =
Int32.Parse(ddlSelectFlight.SelectedValue);
FlightPriceManager flghtPriceMngr = new
FlightPriceManager(selectedFlightID,effectiveFrom
,basePrice, fuelprice, localEvent, competitorAdjustment,
loadAdjustment,misc);
flghtPriceMngr.Insert();
showFooter.Value = "N";
FillFlightPricesGrid();
}
else if (e.CommandName.Equals("CancelAddNew"))
{
showFooter.Value = "N";
selectedFlightID =
Int32.Parse(ddlSelectFlight.SelectedValue);
FillFlightPricesGrid();
}
}
protected void GridView1_RowDeleting(object sender,
GridViewDeleteEventArgs e)
{

109

FlightPriceManager.Delete(Int32.Parse(ddlSelectFlight.SelectedValue),
DateTime.Parse(GridView1.DataKeys[e.RowIndex].Value.ToString()));
selectedFlightID = Int32.Parse(ddlSelectFlight.SelectedValue);
FillFlightPricesGrid();
}
protected void GridView1_RowEditing(object sender,
GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
selectedFlightID = Int32.Parse(ddlSelectFlight.SelectedValue);
FillFlightPricesGrid();
}
protected void GridView1_RowUpdating(object sender,
GridViewUpdateEventArgs e)
{
string strEffectiveFrom =
((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtEffectiveFrom")).Text;
DateTime effectiveFrom = DateTime.Parse(strEffectiveFrom);
double basePrice =
Double.Parse(((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtBasePrice")
).Text);
double fuelprice =
Double.Parse(((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtFuel")).Tex
t);
double localEvent =
Double.Parse(((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtLocalEvent"
)).Text);
double competitorAdjustment =
Double.Parse(((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtCompetitorA
djustment")).Text);
double loadAdjustment =
Double.Parse(((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtLoadAdjustm
ent")).Text);
double misc =
Double.Parse(((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtMisc")).Tex
t);
selectedFlightID = Int32.Parse(ddlSelectFlight.SelectedValue);
FlightPriceManager flghtPriceMngr = new
FlightPriceManager(selectedFlightID, effectiveFrom
, basePrice, fuelprice, localEvent, competitorAdjustment,
loadAdjustment, misc);
flghtPriceMngr.Update(DateTime.Parse(GridView1.DataKeys[e.RowIndex].Value.ToS
tring()));
GridView1.EditIndex = -1;
FillFlightPricesGrid();
}
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Footer)
{
if (showFooter.Value == "N")

110

e.Row.Visible = false;
}
}
protected void btnAddNew_Click(object sender, EventArgs e)
{
showFooter.Value = "Y";
selectedFlightID = Int32.Parse(ddlSelectFlight.SelectedValue);
FillFlightPricesGrid();
}
protected void ddlSelectFlight_SelectedIndexChanged(object sender,
EventArgs e)
{
selectedFlightID = Int32.Parse(ddlSelectFlight.SelectedValue);
FillFlightPricesGrid();
}
protected void ddlSelectFlight_DataBound(object sender, EventArgs e)
{
selectedFlightID = Int32.Parse(ddlSelectFlight.SelectedValue);
FillFlightPricesGrid();
}
}
}

BookingManager.cs
using
using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Text;

using System.Security.Cryptography;
namespace FRS.BusinessLayer
{
public class BookingManager
{
public static string generateBoookingReference()
{
/*This code has been taken from following loation and then
modified according to my needs.
//code courtesy: http://ramanisandeep.wordpress.com/tag/generateunique-string-and-numbers-in-c/
*/
int maxSize = 6;
char[] chars = new char[62];
string a =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
chars = a.ToCharArray();
byte[] data = new byte[1];
RNGCryptoServiceProvider crypto = new
RNGCryptoServiceProvider();
crypto.GetNonZeroBytes(data) ;
data = new byte[maxSize];
crypto.GetNonZeroBytes(data);

111

StringBuilder result = new StringBuilder(maxSize) ;


foreach(byte b in data )
{
result.Append(chars[b % (chars.Length - 1)]);
}
return result.ToString().ToUpper();
}
}
}

FlightsBL.cs
using
using
using
using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Text;
System.Data;
FRS.DataLayer;

namespace FRS.BusinessLayer
{
public class FlightsBL
{
public List<FlightsData> getFlights(string origin, string
destination)
{
FlightsDL flghtDL = new FlightsDL();
DataTable flightsDT = flghtDL.getFlights(origin, destination);
if (flightsDT.Rows.Count > 0)
{
List<FlightsData> flightsLst = new List<FlightsData>();
for (int i = 0; i < flightsDT.Rows.Count; i++)
{
FlightsData flightDataRecord = new FlightsData();
//initialize the obbject before we insert into list
flightDataRecord.flightID =
flightsDT.Rows[i]["flight_id"].ToString();
flightDataRecord.flightCode =
flightsDT.Rows[i]["flightCode"].ToString();
flightDataRecord.weekday =
flightsDT.Rows[i]["weekday"].ToString();
flightDataRecord.effectiveFrom =
DateTime.Parse(flightsDT.Rows[i]["effective_from"].ToString());
flightDataRecord.effectiveTo =
DateTime.Parse(flightsDT.Rows[i]["effective_to"].ToString());
flightDataRecord.flightDuration =
DateTime.Parse(flightsDT.Rows[i]["Flight_Duration"].ToString());
flightDataRecord.flightMilleage =
flightsDT.Rows[i]["flightMilleage"].ToString();
flightDataRecord.departTime =
DateTime.Parse(flightsDT.Rows[i]["departTime"].ToString()); ;
flightDataRecord.arrivalTime =
DateTime.Parse(flightsDT.Rows[i]["arrivalTime"].ToString()); ;
flightsLst.Add(flightDataRecord);

112

}
return flightsLst;
}
else
return null;
}
public List<FlightPricesData> getFlightPrices(string origin, string
destination)
{
FlightsDL flghtDL = new FlightsDL();
DataTable flightPricesDT = flghtDL.getFlightPrices(origin,
destination);
if (flightPricesDT.Rows.Count > 0)
{
List<FlightPricesData> flightPricesLst = new
List<FlightPricesData>();
for (int i = 0; i < flightPricesDT.Rows.Count; i++)
{
FlightPricesData flightPriceRecord = new
FlightPricesData();
//initialize the obbject before we insert into list
flightPriceRecord.flight_id =
flightPricesDT.Rows[i]["flight_id"].ToString();
flightPriceRecord.FixedPrice = Double.Parse(
flightPricesDT.Rows[i]["FixedPrice"].ToString());
flightPriceRecord.effective_from =
DateTime.Parse(flightPricesDT.Rows[i]["effective_from"].ToString());
flightPriceRecord.effective_to =
DateTime.Parse(flightPricesDT.Rows[i]["effective_to"].ToString());
flightPricesLst.Add(flightPriceRecord);
}
return flightPricesLst;
}
else
return null;
}
}
}

PaymentBL.cs
using
using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Text;

using FRS.DataLayer.Objects;
using FRS.DataLayer;
namespace FRS.BusinessLayer
{
public class PaymentBL
{
SqlHelper paymentSQLHelper;

113

public PaymentBL()
{
paymentSQLHelper = new SqlHelper();
}
public void beginTransaction()
{
paymentSQLHelper.beginTransaction();
}
public void commitTransaction()
{
paymentSQLHelper.commitTransaction();
}
public void rollBackTransaction()
{
paymentSQLHelper.rollBackTransaction();
}
public int MakePayment(string BillingAddressLine1,string
BillingAddressLine2
,string BillingAddressLine3,string BillingAddressLine4,string
BillingCountryCode
,string CardHolderName,string CardNumber,int CardType,int
ExpiryMonth,string ExpiryYear
,string SecurityCode, double paymentAmount)
{
Payment newPayment = new Payment();
newPayment.BillingAddressLine1 = BillingAddressLine1;
newPayment.BillingAddressLine2=BillingAddressLine2;
newPayment.BillingAddressLine3=BillingAddressLine3;
newPayment.BillingAddressLine4=BillingAddressLine4;
newPayment.BillingCountryCode=BillingCountryCode;
newPayment.CardHolderName=CardHolderName;
newPayment.CardNumber=CardNumber ;
newPayment.CardType=CardType;
newPayment.ExpiryMonth=ExpiryMonth;
newPayment.ExpiryYear=ExpiryYear;
newPayment.SecurityCode=SecurityCode;
newPayment.PaymentAmount = paymentAmount;
return newPayment.Insert(paymentSQLHelper);
}
public void InsertFlightBooking(string flghtID, DateTime flghtDt,
string cabnCls, string bookref, int noOfPsngr,
int pymntID)
{
FlightBooking myFlightBooking = new FlightBooking(flghtID,
flghtDt, cabnCls, bookref, noOfPsngr,
pymntID);
myFlightBooking.insert(paymentSQLHelper);
}
public void InsertFlightPassengers(string outBndFlightID, bool
isOneWay, string inBndFlightID,
string bookingRef, PassengersBL
myPassengersBl)
{
for (int i = 0; i < myPassengersBl.NoOfPassengers; i++)

114

{
PassengerInfo passenger = myPassengersBl.PassengersList[i];
int passengerID = passenger.Insert(paymentSQLHelper);
FlightPassengers flghtPassenger = new
FlightPassengers(outBndFlightID,bookingRef,passengerID);
flghtPassenger.Insert(this.paymentSQLHelper);
if (!isOneWay)
{
FlightPassengers flghtPassenger1 = new
FlightPassengers(inBndFlightID, bookingRef, passengerID);
flghtPassenger1.Insert(this.paymentSQLHelper);
}
}
}
}
}

PricingManager.cs
using
using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Text;

namespace FRS.BusinessLayer
{
public class PricingManager
{
/*This class will be used to implement the pricing factors
that are further to what we already have in database.
For instance if company policy is to give 10% disc if the ticket it
being purchased
more than one month earlier than the flight time.*/
public double getFlightPrice(List<FlightPricesData> pricesList,
string flightID, DateTime flightDate, string origin, string dest, string
flightClass)
{
double priceQuote = 0.0;
foreach (FlightPricesData fpd in pricesList)
{
if (fpd.flight_id == flightID
&& flightDate >= fpd.effective_from
&& flightDate <= fpd.effective_to
)
{
/*This is the flight that is applicable out of the
list.*/
//get the fixed price first
priceQuote = fpd.FixedPrice;
/*Add the discount according to our findings through
analysis
Chart constructed in terms of weeks ahead (No of weeks
left in the flight date at the
* time of booking with a discount % on the base price
*Weeks ahead
Discount

115

*0
*1
*2
*3
*4
*5 or more
* */

0%
30%
35%
40%
50%
60%

TimeSpan ts = flightDate - DateTime.Now;


/*We will also do the day of the flight factor here*/
if (flightDate.DayOfWeek == DayOfWeek.Saturday
|| flightDate.DayOfWeek == DayOfWeek.Sunday)
//flight on a weekend
{
if (ts.Days < 4 * 7)
//less than 4 weeks or more
priceQuote *= 1.25; //25% increase
else if (ts.Days >= 4 * 7) //4 weeks or more
priceQuote *= 1.04;
//4% increase
}
if (ts.Days > 5 * 7)
//5 weeks or more
priceQuote *= 0.40;
else if (ts.Days > 4 * 7) //4 weeks or more
priceQuote *= 0.50;
else if (ts.Days > 3 * 7) //3 weeks or more
priceQuote *= 0.60;
else if (ts.Days > 2 * 7) //2 weeks or more
priceQuote *= 0.65;
else if (ts.Days > 1 * 7) //1 weeks or more
priceQuote *= 0.70;
//origin and dest specific discount if any
if (origin == "9" && dest == "11")
priceQuote -= 10.00; //further 10 discount for flight
from 9 to 11
if (flightClass == "Business")
priceQuote *= 1.5;
else if (flightClass == "First")
priceQuote *= 2;
break;
}
}
return priceQuote;
}
}
}

FlightsDL.cs
using System;
using System.Data;

116

namespace FRS.DataLayer
{
public class FlightsDL
{
public DataTable getFlights(string origin, string dest)
{
string query = "select a.flight_id"
+ " ,a.flightCode"
+ " ,a.flightTime [Flight_Duration]"
+ " ,a.flightMilleage"
+ " ,b.weekday"
+ " ,b.departTime"
+ " ,b.arrivalTime"
+ " ,b.effective_from"
+ " ,isnull("
+ " (select
max(effective_from)"
+ " from flight_schedule"
+ " where flight_id =
b.flight_id"
+ " and
effective_from> b.effective_from"
+ " )"
+ " ,
dateadd(month,12,b.effective_from)"
+ " )as effective_to"
+ " from flight a"
+ " join flight_schedule b"
+ " on a.flight_id=b.flight_id"
+ " where a.flight_origin="+origin
+ " and a.flight_destination="+dest;
return SqlHelper.ExecuteDataTable(query);
}
public DataTable getFlightPrices(string origin, string dest)
{
string query = "select a.flight_id"
+ ",a.effective_from"
+ ",isnull("
+ "(select
max(effective_from)"
+ " from flight_price"
+ " where flight_id =
a.flight_id"
+ " and
effective_from> a.effective_from"
+ ")"
+ ",
dateadd(month,12,a.effective_from)"
+ ") as effective_to "
+ ",baseprice"
+ "+fuel"
+ "+localEvent"
+ "+competitorAdjustment"
+ "+loadAdjustment"
+ "+misc as FixedPrice"
+ " from flight_price a"
+ " where a.flight_id in ("
+ "select flight_id"
+ " from flight"

117

+ " where "


+
"(flight_origin="+origin
+ " and
flight_destination="+dest
+
+
+
+

")"
" or"
"("
"

flight_origin="+dest
+ " and
flight_destination="+origin
+ ")"
+ ")";
return SqlHelper.ExecuteDataTable(query);
}
}
}

118

Das könnte Ihnen auch gefallen