Vous êtes sur la page 1sur 111

105

Acknowledgement
105
It is my privilege to express sincere gratitude to the faculty members of
COMPUTER APPLICATION department to allow us such an interesting project.
The satisfaction that accompanies that the successful completion of any task
would be incomplete without the mention of people whose ceaseless
cooperation made it possible, whose constant guidance and encouragement
crown all efforts with success.

I would like to specially thank Mr. Manas Paul (Departmental head of


computer application), Mr. Saurab Dutta (Lecturer M.C.A) for their immense
help to carry out this project work.

I sincerely convey our thanks to my project guide Mr. Firoz Mondal,


whose inspiration and constructive suggestions that helped us in the
preparation this project. I would also like to thank all of our teachers and all
my friends who helped me a lot to complete this project.

Contents
 Objective of the Project
------- 6
105
 Scope of the Project -------
7

 Software and Tools used in the Project


------- 8

Feasibility Study -------


9

 Technical Specifications
------10

 GANTT Chart
------17

 PERT Chart
------18
Cost Estimation
------19
 Design Phase
♦ ERD ------21
♦ Context Level DFD
------22
♦ 1 Level DFD
st

------23

105
♦ 2nd Level DFD
------24

Modules
------32
 Design and Coding
 Home Page
------35
 Registration Page
------40
 Search Flight Page
------42
 Passengers Page
------58
 Payment Page
------67
 Confirmation Page
------75
 Print Out of a Ticket
------79
 Employee Manager Page
------80
 Airport Manager Page
------85
 Flight Details Page
------90
 Flight Schedule Page
------95
 Passengers Details Page
------101
105
Database Tables
 Flight Details Table
------103
 Flight Schedule Table
------104
 Passengers Details Table
------105
 Seat Table ------106

 Future Scope
-----107

 Limitations
-----108

 Conclusion
-----109
 Bibliography
-----110

Objective of the Project

Online Airlines Booking & Management System is the web based


Airlines Booking & Management System, which is crafted using the
primitive three tier architecture .The employees/tourists / passengers /
members according to their preferences put their queries to the server
and gets answer of them. This software is specially designed to obtain
105
solution for the aviation customers in different geographical locales. It
gets connected to the main server through the internet and the data
remains continually updated. The system provides a quick and accurate
view of miscellaneous topics such as Flight enquiry, Ticket booking and
canceling. This system implements at initiation point of Flight Booking
system and its detail like seats category, places etc. It maintains every
step of booking of an air ticket, up-to-date flight information., some
effective searching and generates reports by which the employee and the
administrator can satisfy their queries and get correct information of
each and every situation and analyze the same. This system mainly deals
with dynamic fare calculation based on demand criteria and baseline
prices. This dynamic fare calculation process makes this system unique
and thus helps the existing Airlines Booking system and its operation.

Scope

This project is designed to help the employee for quick information


of Flight details like their date, timing and places. The attractive and
easy web interface of this system helps the passenger to get information
about flight. The system supports extensive help in searching the place-
105
wise flight details and their different ticket category and price listing and
discount if applicable. It also supports queries about the ticketing.
Unlike other airline systems, they require a system which mainly deals
with dynamic fare (DynaFare) calculation based on demand criteria and
baseline prices. This dynamic fare (DynaFare) calculation process made
this system unique and thus helping the presently airline system and its
operation. In short, it facilitates

 Displaying various information about flight with date, time


details.

 Customer can book the flight from the web, based on available
DynaFare price and type of class.

 At the time of flight booking number of seats are updated


automatically.

 Passengers put their queries about the flight and ticket from
anywhere in the world.

Tools/Platform/Hardware & Software

 Hardware Requirements:

 Server: Minimum Intel P4 processor, 1 GB RAM, 80 GB hard disk ,


500 Hz Motherboard, Mouse, Keyboard, Color monitor, CD drive,
modem, CD writer for backup device.

 Clients: Minimum Intel P3 processor, 512 MB RAM, 40 GB hard


disk, 300 Hz Motherboard, Mouse, Keyboard, Color monitor.
105
 Software Requirements:

 Server :
OS : Windows -2000/2003 Server/Linux/Unix
Database : SQL Server 2005
Web Server : IIS
Front End : Visual Studio 2005

 Clients :
OS : Windows 95/98/ME/NT/XP-Workstation/2000-desktop
Components: Internet Explorer 5.x and above, Mozilla

 Software Development Tools:


OS : Window XP Professional
Database : SQL Server 2005
Front End : Visual Studio 2005
Language : HTML, DHTML, CSS, ASP.Net (C#)
Web Server : IIS
Other Tools : Dreamweaver , Microsoft Project 2003

Feasibility Study
For the project “Online Airline Booking & Management System”, we collected
data from various sources. At first we visited the sites regarding the online airlines.
We then visited various sites to gather knowledge regarding the various flights
tickets such as the price and more importantly the availability of tickets at any time
of the day.

105
After collecting the above information, we started collecting the data about
the flights. The flights are then chosen as per their demand. We also searched
different websites and found out the discounts given to particular flights. After
gathering all the necessary materials for our project, we started to provide the
necessary codes.

Technical Feasibility:
This activity is often performed before the selling process actually starts, to
support the decision of whether a new development should be started. Its goal is to
provide a technical feasibility study document, which present different scenarios
and alternative solutions, along with a decision of the trade-offs in terms expected
costs and benefits. This feasibility study is often used to resolve the build-versus-
buy decision for an organization.

Economic Feasibility:
To perform the feasibility study, the software engineer must first analyze the
problem, at least at a global level. Indeed, the more the problem is understood, the
better alternative solution, their cost, and their potential benefit for the user can be
identified.

Operational Feasibility:
On the basis of the definition of the problem during the preliminary analysis,
software developer identify alternative solution for each suggested solution, cost
and delivery date are evaluated.

Technical Specifications

For developing this system we used ASP.Net as web platform and C# as the language. Database
used is Microsoft SQL server so that compatibility can be maintained. Being a web-based
application, a web server is used and that is IIS or Internet Information Services. .NET
framework (version 2.0) makes the application platform neutral. This means that that the
application can run on any Operating System if the same contains the framework. Java script is
also used to make several client side validations and to make the pages dynamic.

105
Advantages of .NET Frame Work

The .NET Framework offers a number of advantages to developers.

Consistent Programming Model - With .NET accessing data with a VB .NET and a C# .NET
looks very similar apart from slight syntactical differences. Both the programs need to import the
System. Data namespace, both the programs establish a connection with the database and both
the programs run a query and display the data on a data grid.

The .NET example explains that there's a unified means of accomplishing the same task by using
the .NET Class Library, a key component of the .NET Framework. The functionality that the
.NET Class Library provides is available to all .NET languages resulting in a consistent object
model regardless of the programming language the developer uses.

Direct Support for Security - When an application accesses data on a remote machine or has to
perform a privileged task on behalf of a non-privileged user, security issue becomes important as
the application is accessing data from a remote machine. With .NET, the Framework enables the
developer and the system administrator to specify method level security.

It uses industry-standard protocols such as TCP/IP, XML, SOAP and HTTP to facilitate
distributed application communications. This makes distributed computing more secure
because .NET developers cooperate with network security devices instead of working around
their security limitations.

Simplified Development Efforts - In Web applications, a developer with classic ASP needs to
present data from a database in a Web page. He has to write the application logic (code) and
presentation logic (design) in the same file. ASP.NET and the .NET Framework simplify
development by separating the application logic and presentation logic making it easier to
maintain the code.

The design code (presentation logic) and the actual code (application logic) is written separately
eliminating the need to mix HTML code with ASP code. ASP.NET can also handle the details of
maintaining the state of the controls, such as contents in a textbox, between calls to the same
ASP.NET page. Another advantage of creating applications is debugging.

The .NET Framework simplifies debugging with support for Runtime diagnostics. Runtime
diagnostics helps you to track down bugs and also helps you to determine how well an
application performs. The .NET Framework provides three types of Runtime diagnostics: Event
Logging, Performance Counters and Tracing.

105
Easy Application Deployment and Maintenance - The .NET Framework makes it easy to deploy
applications. In the most common form, to install an application, all you need to do is copy the
application along with the components it requires into a directory on the target computer. The
.NET Framework handles the details of locating and loading the components an application
needs, even if several versions of the same application exist on the target computer.

.NET Architecture

Common Language Infrastructure (CLI): The most important component of the .NET
Framework lies in the Common Language Infrastructure, or CLI. The purpose of the CLI is to
provide a language-agnostic platform for application development and execution, including, but
not limited to, components for exception handling, garbage collection, security, and
interoperability. Microsoft's implementation of the CLI is called the Common Language
Runtime, or CLR. The CLR is composed of four primary parts:

• Common Type System (CTS)


• Common Language Specification (CLS)
• Just-in-Time Compiler (JIT)
• Virtual Execution System (VES)

105
Assemblies: The intermediate MSIL code is housed in .NET assemblies, which for the Windows
implementation means a Portable Executable (PE) file (EXE or DLL). Assemblies are the .NET
unit of deployment, versioning and security. The assembly consists of one or more files, but one
of these must contain the manifest, which has the metadata for the assembly.

The complete name of an assembly contains its simple text name, version number, culture and
public key token; it must contain the name, but the others are optional. The public key token is
generated when the assembly is created, and is a value that uniquely represents the name and
contents of all the assembly files, and a private key known only to the creator of the assembly.

Two assemblies with the same public key token are guaranteed to be identical. If an assembly is
tampered with (for example, by hackers), the public key can be used to detect the tampering.
Metadata: All CIL is self-describing through .NET metadata.

The CLR checks on metadata to ensure that the correct method is called. Metadata is usually
generated by language compilers but developers can create their own metadata through custom
attributes. Meta data also contain the all information about assembly.

Base Class Library (BCL): The Base Class Library (BCL), sometimes incorrectly referred to as
the Framework Class Library (FCL) (which is a superset including the Microsoft.* namespaces),
is a library of classes available to all languages using the .NET Framework.

The BCL provides classes which encapsulate a number of common functions such as file reading
and writing, graphic rendering, database interaction, XML document manipulation, and so forth.
The BCL is much larger than other libraries, but has much more functionality in one pack.

Programming Language

C# is used as the programming language to develop this application. C# is a happy medium


between full-blown C++ and something overly simplistic like VB. But "advantage" is a very
subjective term. For instance, one person might consider it an advantage that C# runs in a
managed environment. One doesn’t have to worry about memory management and pointers like
you do in C++.

Most of C#'s advantages aren't really due to C#, but due to its complete dependency on the .NET
framework. .NET makes it so much easier to do things like writing Windows forms and dialogs,
making multi-threaded applications, working with strings.

105
There are two things nice about C# not having to do with managed code: (1.) No header files.
You write a .cs file and that's the end of it; (2.) The keyword "partial". One can declare a class as
"partial". This allows you to split up what would be a very lengthy source file into multiple files.
The keyword "partial" indicates to the compiler that you do intend to declare the same class in
more than one file, and then merges them into a single class at compile time. Other advantages
of C# are as follows:

• It is compiled to an intermediate language (CIL) irrespective of the language


it was developed or the target architecture and operating system
• Automatic garbage collection
• Pointers no longer needed (but optional)
• Definition of classes and functions can be done in any order
• Declaration of functions and classes not needed
• Classes can be defined within classes
• There are no global functions or variables, everything belongs to a class
• All the variables are initialized to their default values before being used (this
is automatic by default but can be done manually using static constructors)
• You can't use non-Boolean variables (integers, floats...) as conditions. This is
much more clean and less error prone
• Usually it is much more efficient than java and runs faster
• CIL (Common (.NET) Intermediate Language) is a standard language, while
java byte codes aren't
• It has more primitive types (value types), including unsigned numeric types
• Indexers let you access objects as if they were arrays
• Conditional compilation
• Simplified multithreading

Web Application Framework

Web application framework is used in Microsoft ASP.Net (Active Server Page). The .NET
Framework was introduced with a vision to create globally distributed software with Internet
functionality and interoperability. The .NET Framework consists of many class libraries,
includes multiple language support and a common execution platform. Its a very flexible
foundation on which many different types of top class applications can be developed that do
different things. Developing Internet applications with the .NET Framework is very easy.
ASP.NET is built into this framework. We can create ASP.NET applications using any of the
built-in languages.

Unlike ASP, ASP.NET uses the Common Language Runtime (CLR) provided by the .NET
Framework. This CLR manages execution of the code we write. ASP.NET code is a compiled
CLR code instead of interpreted code (ASP). CLR also allows objects written in different
languages to interact with each other. The CLR makes development of Web applications simple.
ASP.Net has the following advantages.

105
• ASP.NET drastically reduces the amount of code required to build large
applications
• ASP.NET makes development simpler and easier to maintain with an event-
driven, server-side programming model
• ASP.NET pages are easy to write and maintain because the source code and
HTML are together
• The source code is executed on the server. The pages have lots of power and
flexibility by this approach
• The source code is compiled the first time the page is requested. Execution is
fast as the Web Server compiles the page the first time it is requested. The
server saves the compiled version of the page for use next time the page is
requested
• The HTML produced by the ASP.NET page is sent back to the browser. The
application source code you write is not sent and is not easily stolen
• ASP.NET makes for easy deployment. There is no need to register
components because the configuration information is built-in
• The Web server continuously monitors the pages, components and
applications running on it. If it notifies memory leaks, infinite loops, other
illegal software or activities, it seamlessly kills those activities and restarts
itself
• ASP.NET validates information (validation controls) entered by the user
without writing a single line of code
• ASP.NET easily works with ADO .NET using data-binding and page formatting
features
• ASP.NET applications run faster and counters large volumes of users without
performance problems

Markup Language

Markup language used for the application is HTML (Hyper Text Markup Language). HTML has
grown in popularity substantially but has yet made the final leap. Although HTML has some
problems being viewed in Internet Explorer, it is still of great use and is very powerful.

Scripting Language

Java script is used for making several client side validations and also to make the pages dynamic.
JavaScript has several advantages like cross-browser support, validating data on the client, and
being able to create more sophisticated user interfaces.

JavaScript effects are also much faster to download than some other front-end technologies like
Flash and Java applets. In fact, unless you're writing a massive JavaScript application, it's quite

105
likely that no significant extra download time will be added to a page by using JavaScript on it.
Nor do users need to download a plug-in before they can view your JavaScript, as they would
with Flash. For example, they simply need a browser that supports it – and, of course, most
modern browsers do.

Other advantages include the fact that you don't need any extra tools to write JavaScript, any
plain text or HTML editor will do, so there's no expensive development software to buy. It's also
an easy language to learn, and there's a thriving and supportive online community of JavaScript
developers and information resources.

Database

Database used in this application is Microsoft SQL Server. To keep compatibility with the front-
end technology (Microsoft Dot Net) and also to keep the project economically feasible, SQL
server is used. SQL server is used as the database because of the following advantages.

• Increased performance.

• It is simpler and easier to deploy, manage, and optimize enterprise data and
analytical applications.

• Failure of the primary system, applications can immediately reconnect to the


database on the secondary server using Database Mirroring.

Why Microsoft Visual Studio 2005 is used?


Microsoft Visual Studio 2005 is used to develop the system so that individual
developers and small development teams accelerate application
development, deliver breakthrough user experiences, and collaborate more
effectively. Apart from these Visual Studio 2008 has the following other
advantages

105
1>Handle Data More Productively
2>Write Less Code
3>Program in Multiple Languages
4>Manage Project Files and Jump-Start New Projects
5>Target Multiple Versions of the .NET Framework
6>Build Higher-Quality Applications
7>Deliver Rich User Experiences
8>Build Connected Solutions and Streamline Business Processes
9>Collaborate with UI Designers
10>Build Specialized Software
11>Test Driven Development is Possible

Why SQL server is used?


SQL server is used as the database because of the following advantages.

1>Increased performance

2> It simpler and easier to deploy, manage, and optimize enterprise data and analytical
applications.
3> Failure of the primary system, applications can immediately reconnect to
the database on the secondary server using Database Mirroring.

Gnatt Chart

105
Pert Chart

105
Cost Estimation

SYSTEM START-UP COSTS

105
Development
System Analysis Phase (10 Days) Rs. 1,415.00
System Requirements and Specifications
(7 Days) Rs. 990.00
Design Phase (35 Days) Rs. 4,952.00
Coding Phase (49 Days) Rs. 6,934.00
Testing Phase (14 Days) Rs. 1,981.00
Documentation Phase (7 Days) Rs. 990.00

Installations
Training Rs. 2,500.00
------------------------------------------------------------------------
Total start-up costs Rs. 18,347.00

Design Phase

105
• Data Flow Diagram: A data-flow diagram (DFD)
is a graphical representation of the "flow" of data through an
information system. DFDs can also be used for the
visualization of data processing (structured design).
On a DFD, data items flow from an external data source
or an internal data store to an internal data store or an
external data sink, via an internal process.

A DFD provides no information about the timing of


processes, or about whether processes will operate in
sequence or in parallel. It is therefore quite different from a
flowchart, which shows the flow of control through an
algorithm, allowing a reader to determine what operations
will be performed, in what order, and under what
circumstances, but not what kinds of data will be input to
and output from the system, nor where the data will come
from and go to, nor where the data will be stored (all of
which are shown on a DFD).

• E-R Diagram: An entity-relationship (ER) diagram is a


specialized graphic that illustrates the interrelationships
between entities in a database. ER diagrams often use
symbols to represent three different types of information.
Boxes are commonly used to represent entities. Diamonds
are normally used to represent relationships and ovals are
used to represent attributes.

ERD
105
Via F_arr_ti
Fnam me
e F_dept_ti city A_nam
Flight me
e
Flight state
no
Sourc
e
iata
F_da 1
ys Destinati M Airport
on

ETotalse
da
at EVacants tim
te
Flight eat BTotalse e
no Landi
at
ng &
has BVacant Depar
seat ting
on
Fstat
F_arr_ti
us Designat
me
ion
Se Emp
Fsn
M F_dept_ti x id
o M
M me
Maintainc Employee
Flight Schedule 1 e
1 Datear
Bpric r Ag
Reser Dated
e e Departm
ved Eprice
by ept Na ent
me
pS pAddr
ex ess
Stat M Pi
1
us by d Purc
hase Passenger
Ticket Booking 1
ticket

pA
Pi
1 ge
Fsn d pNa pPhone
Pr o me no
n Pri
Clas ce cn Dateofcancell
s Returnedm
o ation
Bookingd oney
ate
Booki
ng Ticket
Cance
lled
0 Level DFD 1 Cancellation

105
FLIGHT

Flight
information Request for
Flight status Report
Online
Query Ticket booking
Airlines information
Give answer Booking & Give
Book Manageme Query
flight nt System
PASSENGER Flight AIRLINES EMPLOYEE
Send
Confirmation
Report

1st Level DFD


1 Retrieve
Give Employee id & LOG IN Data EMPLOYEE
Password PROCESS Update Data
Give Access to MASTER
PASSENGER
Service MASTER
105
Create Master Update Data
Module 2 AIRPORT MASTER
MASTER Update Data
MODUL FLIGHTT MASTER
E
Creation Completion

Retrieve Data
AIRLINES
EMPLOYEE 3
FLIGHT
SCHEDUL Update Data
Flight Schedule FLIGHT SCHEDULE
E
Instruction
Flight Schedule
report Booking Ticket Retrieve Data
PASSENGE 4
Payment for Update Data
R Ticket TICKET PASSENGER
BOOKING Update Data TICKET
FLIGHT
Confirm Ticket & FAIR
PAYMEN
T Update Data
Apply for Cancellation
Confirm Cancellation Update Data
5
TICKET
TICKET
CANCELLA CANCELLATION
TION Retrieve Data

Takeoff 6 FLIGHT STATUS


FLIGHT Update Data
Landing TAKEOFF &
LANDING
Retrieve Data

7 Retrieve Data
BOARDING CARD
Send Report REPORT Retrieve Data
GENERATI PASSENGER
Submit Request ON Retrieve Data TICKET
TICKET
CANCELLATION

2nd Level DFD

1. LOGIN PROCESS

105
1.1
RECEIVING
Give Employee id, EMPLOYEE
ID,
PASSWOR USER MASTER
D

EMPLOYEE Retrieve user name


&
1.2
Send Message VERIFYING
Password
&
SENDING
MESSAGE

2. MASTER MODULE

Enter data for


master
module

2.1
RECEIVE
EMPLOYEE
DATA

105
2.2

VERIFICATIO
N OF DATA

Send update Update Data


EMPLOYEE
Information 2.3 MASTER
Update Data
UPDATE
INFORMATI AIRPORT MASTER
ON
FLIGHT MASTER
Update Data

3. FLIGHT SCHEDULING

3.1
FLIGHT EMPLOYEE
RETRIEVE Retrieve
FLIGHT FLIGHT MASTER
INFORMATI
ON

Display
Informatio
n
3.2

RETRIEVE
AIRPORT 105

INFORMATIO
N
Retrieve
AIRPORT MASTER

Display
Informatio
n

3.3
RECEIVING FLIGHT
Enter flight & SCHEDUL
schedule VERIFICATIO
N OF DATA
details

3.4
Send Update
UPDATE Data
INFORMATIO
N

4. TICKET BOOKING & PAYMENT

PASSENGER
Give

4.1
RECEIVE
BOOKING
FORM

4.2 Retrieve
VERIFICATI FLIGHT SCHEDULE
Data
ON
& 105
VALIDATIO
N
Retrieve
FLIGHT FAIR

Update PASSENGER MASTER


Data
4.3 Update
TICKET PASSENGER
Data TICKET
Booking BOOKING
Confirmatio PROCESS
n

Pay for ticket Update


4.4
PAYMENT
COLLECTIO
N Update
Data

Send ticket for 4.5


flight SEND
TICKET

5. TICKET CANCELLATION

PASSENGE
R 5.1

RECEIVE
Submit Form TICKET
CANCELLATIO
N FORM

105
PASSENGER
TICKET

5.2 Retrieve

VERIFICATIO
N
& Retrieve
VALIDATION
FLIGHT FAIR

Update
Cancellation Data

Confirmation 5.3

TICKET Update
CANCELLATIO Data
N TICKET
PROCESS CANCELLATION

6. SEAT ALLOCATION

PASSENGER AIRLINES EMPLOYEE

6.1
RECEIVE
TICKET
Submit Ticket

6.2 Verified

105
VERIFICATIO
N
OF TICKET
FLIGHT SCHEDULE
Retrieve
6.3 Data
GET
Retrieve
FLIGHT PASSENGER TICKET
Data
DETAILS

6.4
Retrieve
SEAT
Request for SCHEDULE
Choisable Seat GET CHOICE

OF SEAT FROM

AIRLINES
EMPLOYEES

7. FLIGHT TAKEOFF & LANDING

FLIGHT
7.1

RECEIVE
TAKEOFF
INFORMATIO
Takeoff
N
Information

7.2 Retrieve
FLIGHT
Data
SCHEDULE

VERIFICATIO
N

OF DATA
105
7.3 Update
UPDATE Data FLIGHT STATUS
DATA

Landing 7.4
Information
RECEIVE
LANDING
INFORMATI
ON

Retrieve FLIGHT
7.5
SCHEDULE

VERIFICATI
ON

OF DATA

7.6 Update FLIGHT STATUS


UPDATE Data
DATA

8. REPORT GENERATION MODULE

Submit Request
AIRLINES
EMPLOYEE 8.1

RECEIVING
REQUEST

Retrieve
Data
Flight Schedule
105

Give Answer
8.2 Retrieve Data
Flight Status
REPORT Retrieve Data
GENERATIO
N Passenger Ticket

Module Description
New User Registration Process:
This process implements the new user registration mechanism. A
new user i.e. customer, passenger, employee gets registered with
the system after verifying their supplied data. A new user comes
up with various privileges in terms of access rights according to
the type of the user. The process is the entry point for the

105
customer for booking ticket etc. The employees/administrators
have to be registered first and then the system can be operated
after logging in.

Login Process:
This process implements accession Online Airlines Booking & Management
System. To access this system customer/employees/administrator should enter
his/her unique login-id and password. It is then validated with the existing user list
and specific set of privilege pages are updated in the access page based on the type
of the user. It directs to the new user registration process if the user is not listed.

Master Table Management Process:

This process handles the entry of a master database which builds


the information of aircraft details, employee, airport details, and
flight details. Aviation related master tables get updated through
this module.

Ticket Booking Process:


This module is also responsible for ticket booking and also payment for ticket by
the passenger/ customer. The customer submits a filled up web form mentioning
his/her flight details to book a ticket. He/she will get ticket and status after
payment. After booking the ticket, seats are allocated in the flight availability list.
From the web, one can view the booked ticket, and take the print out as a
confirmed ticket after payment.

Flight Scheduling Process:

105
This process helps in scheduling the flight from various
geographical locations considering about country, airport, other
environment details and local time. Experts will schedule the
flight and all these are update in flight schedule table for future
reference. It maintains arrival and departure time and the specific
day in a week.

Ticket Pricing:
This is the most powerful & important critical module. This module calculates
ticket pricing based on dynamic fare criteria (DynaFare). To calculate a dynafare
a baseline fare is taken into the account and is based on the demand of the ticket
i.e. the price of tickets increases depending upon certain factors, which again
depend on other details like time of departure.

Ticket Cancellation:

To cancel a ticket a person has to fill up the ticket cancellation web form. Here the
customer has to fill up the flight and booking information. After canceling the
ticket one seat shall be increased upon the total number of tickets and be updated
accordingly. In this case money shall be refunded after deducting a certain
amount from the ticket price.

Seat allocation Process:

This boarding card is issued from the airport. After checking ticket
and luggage a passenger will receive his/her boarding card. If the
weight of the luggage is greater than the mentioned weight of the

105
luggage according to the mentioned class in the ticket, then the
passenger shall have to pay for that extra luggage to the flight
employee. The customer says what he/she wants to have in
lunch. This information is kept in the boarding table.

Flight Takeoff & Landing Process:


This module is used to record fight takeoff and landing. The take-
off and landing details are maintained with the exact time and are
preserved in the flight status table.

Report Generation Process:

This is a report generation module. When the administrator,


employees want to know any information then he/she has to put
the request to the system. According to the request, system will
generate reports using various tables. Administrators &
employees can get valuable information from these reports and
accordingly can take fruitful decision in time.

Design & Coding

105
Home Page

Code for Home Page


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

105
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Globalization;
using Telerik.Web.UI;
using System.Data.SqlClient;

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


{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["AirlineConnectionString"
].ToString());
SqlCommand com = new SqlCommand();
DataSet ds = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
bind();
RadDatePicker1.SelectedDate = DateTime.Today;
RadDatePicker1.MinDate = DateTime.Today;
RadDatePicker2.SelectedDate =
(DateTime)RadDatePicker1.SelectedDate;
RadDatePicker2.MinDate = (DateTime)RadDatePicker1.SelectedDate;
DropDownList1.SelectedIndex = 13;
DropDownList2.SelectedIndex =2;
}
}
public void bind()
{
com = new SqlCommand("select distinct src from flight_schedule", con);
con.Open();
SqlDataReader reader1=com.ExecuteReader();
while(reader1.Read())
{
this.DropDownList1.Items.Add(reader1["src"].ToString());
this.DropDownList2.Items.Add(reader1["src"].ToString());
}
}

protected void RadioButtonList1_SelectedIndexChanged(object sender,


EventArgs e)
{
if (RadioButtonList1.SelectedIndex == 0)
{
this.Label1.Visible = false;
this.RadDatePicker2.Visible = false;
}
else
{
this.Label1.Visible = true;
this.RadDatePicker2.Visible = true;
}
}

105
protected void RadDatePicker1_SelectedDateChanged1(object sender,
Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
{
RadDatePicker2.MinDate = (DateTime)RadDatePicker1.SelectedDate;
}
protected void Button1_Click(object sender, EventArgs e)
{
string day1 =
this.RadDatePicker1.SelectedDate.Value.DayOfWeek.ToString();
string day2 =
this.RadDatePicker2.SelectedDate.Value.DayOfWeek.ToString();
int dday=0;
int rday=0;
if (day1 == "Monday")
{
dday = 1;
}
if(day1 == "Tuesday")
{
dday = 2;
}
if (day1 == "Wednesday")
{
dday = 3;
}
if (day1 == "Thursday")
{
dday = 4;
}
if (day1 == "Friday")
{
dday = 5;
}
if (day1 == "Saturday")
{
dday = 6;
}
if (day1 == "Sunday")
{
dday = 7;
}
if (day2 == "Monday")
{
rday = 1;
}
if (day2 == "Tuesday")
{
rday = 2;
}
if (day2 == "Wednesday")
{
rday = 3;
}
if (day2 == "Thursday")
{
rday = 4;

105
}
if (day2 == "Friday")
{
rday = 5;
}
if (day2 == "Saturday")
{
rday = 6;
}
if (day2 == "Sunday")
{
rday = 7;
}
HttpCookie val1 = new HttpCookie("from");
val1.Value = this.DropDownList1.Text;
Response.Cookies.Add(val1);
HttpCookie val2 = new HttpCookie("to");
val2.Value = this.DropDownList2.Text;
Response.Cookies.Add(val2);
HttpCookie val3 = new HttpCookie("dd");
val3.Value
=this.RadDatePicker1.SelectedDate.Value.ToShortDateString();
Response.Cookies.Add(val3);
HttpCookie val4 = new HttpCookie("rd");
val4.Value =
this.RadDatePicker2.SelectedDate.Value.ToShortDateString();
Response.Cookies.Add(val4);
HttpCookie val5 = new HttpCookie("trip");
val5.Value = this.RadioButtonList1.SelectedIndex.ToString();
Response.Cookies.Add(val5);
HttpCookie val6 = new HttpCookie("adult");
val6.Value = this.DropDownList3.SelectedValue;
Response.Cookies.Add(val6);
HttpCookie val7 = new HttpCookie("child");
val7.Value = this.DropDownList4.SelectedValue;
Response.Cookies.Add(val7);
HttpCookie val8 = new HttpCookie("infant");
val8.Value = this.DropDownList5.SelectedValue;
Response.Cookies.Add(val8);
HttpCookie val9 = new HttpCookie("ddw");
val9.Value = dday.ToString();
Response.Cookies.Add(val9);
HttpCookie val10 = new HttpCookie("rdw");
val10.Value = rday.ToString();
Response.Cookies.Add(val10);
Response.Redirect("searchresult.aspx");
}
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs
e)
{
if (DropDownList2.Text == DropDownList1.Text)
{
Response.Write("<script> alert('Please select right
destination')</script>");
DropDownList2.SelectedIndex = 2;
}
}

105
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs
e)
{
if (DropDownList2.Text == DropDownList1.Text)
{
Response.Write("<script> alert('Please select right
origin')</script>");
DropDownList1.SelectedIndex = 13;
}
}
}

Registration Form

105
Code for Registration Page

using System;
using System.Collections;

105
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;

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


{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["AirlineConnectionString"
].ToString());
SqlCommand com = new SqlCommand();
DataSet ds = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
com = new SqlCommand("insert into
users(fname,lname,sex,dob,address,pin,state,country,mobile,email,user_id,pswd
,alert)values('" + this.TextBox1.Text + "','" + this.TextBox2.Text + "','" +
this.DropDownList1.Text + "','" + this.TextBox12.Text + "','" +
this.TextBox3.Text + "','" + this.TextBox8.Text + "','" + this.TextBox4.Text
+ "','" + this.TextBox5.Text + "','" + this.TextBox6.Text + "','" +
this.TextBox7.Text + "','" + this.TextBox9.Text + "','" + this.TextBox10.Text
+ "','" + this.CheckBox1.Checked.ToString() + "')", con);
con.Open();
com.ExecuteNonQuery();
con.Close();
Response.Redirect("home.aspx");

protected void Button2_Click(object sender, EventArgs e)


{
Response.Redirect("home.aspx");
}
}

Search Flight Page

105
Code For Search Flight Page
using System;
using System.Data;
using System.Configuration;

105
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["AirlineConnectionString"
].ToString());
SqlCommand com = new SqlCommand();
SqlDataAdapter da;
DataSet ds = new DataSet();
static string ff = null;
static string ft = null;
static string fdd = null;
static string frd = null;
static int ftrip = 0;
static int ad = 0;
static int cd = 0;
static int inf = 0;
static int infa = 0;
static int tax = 0;
static int psf = 229;
static int udf = 260;
static int ti = 149;
static int i3 = 0;
static int i4 = 0;
static string f1 = null;
static string f2 = null;
static string dclass = null;
static string rclass = null;
static string dwd = null;
static string dwr = null;
public void bind()
{
ff = Request.Cookies["from"].Value.ToString();
ft = Request.Cookies["to"].Value.ToString();
fdd = Request.Cookies["dd"].Value.ToString();
frd = Request.Cookies["rd"].Value.ToString();
ad = Convert.ToInt32(Request.Cookies["adult"].Value);
cd = Convert.ToInt32(Request.Cookies["child"].Value);
inf = Convert.ToInt32(Request.Cookies["infant"].Value);
ftrip = Convert.ToInt32(Request.Cookies["trip"].Value);
dwd = Request.Cookies["ddw"].Value.ToString();
dwr = Request.Cookies["rdw"].Value.ToString();
da = new SqlDataAdapter("select
flight_schedule.f_no,flight_schedule.f_dept_time,flight_schedule.src,flight_s
chedule.f_arr_time,flight_schedule.dest,flight_fare.e_fare,flight_fare.b_fare
,flight_fare.f_fare from flight_fare INNER JOIN flight_schedule ON
flight_fare.f_sl_no = flight_schedule.f_sl_no where flight_schedule.src ='" +
ff + "' and flight_schedule.dest='" + ft + "' and (flight_schedule.days like
'%" + dwd + "%' or flight_schedule.days like '%Daily%') ", con);

105
da.Fill(ds, "tt");
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
ds.Clear();
int eco = 1;
int bus = 1;
int fc = 1;
da = new SqlDataAdapter("select
flight_schedule.f_sl_no,flight_schedule.f_dept_time,flight_schedule.src,fligh
t_schedule.f_arr_time,flight_schedule.dest,flight_fare.e_fare,flight_fare.b_f
are,flight_fare.f_fare from flight_fare INNER JOIN flight_schedule ON
flight_fare.f_sl_no = flight_schedule.f_sl_no where flight_schedule.src ='" +
ff + "' and flight_schedule.dest='" + ft + "' and (flight_schedule.days like
'%" + dwd + "%' or flight_schedule.days like '%Daily%') ", con);
da.Fill(ds, "tt");
for(int i = 0; i <= GridView1.Rows.Count - 1; i++)
{
GridViewRow roww = this.GridView1.Rows[i];
try
{
string str = ds.Tables["tt"].Rows[roww.DataItemIndex]
["f_sl_no"].ToString();
com = new SqlCommand("select * from seat where f_sl_no='" +
str + "' and date='" + fdd + "'", con);
con.Open();
SqlDataReader reader = com.ExecuteReader();
while (reader.Read())
{
eco = Convert.ToInt32(reader["b_e_seat"].ToString());
bus = Convert.ToInt32(reader["b_b_seat"].ToString());
fc = Convert.ToInt32(reader["b_f_seat"].ToString());
}
if (eco == 0)
{
this.GridView1.Rows[i].Cells[3].Enabled = false;
this.GridView1.Rows[i].Cells[3].Text = "N/A";
}
if (bus == 0)
{
this.GridView1.Rows[i].Cells[4].Enabled = false;
this.GridView1.Rows[i].Cells[4].Text = "N/A";
}
if (fc == 0)
{
this.GridView1.Rows[i].Cells[5].Enabled = false;
this.GridView1.Rows[i].Cells[5].Text = "N/A";
}
con.Close();
}
catch
{
Response.Write("Hi");
con.Close();
}
}
if (ftrip == 1)
{

105
Label14.Text = ft + " to " + ff + " on " + frd;
ds.Clear();
da = new SqlDataAdapter("select
flight_schedule.f_no,flight_schedule.f_dept_time,flight_schedule.src,flight_s
chedule.f_arr_time,flight_schedule.dest,flight_fare.e_fare,flight_fare.b_fare
,flight_fare.f_fare from flight_fare INNER JOIN flight_schedule ON
flight_fare.f_sl_no = flight_schedule.f_sl_no where flight_schedule.src ='" +
ft + "' and flight_schedule.dest='" + ff + "' and (flight_schedule.days like
'%" + dwr+ "%' or flight_schedule.days like '%Daily%') ", con);
da.Fill(ds, "tt");
this.GridView2.DataSource = ds;
this.GridView2.DataBind();
ds.Clear();
da = new SqlDataAdapter("select
flight_schedule.f_sl_no,flight_schedule.f_dept_time,flight_schedule.src,fligh
t_schedule.f_arr_time,flight_schedule.dest,flight_fare.e_fare,flight_fare.b_f
are,flight_fare.f_fare from flight_fare INNER JOIN flight_schedule ON
flight_fare.f_sl_no = flight_schedule.f_sl_no where flight_schedule.src ='" +
ft + "' and flight_schedule.dest='" + ff + "' and (flight_schedule.days like
'%" + dwr + "%' or flight_schedule.days like '%Daily%') ", con);
da.Fill(ds, "tt");
for (int i = 0; i <= GridView2.Rows.Count - 1; i++)
{
GridViewRow roww = this.GridView2.Rows[i];
try
{
string str = ds.Tables["tt"].Rows[roww.DataItemIndex]
["f_sl_no"].ToString();
com = new SqlCommand("select * from seat where f_sl_no='"
+ str + "' and date='" + frd + "'", con);
con.Open();
SqlDataReader reader = com.ExecuteReader();
while (reader.Read())
{
eco = Convert.ToInt32(reader["b_e_seat"].ToString());
bus = Convert.ToInt32(reader["b_b_seat"].ToString());
fc = Convert.ToInt32(reader["b_f_seat"].ToString());
}
if (eco == 0)
{
this.GridView2.Rows[i].Cells[3].Enabled = false;
this.GridView2.Rows[i].Cells[3].Text = "N/A";
}
if (bus == 0)
{
this.GridView2.Rows[i].Cells[4].Enabled = false;
this.GridView2.Rows[i].Cells[4].Text = "N/A";
}
if (fc == 0)
{
this.GridView2.Rows[i].Cells[5].Enabled = false;
this.GridView2.Rows[i].Cells[5].Text = "N/A";
}
con.Close();
}
catch
{

105
Response.Write("Hi");
con.Close();
}
}
}
else
{
Image3.Visible = false;
Label14.Visible = false;
Label41.Visible = false;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack == false)
{
bind();
Label12.Text = ff+" to "+ft+" on "+fdd ;
Label31.Text =" @ "+ psf.ToString();
Label32.Text = " @ " + udf.ToString();
PlaceHolder1.Visible = false;
dclass = null;
rclass = null;
if (ftrip == 1)
{
Label22.Text = tax.ToString();
int p =2* (ad + cd + inf) * psf;
Label23.Text = p.ToString();
int u = (ad + cd) * udf;
Label24.Text = u.ToString();
if (RadioButtonList1.SelectedIndex == 0)
{
int i = 2*(ad + cd + inf) * ti;
Label25.Text = i.ToString();
}
}
else
{
Label22.Text = tax.ToString();
int p = (ad + cd + inf) * psf;
Label23.Text = p.ToString();
int u = (ad + cd) * udf;
Label24.Text = u.ToString();
if (RadioButtonList1.SelectedIndex == 0)
{
int i = (ad + cd + inf) * ti;
Label25.Text = i.ToString();
}
}
i3 = 0;
i4 = 0;
}
}
protected void RadioButtonList1_SelectedIndexChanged(object sender,
EventArgs e)
{
if (RadioButtonList1.SelectedIndex == 0)

105
{
if (ftrip == 1)
{
int i = 2*(ad + cd + inf) * ti;
Label25.Text = i.ToString();
Label25.Visible = true;
Label27.Visible = true;
int total = Convert.ToInt32(Label17.Text) +
Convert.ToInt32(Label19.Text) + Convert.ToInt32(Label21.Text) +
Convert.ToInt32(Label22.Text) + Convert.ToInt32(Label23.Text) +
Convert.ToInt32(Label24.Text) + Convert.ToInt32(Label25.Text);
Label26.Text = total.ToString();
}
else
{
int i = (ad + cd + inf) * ti;
Label25.Text = i.ToString();
Label25.Visible = true;
Label27.Visible = true;
int total = Convert.ToInt32(Label17.Text) +
Convert.ToInt32(Label19.Text) + Convert.ToInt32(Label21.Text) +
Convert.ToInt32(Label22.Text) + Convert.ToInt32(Label23.Text) +
Convert.ToInt32(Label24.Text) + Convert.ToInt32(Label25.Text);
Label26.Text = total.ToString();
}
}
else
{
int w = 0;
Label25.Text = w.ToString();
Label25.Visible = false;
Label27.Visible = false;
int total = Convert.ToInt32(Label17.Text) +
Convert.ToInt32(Label19.Text) + Convert.ToInt32(Label21.Text) +
Convert.ToInt32(Label22.Text) + Convert.ToInt32(Label23.Text) +
Convert.ToInt32(Label24.Text) + Convert.ToInt32(Label25.Text);
Label26.Text = total.ToString();
}
}
protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
{
foreach (GridViewRow oldrow in GridView2.Rows)
{
((RadioButton)oldrow.FindControl("RadioButton1")).Checked = false;
((RadioButton)oldrow.FindControl("RadioButton2")).Checked = false;
((RadioButton)oldrow.FindControl("RadioButton3")).Checked = false;
}
RadioButton rb = (RadioButton)sender;
GridViewRow row = (GridViewRow)rb.NamingContainer;
((RadioButton)row.FindControl("RadioButton1")).Checked = true;
da = new SqlDataAdapter("select
flight_schedule.f_sl_no,flight_schedule.f_dept_time,flight_schedule.src,fligh
t_schedule.f_arr_time,flight_schedule.dest,flight_fare.e_fare,flight_fare.b_f
are,flight_fare.f_fare from flight_fare INNER JOIN flight_schedule ON
flight_fare.f_sl_no = flight_schedule.f_sl_no where flight_schedule.src ='" +
ft + "' and flight_schedule.dest='" + ff + "' and (flight_schedule.days like
'%" + dwr + "%' or flight_schedule.days like '%Daily%') ", con);

105
da.Fill(ds, "tt");
for (int i = 0; i <= GridView2.Rows.Count - 1; i++)
{
GridViewRow roww = this.GridView2.Rows[i];
RadioButton ck = (RadioButton)
(this.GridView2.Rows[i].Cells[3].Controls[1]);
if (ck.Checked == true)
{
rclass = "Economy" ;
PlaceHolder1.Visible = true;
string str = ds.Tables["tt"].Rows[roww.DataItemIndex]
["f_sl_no"].ToString();
f2 = str;
int i1 = Convert.ToInt32(ck.Text);
//Response.Write(i3);
int i2 = i1 - psf - udf ;
i4 = i2;
int i5 = i3 + i2;
Label28.Text = ad + " Adult @ INR ";
Label16.Text = i5.ToString();
int j = ad * i5;
Label17.Text = j.ToString();
if (cd != 0)
{
Label29.Text = cd + " Children @ INR ";
Label18.Text = i5.ToString();
int k = cd * i5;
Label19.Text = k.ToString();
}
else
{
Label19.Text = cd.ToString();
Label18.Visible = false;
Label19.Visible = false;
Label29.Visible = false;
}
if (inf != 0)
{
Label30.Text = inf + " Infant @ INR ";
Label20.Text = infa.ToString();
int l = inf * infa;
Label21.Text = l.ToString();
}
else
{
Label21.Text = inf.ToString();
Label20.Visible = false;
Label21.Visible = false;
Label30.Visible = false;
}
int total = Convert.ToInt32(Label17.Text) +
Convert.ToInt32(Label19.Text) + Convert.ToInt32(Label21.Text) +
Convert.ToInt32(Label22.Text) + (Convert.ToInt32(Label23.Text)) +
Convert.ToInt32(Label24.Text) + Convert.ToInt32(Label25.Text);
Label26.Text = total.ToString();
}
}

105
}
protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
{
foreach (GridViewRow oldrow in GridView2.Rows)
{
((RadioButton)oldrow.FindControl("RadioButton1")).Checked = false;
((RadioButton)oldrow.FindControl("RadioButton2")).Checked = false;
((RadioButton)oldrow.FindControl("RadioButton3")).Checked = false;
}
RadioButton rb = (RadioButton)sender;
GridViewRow row = (GridViewRow)rb.NamingContainer;
((RadioButton)row.FindControl("RadioButton2")).Checked = true;
da = new SqlDataAdapter("select
flight_schedule.f_sl_no,flight_schedule.f_dept_time,flight_schedule.src,fligh
t_schedule.f_arr_time,flight_schedule.dest,flight_fare.e_fare,flight_fare.b_f
are,flight_fare.f_fare from flight_fare INNER JOIN flight_schedule ON
flight_fare.f_sl_no = flight_schedule.f_sl_no where flight_schedule.src ='" +
ft + "' and flight_schedule.dest='" + ff + "' and (flight_schedule.days like
'%" + dwr + "%' or flight_schedule.days like '%Daily%') ", con);
da.Fill(ds, "tt");
for (int i = 0; i <= GridView2.Rows.Count - 1; i++)
{
GridViewRow roww = this.GridView2.Rows[i];
RadioButton ck = (RadioButton)
(this.GridView2.Rows[i].Cells[4].Controls[1]);
if (ck.Checked == true)
{
rclass = "Business" ;
PlaceHolder1.Visible = true;
string str = ds.Tables["tt"].Rows[roww.DataItemIndex]
["f_sl_no"].ToString();
f2 = str;
int i1 = Convert.ToInt32(ck.Text);
//Response.Write(i3);
int i2 = i1 - psf - udf;
i4 = i2;
int i5 = i3 + i2;
Label28.Text = ad + " Adult @ INR ";
Label16.Text = i5.ToString();
int j = ad * i5;
Label17.Text = j.ToString();
if (cd != 0)
{
Label29.Text = cd + " Children @ INR ";
Label18.Text = i5.ToString();
int k = cd * i5;
Label19.Text = k.ToString();
}
else
{
Label19.Text = cd.ToString();
Label18.Visible = false;
Label19.Visible = false;
Label29.Visible = false;
}
if (inf != 0)
{

105
Label30.Text = inf + " Infant @ INR ";
Label20.Text = infa.ToString();
int l = inf * infa;
Label21.Text = l.ToString();
}
else
{
Label21.Text = inf.ToString();
Label20.Visible = false;
Label21.Visible = false;
Label30.Visible = false;
}
int total = Convert.ToInt32(Label17.Text) +
Convert.ToInt32(Label19.Text) + Convert.ToInt32(Label21.Text) +
Convert.ToInt32(Label22.Text) + (Convert.ToInt32(Label23.Text)) +
Convert.ToInt32(Label24.Text) + Convert.ToInt32(Label25.Text);
Label26.Text = total.ToString();
}
}
}
protected void RadioButton3_CheckedChanged(object sender, EventArgs e)
{
foreach (GridViewRow oldrow in GridView2.Rows)
{
((RadioButton)oldrow.FindControl("RadioButton1")).Checked = false;
((RadioButton)oldrow.FindControl("RadioButton2")).Checked = false;
((RadioButton)oldrow.FindControl("RadioButton3")).Checked = false;
}
RadioButton rb = (RadioButton)sender;
GridViewRow row = (GridViewRow)rb.NamingContainer;
((RadioButton)row.FindControl("RadioButton3")).Checked = true;
da = new SqlDataAdapter("select
flight_schedule.f_sl_no,flight_schedule.f_dept_time,flight_schedule.src,fligh
t_schedule.f_arr_time,flight_schedule.dest,flight_fare.e_fare,flight_fare.b_f
are,flight_fare.f_fare from flight_fare INNER JOIN flight_schedule ON
flight_fare.f_sl_no = flight_schedule.f_sl_no where flight_schedule.src ='" +
ft + "' and flight_schedule.dest='" + ff + "' and (flight_schedule.days like
'%" + dwr + "%' or flight_schedule.days like '%Daily%') ", con);
da.Fill(ds, "tt");
for (int i = 0; i <= GridView2.Rows.Count - 1; i++)
{
GridViewRow roww = this.GridView2.Rows[i];
RadioButton ck = (RadioButton)
(this.GridView2.Rows[i].Cells[5].Controls[1]);
if (ck.Checked == true)
{
rclass = "First Class" ;
PlaceHolder1.Visible = true;
string str = ds.Tables["tt"].Rows[roww.DataItemIndex]
["f_sl_no"].ToString();
f2 = str;
int i1 = Convert.ToInt32(ck.Text);
//Response.Write(i3);
int i2 = i1 - psf - udf;
i4 = i2;
int i5 = i3 + i2;
Label28.Text = ad + " Adult @ INR ";

105
Label16.Text = i5.ToString();
int j = ad * i5;
Label17.Text = j.ToString();
if (cd != 0)
{
Label29.Text = cd + " Children @ INR ";
Label18.Text = i5.ToString();
int k = cd * i5;
Label19.Text = k.ToString();
}
else
{
Label19.Text = cd.ToString();
Label18.Visible = false;
Label19.Visible = false;
Label29.Visible = false;
}
if (inf != 0)
{
Label30.Text = inf + " Infant @ INR ";
Label20.Text = infa.ToString();
int l = inf * infa;
Label21.Text = l.ToString();
}
else
{
Label21.Text = inf.ToString();
Label20.Visible = false;
Label21.Visible = false;
Label30.Visible = false;
}
int total = Convert.ToInt32(Label17.Text) +
Convert.ToInt32(Label19.Text) + Convert.ToInt32(Label21.Text) +
Convert.ToInt32(Label22.Text) + (Convert.ToInt32(Label23.Text)) +
Convert.ToInt32(Label24.Text) + Convert.ToInt32(Label25.Text);
Label26.Text = total.ToString();
}
}
}
protected void RadioButton4_CheckedChanged(object sender, EventArgs e)
{
foreach (GridViewRow oldrow in GridView1.Rows)
{
((RadioButton)oldrow.FindControl("RadioButton4")).Checked = false;
((RadioButton)oldrow.FindControl("RadioButton5")).Checked = false;
((RadioButton)oldrow.FindControl("RadioButton6")).Checked = false;
}
RadioButton rb = (RadioButton)sender;
GridViewRow row = (GridViewRow)rb.NamingContainer;
((RadioButton)row.FindControl("RadioButton4")).Checked = true;
da = new SqlDataAdapter("select
flight_schedule.f_sl_no,flight_schedule.f_dept_time,flight_schedule.src,fligh
t_schedule.f_arr_time,flight_schedule.dest,flight_fare.e_fare,flight_fare.b_f
are,flight_fare.f_fare from flight_fare INNER JOIN flight_schedule ON
flight_fare.f_sl_no = flight_schedule.f_sl_no where flight_schedule.src ='" +
ff + "' and flight_schedule.dest='" + ft + "' and (flight_schedule.days like
'%" + dwd + "%' or flight_schedule.days like '%Daily%') ", con);

105
da.Fill(ds, "tt");
for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
{
GridViewRow roww = this.GridView1.Rows[i];
RadioButton ck = (RadioButton)
(this.GridView1.Rows[i].Cells[3].Controls[1]);
if (ck.Checked == true)
{
dclass = "Economy" ;
PlaceHolder1.Visible = true;
string str = ds.Tables["tt"].Rows[roww.DataItemIndex]
["f_sl_no"].ToString();
f1 = str;
int i1 = Convert.ToInt32(ck.Text);
int i2 = i1 - psf - udf;
i3 = i2;
int i5 = i2 + i4;
Label28.Text = ad + " Adult @ INR ";
Label16.Text = i5.ToString();
int j = ad * i5;
Label17.Text = j.ToString();
if (cd != 0)
{
Label29.Text = cd + " Children @ INR ";
Label18.Text = i5.ToString();
int k = cd * i5;
Label19.Text = k.ToString();
}
else
{
Label19.Text = cd.ToString();
Label18.Visible = false;
Label19.Visible = false;
Label29.Visible = false;
}
if (inf != 0)
{
Label30.Text = inf + " Infant @ INR ";
Label20.Text = infa.ToString();
int l = inf * infa;
Label21.Text = l.ToString();
}
else
{
Label21.Text = inf.ToString();
Label20.Visible = false;
Label21.Visible = false;
Label30.Visible = false;
}
int total = Convert.ToInt32(Label17.Text) +
Convert.ToInt32(Label19.Text) + Convert.ToInt32(Label21.Text) +
Convert.ToInt32(Label22.Text) + Convert.ToInt32(Label23.Text) +
Convert.ToInt32(Label24.Text) + Convert.ToInt32(Label25.Text);
Label26.Text = total.ToString();
}
}
}

105
protected void RadioButton5_CheckedChanged(object sender, EventArgs e)
{
foreach (GridViewRow oldrow in GridView1.Rows)
{
((RadioButton)oldrow.FindControl("RadioButton4")).Checked = false;
((RadioButton)oldrow.FindControl("RadioButton5")).Checked = false;
((RadioButton)oldrow.FindControl("RadioButton6")).Checked = false;
}
RadioButton rb = (RadioButton)sender;
GridViewRow row = (GridViewRow)rb.NamingContainer;
((RadioButton)row.FindControl("RadioButton5")).Checked = true;
da = new SqlDataAdapter("select
flight_schedule.f_sl_no,flight_schedule.f_dept_time,flight_schedule.src,fligh
t_schedule.f_arr_time,flight_schedule.dest,flight_fare.e_fare,flight_fare.b_f
are,flight_fare.f_fare from flight_fare INNER JOIN flight_schedule ON
flight_fare.f_sl_no = flight_schedule.f_sl_no where flight_schedule.src ='" +
ff + "' and flight_schedule.dest='" + ft + "' and (flight_schedule.days like
'%" + dwd + "%' or flight_schedule.days like '%Daily%') ", con);
da.Fill(ds, "tt");
for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
{
GridViewRow roww = this.GridView1.Rows[i];
RadioButton ck = (RadioButton)
(this.GridView1.Rows[i].Cells[4].Controls[1]);
if (ck.Checked == true)
{
dclass = "Business";
PlaceHolder1.Visible = true;
string str = ds.Tables["tt"].Rows[roww.DataItemIndex]
["f_sl_no"].ToString();
f1 = str;
int i1 = Convert.ToInt32(ck.Text);
int i2 = i1 - psf - udf;
i3 = i2;
int i5 = i2 + i4;
Label28.Text = ad + " Adult @ INR ";
Label16.Text = i5.ToString();
int j = ad * i5;
Label17.Text = j.ToString();
if (cd != 0)
{
Label29.Text = cd + " Children @ INR ";
Label18.Text = i5.ToString();
int k = cd * i5;
Label19.Text = k.ToString();
}
else
{
Label19.Text = cd.ToString();
Label18.Visible = false;
Label19.Visible = false;
Label29.Visible = false;
}
if (inf != 0)
{
Label30.Text = inf + " Infant @ INR ";
Label20.Text = infa.ToString();

105
int l = inf * infa;
Label21.Text = l.ToString();
}
else
{
Label21.Text = inf.ToString();
Label20.Visible = false;
Label21.Visible = false;
Label30.Visible = false;
}
int total = Convert.ToInt32(Label17.Text) +
Convert.ToInt32(Label19.Text) + Convert.ToInt32(Label21.Text) +
Convert.ToInt32(Label22.Text) + Convert.ToInt32(Label23.Text) +
Convert.ToInt32(Label24.Text) + Convert.ToInt32(Label25.Text);
Label26.Text = total.ToString();
}
}
}
protected void RadioButton6_CheckedChanged(object sender, EventArgs e)
{
foreach (GridViewRow oldrow in GridView1.Rows)
{
((RadioButton)oldrow.FindControl("RadioButton4")).Checked = false;
((RadioButton)oldrow.FindControl("RadioButton5")).Checked = false;
((RadioButton)oldrow.FindControl("RadioButton6")).Checked = false;
}
RadioButton rb = (RadioButton)sender;
GridViewRow row = (GridViewRow)rb.NamingContainer;
((RadioButton)row.FindControl("RadioButton6")).Checked = true;
da = new SqlDataAdapter("select
flight_schedule.f_sl_no,flight_schedule.f_dept_time,flight_schedule.src,fligh
t_schedule.f_arr_time,flight_schedule.dest,flight_fare.e_fare,flight_fare.b_f
are,flight_fare.f_fare from flight_fare INNER JOIN flight_schedule ON
flight_fare.f_sl_no = flight_schedule.f_sl_no where flight_schedule.src ='" +
ff + "' and flight_schedule.dest='" + ft + "' and (flight_schedule.days like
'%" + dwd + "%' or flight_schedule.days like '%Daily%') ", con);
da.Fill(ds, "tt");
for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
{
GridViewRow roww = this.GridView1.Rows[i];
RadioButton ck = (RadioButton)
(this.GridView1.Rows[i].Cells[5].Controls[1]);
if (ck.Checked == true)
{
dclass = "First Class";
PlaceHolder1.Visible = true;
string str = ds.Tables["tt"].Rows[roww.DataItemIndex]
["f_sl_no"].ToString();
f1 = str;
int i1 = Convert.ToInt32(ck.Text);
int i2 = i1 - psf - udf;
i3 = i2;
int i5 = i2 + i4;
Label28.Text = ad + " Adult @ INR ";
Label16.Text = i5.ToString();
int j = ad * i5;
Label17.Text = j.ToString();

105
if (cd != 0)
{
Label29.Text = cd + " Children @ INR ";
Label18.Text = i5.ToString();
int k = cd * i5;
Label19.Text = k.ToString();
}
else
{
Label19.Text = cd.ToString();
Label18.Visible = false;
Label19.Visible = false;
Label29.Visible = false;
}
if (inf != 0)
{
Label30.Text = inf + " Infant @ INR ";
Label20.Text = infa.ToString();
int l = inf * infa;
Label21.Text = l.ToString();
}
else
{
Label21.Text = inf.ToString();
Label20.Visible = false;
Label21.Visible = false;
Label30.Visible = false;
}
int total = Convert.ToInt32(Label17.Text) +
Convert.ToInt32(Label19.Text) + Convert.ToInt32(Label21.Text) +
Convert.ToInt32(Label22.Text) + Convert.ToInt32(Label23.Text) +
Convert.ToInt32(Label24.Text) + Convert.ToInt32(Label25.Text);
Label26.Text = total.ToString();
}
}
}
protected void RadioButton7_CheckedChanged(object sender, EventArgs e)
{
if (RadioButton7.Checked == true)
{
RadioButton8.Checked = false;
}
}
protected void RadioButton8_CheckedChanged(object sender, EventArgs e)
{
if (RadioButton8.Checked == true)
{
RadioButton7.Checked = false;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("home.aspx");
}
protected void Button2_Click(object sender, EventArgs e)
{
if (dclass == null)

105
{
Response.Write("<script> alert('Please select the Class for
Departing Flight')</script>");
}
else if (ftrip == 1)
{
if (rclass == null)
{
Response.Write("<script> alert('Please select the Class for
Returning Flight')</script>");
}
else if (CheckBox1.Checked == false)
{
Response.Write("<script> alert('Please read the Terms and
Conditions')</script>");
}
else
{
HttpCookie val11 = new HttpCookie("fsld");
val11.Value = f1;
Response.Cookies.Add(val11);
HttpCookie val12 = new HttpCookie("fslr");
val12.Value = f2;
Response.Cookies.Add(val12);
HttpCookie val13 = new HttpCookie("dc");
val13.Value = dclass;
Response.Cookies.Add(val13);
HttpCookie val14 = new HttpCookie("rc");
val14.Value = rclass;
Response.Cookies.Add(val14);
HttpCookie val15 = new HttpCookie("fare");
val15.Value = Label16.Text.ToString();
Response.Cookies.Add(val15);
HttpCookie val16 = new HttpCookie("tii");
val16.Value = this.RadioButtonList1.SelectedIndex.ToString();
Response.Cookies.Add(val16);
HttpCookie val17 = new HttpCookie("cfare");
val17.Value = Label18.Text.ToString();
Response.Cookies.Add(val17);
Response.Redirect("passenger.aspx");
}
}
else if (CheckBox1.Checked == false)
{
Response.Write("<script> alert('Please read the Terms and
Conditions')</script>");
}
else
{
HttpCookie val11 = new HttpCookie("fsld");
val11.Value = f1;
Response.Cookies.Add(val11);
HttpCookie val12 = new HttpCookie("fslr");
val12.Value = f2;
Response.Cookies.Add(val12);
HttpCookie val13 = new HttpCookie("dc");
val13.Value = dclass;

105
Response.Cookies.Add(val13);
HttpCookie val14 = new HttpCookie("rc");
val14.Value = rclass;
Response.Cookies.Add(val14);
HttpCookie val15 = new HttpCookie("fare");
val15.Value = Label16.Text.ToString();
Response.Cookies.Add(val15);
HttpCookie val16 = new HttpCookie("tii");
val16.Value = this.RadioButtonList1.SelectedIndex.ToString();
Response.Cookies.Add(val16);
HttpCookie val17 = new HttpCookie("cfare");
val17.Value = Label18.Text.ToString();
Response.Cookies.Add(val17);
Response.Redirect("passenger.aspx");
}
}

Passengers Details Page

105
Code For Passengers Details Page
using System;
using System.Data;
using System.Configuration;

105
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["AirlineConnectionString"
].ToString());
SqlCommand com = new SqlCommand();
DataSet ds = new DataSet();
SqlDataAdapter da;
static int adult_i = 1;
static int adult = 0;
static int child_i = 1;
static int childs = 0;
static int inf_i = 1;
static int infs = 0;
static int tot = 0;
static int tots = 0;
static string s1=null;
protected void Page_Load(object sender, EventArgs e)
{
Label56.Visible = false;
GridView1.Visible = false;
Panel2.Visible = false;
Button4.Enabled = false;
int ftrip =Convert.ToInt32( Request.Cookies["trip"].Value);
string ad = Request.Cookies["adult"].Value;
adult = Convert.ToInt32(ad);
string fsl1 = Request.Cookies["fsld"].Value;
string fsl2 = Request.Cookies["fslr"].Value;
string ddate = Request.Cookies["dd"].Value;
string rdate = Request.Cookies["rd"].Value;
string dcl = Request.Cookies["dc"].Value;
string rcl = Request.Cookies["rc"].Value;
string fares = Request.Cookies["fare"].Value;
string childf = Request.Cookies["cfare"].Value;
int tti = Convert.ToInt32(Request.Cookies["tii"].Value);
int ch = Convert.ToInt32(Request.Cookies["child"].Value);
childs = ch;
int inf = Convert.ToInt32(Request.Cookies["infant"].Value);
infs = inf;
tot = adult + childs + infs;
tots = adult + childs;
Label11.Text = " Adult(s): " + ad.ToString();
int fare = Convert.ToInt32(fares) * Convert.ToInt32(ad);
Label12.Text = fare.ToString();
int udf = Convert.ToInt32(ad) * 260;
Label14.Text = udf.ToString();
if (IsPostBack == false)

105
{
adult_i = 1;
child_i = 1;
inf_i = 1;
tot = 0;
tots = 0;
s1 = RandomNumberGenerator(5);
com = new SqlCommand("select gr_id from passenger_details", con);
con.Open();
SqlDataReader auto_gen = com.ExecuteReader();
while (auto_gen.Read())
{
if (s1 == auto_gen[0].ToString())
{
s1 = RandomNumberGenerator(5);
}
}
con.Close();
Button2.Visible = false;
}
if (ch != 0)
{
Label17.Text = " Children : " + ch.ToString();
int childfare = Convert.ToInt32(childf) * Convert.ToInt32(ch);
Label18.Text = childfare.ToString();
int cudf = Convert.ToInt32(ch) * 260;
Label20.Text = cudf.ToString();
}
else
{
Label17.Visible = false;
Label18.Visible = false;
Label19.Visible = false;
Label20.Visible = false;
Label21.Visible = false;
int t4 = 0;
Label22.Text = t4.ToString();
Label22.Visible = false;
}
if (inf != 0)
{
Label23.Text = " Infant : " + inf.ToString();
int inffare = 0;
Label24.Text = inffare.ToString();
int iudf = 0;
Label26.Text = iudf.ToString();
}
else
{
Label23.Visible = false;
Label24.Visible = false;
Label25.Visible = false;
Label26.Visible = false;
Label27.Visible = false;
int t5 = 0;
Label28.Text = t5.ToString();
Label28.Visible = false;

105
}
com = new SqlCommand("select * from flight_schedule where f_sl_no='" +
fsl1 + "'", con);
con.Open();
SqlDataReader reader = com.ExecuteReader();
while (reader.Read())
{
this.Label1.Text = reader["f_no"].ToString();
this.Label2.Text = ddate.ToString();
this.Label3.Text = reader["f_dept_time"].ToString();
this.Label4.Text = reader["f_arr_time"].ToString();
this.Label5.Text =dcl.ToString() ;
}
con.Close();
if (ftrip == 1)
{
com = new SqlCommand("select * from flight_schedule where
f_sl_no='" + fsl2 + "'", con);
con.Open();
SqlDataReader reader2 = com.ExecuteReader();
while (reader2.Read())
{
this.Label6.Text = reader2["f_no"].ToString();
this.Label7.Text = rdate.ToString();
this.Label8.Text = reader2["f_dept_time"].ToString();
this.Label9.Text = reader2["f_arr_time"].ToString();
this.Label10.Text = rcl.ToString();
}
con.Close();
int psf = Convert.ToInt32(ad) * 229 * 2;
Label13.Text = psf.ToString();
if (ch != 0)
{
int cpsf = Convert.ToInt32(ch) * 229 * 2;
Label19.Text = cpsf.ToString();
}
if (inf != 0)
{
int ipsf = Convert.ToInt32(inf) * 229 * 2;
Label25.Text = ipsf.ToString();
}
if (tti == 0)
{
int ti = Convert.ToInt32(ad) * 149 * 2;
Label15.Text = ti.ToString();
int t1 = Convert.ToInt32(Label12.Text) +
Convert.ToInt32(Label13.Text) + Convert.ToInt32(Label14.Text) +
Convert.ToInt32(Label15.Text);
Label16.Text = t1.ToString();
if (ch != 0)
{
int tic = Convert.ToInt32(ch) * 149 * 2;
Label21.Text = tic.ToString();
int t2 = Convert.ToInt32(Label18.Text) +
Convert.ToInt32(Label19.Text) + Convert.ToInt32(Label20.Text) +
Convert.ToInt32(Label21.Text);
Label22.Text = t2.ToString();

105
}
if (inf != 0)
{
int tiinf = Convert.ToInt32(inf) * 149 * 2;
Label27.Text = tiinf.ToString();
int t3 = Convert.ToInt32(Label24.Text) +
Convert.ToInt32(Label25.Text) + Convert.ToInt32(Label26.Text) +
Convert.ToInt32(Label27.Text);
Label28.Text = t3.ToString();
}
}
else
{
Label15.Text ="N/A";
int t1 = Convert.ToInt32(Label12.Text) +
Convert.ToInt32(Label13.Text) + Convert.ToInt32(Label14.Text);
Label16.Text = t1.ToString();
if (ch != 0)
{
Label21.Text = "N/A";
int t2 = Convert.ToInt32(Label18.Text) +
Convert.ToInt32(Label19.Text) + Convert.ToInt32(Label20.Text);
Label22.Text = t2.ToString();
}
if (inf != 0)
{
Label27.Text = "N/A";
int t3 = Convert.ToInt32(Label24.Text) +
Convert.ToInt32(Label25.Text);
Label28.Text = t3.ToString();
}
}
Label38.Visible = false;

}
else
{
Label6.Visible = false;
Label7.Visible = false;
Label8.Visible = false;
Label9.Visible = false;
Label10.Visible = false;
int psf = Convert.ToInt32(ad) * 229;
Label13.Text = psf.ToString();
if (ch != 0)
{
int cpsf = Convert.ToInt32(ch) * 229;
Label19.Text = cpsf.ToString();
}
if (inf != 0)
{
int ipsf = Convert.ToInt32(inf) * 229 ;
Label25.Text = ipsf.ToString();
}
if (tti == 0)
{
int ti = Convert.ToInt32(ad) * 149 ;

105
Label15.Text = ti.ToString();
int t1 = Convert.ToInt32(Label12.Text) +
Convert.ToInt32(Label13.Text) + Convert.ToInt32(Label14.Text) +
Convert.ToInt32(Label15.Text);
Label16.Text = t1.ToString();
if (ch != 0)
{
int tic = Convert.ToInt32(ch) * 149 ;
Label21.Text = tic.ToString();
int t2 = Convert.ToInt32(Label18.Text) +
Convert.ToInt32(Label19.Text) + Convert.ToInt32(Label20.Text) +
Convert.ToInt32(Label21.Text);
Label22.Text = t2.ToString();
}
if (inf != 0)
{
int tiinf = Convert.ToInt32(inf) * 149;
Label27.Text = tiinf.ToString();
int t3 = Convert.ToInt32(Label24.Text) +
Convert.ToInt32(Label25.Text) + Convert.ToInt32(Label26.Text) +
Convert.ToInt32(Label27.Text);
Label28.Text = t3.ToString();
}
}
else
{
Label15.Text = "N/A";
int t1 = Convert.ToInt32(Label12.Text) +
Convert.ToInt32(Label13.Text) + Convert.ToInt32(Label14.Text);
Label16.Text = t1.ToString();
if (ch != 0)
{
Label21.Text = "N/A";
int t2 = Convert.ToInt32(Label18.Text) +
Convert.ToInt32(Label19.Text) + Convert.ToInt32(Label20.Text) ;
Label22.Text = t2.ToString();
}
if (inf != 0)
{
Label27.Text = "N/A";
int t3 = Convert.ToInt32(Label24.Text) +
Convert.ToInt32(Label25.Text) ;
Label28.Text = t3.ToString();
}
}

}
int total = Convert.ToInt32(Label16.Text) +
Convert.ToInt32(Label22.Text) + Convert.ToInt32(Label28.Text);
Label30.Text = total.ToString();
Label31.Text = " Adult: 1";
if (adult + childs + infs == 1)
{
Button1.Visible = false;
Button2.Visible = true;
}
Label38.Visible = false;

105
}
public void bind()
{
//string abc = tot.ToString();
da = new SqlDataAdapter("select title 'Title',fname 'First
Name',lname 'Last Name',gender 'Gender',age 'Age',meal 'Meal' from
passenger_details where gr_id='"+s1+"'", con);
da.Fill(ds, "tt");
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(s1);
com = new SqlCommand("insert into
passenger_details(title,fname,lname,gender,age,meal,gr_id)values('" +
this.DropDownList1.Text + "','" + this.TextBox1.Text + "','" +
this.TextBox2.Text + "','" + this.RadioButtonList1.Text + "','" +
this.TextBox3.Text + "','" + this.DropDownList2.Text+"','"+s1 + "')", con);
con.Open();
com.ExecuteNonQuery();
con.Close();
this.TextBox1.Text = "";
this.TextBox2.Text = "";
this.TextBox3.Text = "";
this.DropDownList1.ClearSelection();
this.DropDownList2.ClearSelection();
this.RadioButtonList1.ClearSelection();
if (adult_i < adult)
{
adult_i++;
Label31.Text = " Adult: " + adult_i.ToString();

}
else
{
if (child_i <= childs)
{
Label31.Text = " Child: " + child_i.ToString();
child_i++;
}
else if (inf_i <= infs)
{
Label31.Text = " infant: " + inf_i.ToString();
Label32.Visible = false;
DropDownList1.Visible = false;
Label35.Visible = false;
RadioButtonList1.Visible = false;
RequiredFieldValidator3.Visible = false;
Label37.Visible = false;
DropDownList2.Visible = false;
Label38.Visible = true;
inf_i++;
}
}
if ((adult_i + child_i + inf_i) == (adult + childs + infs+2 ))

105
{
Button1.Visible = false;
Button2.Visible = true;
}
}
protected void Button2_Click(object sender, EventArgs e)
{
com = new SqlCommand("insert into
passenger_details(title,fname,lname,gender,age,meal,gr_id)values('" +
this.DropDownList1.Text + "','" + this.TextBox1.Text + "','" +
this.TextBox2.Text + "','" + this.RadioButtonList1.Text + "','" +
this.TextBox3.Text + "','" + this.DropDownList2.Text + "','" + s1 + "')",
con);
con.Open();
com.ExecuteNonQuery();
con.Close();
Panel1.Visible = false;
bind();
GridView1.Visible = true;
Label56.Visible = true;
Panel2.Visible = true;
Button4.Enabled = true;
}
private static string RandomNumberGenerator(int length)
{
System.Security.Cryptography.RandomNumberGenerator rng =
System.Security.Cryptography.RandomNumberGenerator.Create();

char[] chars = new char[length];


string validChars =
"abcdefghijklmnopqrstuvwxyzABCEDFGHIJKLMNOPQRSTUVWXYZ1234567890";

for (int i = 0; i < length; i++)


{
byte[] bytes = new byte[1];
rng.GetBytes(bytes);

Random rnd = new Random(bytes[0]);

chars[i] = validChars[rnd.Next(0, 61)];


}

return (new string(chars));


}
protected void Button4_Click(object sender, EventArgs e)
{
com = new SqlCommand("update passenger_details set mobile='" +
this.TextBox4.Text + "',land='" + this.TextBox5.Text + "',email='" +
this.TextBox6.Text + "' where gr_id='" + s1 + "'", con);
con.Open();
com.ExecuteNonQuery();
con.Close();
HttpCookie val21 = new HttpCookie("grid");
val21.Value = s1;
Response.Cookies.Add(val21);
HttpCookie val22 = new HttpCookie("tfare");
val22.Value = Label30.Text;

105
Response.Cookies.Add(val22);
HttpCookie val23 = new HttpCookie("totalp");
val23.Value = tots.ToString();
Response.Cookies.Add(val23);
//Response.Write(val23.Value);
Response.Redirect("payment.aspx");
}
}

Payment Page

105
Code For Payment Page
using System;
using System.Data;
using System.Configuration;
using System.Collections;

105
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["AirlineConnectionString"
].ToString());
SqlCommand com = new SqlCommand();
SqlCommand com1 = new SqlCommand();
SqlCommand com2 = new SqlCommand();
SqlCommand com3 = new SqlCommand();
SqlCommand com4 = new SqlCommand();
SqlCommand com5 = new SqlCommand();
SqlCommand com6 = new SqlCommand();
SqlCommand com7 = new SqlCommand();
SqlCommand com8 = new SqlCommand();
SqlCommand com9 = new SqlCommand();
SqlCommand com10 = new SqlCommand();
SqlCommand com11= new SqlCommand();
DataSet ds = new DataSet();
SqlDataAdapter da;
static string gid = null;
static string ddate = null;
static string rdate = null;
static string fsl1 = null;
static string fsl2 = null;
static string dcl = null;
static string rcl = null;
static int ftrip = 0;
static int tot = 0;
protected void Page_Load(object sender, EventArgs e)
{
tot = Convert.ToInt32(Request.Cookies["totalp"].Value);
ftrip = Convert.ToInt32(Request.Cookies["trip"].Value);
fsl1 = Request.Cookies["fsld"].Value;
fsl2 = Request.Cookies["fslr"].Value;
ddate = Request.Cookies["dd"].Value;
rdate = Request.Cookies["rd"].Value;
dcl = Request.Cookies["dc"].Value;
rcl = Request.Cookies["rc"].Value;
string ff = Request.Cookies["from"].Value.ToString();
string ft = Request.Cookies["to"].Value.ToString();
string webfare = Request.Cookies["tfare"].Value.ToString();
gid = Request.Cookies["grid"].Value.ToString();
com = new SqlCommand("select * from flight_schedule where f_sl_no='"
+ fsl1 + "'", con);
con.Open();
SqlDataReader reader = com.ExecuteReader();
while (reader.Read())
{
this.Label1.Text = reader["f_no"].ToString();

105
this.Label2.Text = ddate.ToString();
this.Label3.Text = reader["f_dept_time"].ToString();
this.Label4.Text = reader["f_arr_time"].ToString();
this.Label5.Text = dcl.ToString();
this.Label11.Text = ff.ToString();
this.Label12.Text = ft.ToString();
}
con.Close();
if (ftrip == 1)
{
com = new SqlCommand("select * from flight_schedule where
f_sl_no='" + fsl2 + "'", con);
con.Open();
SqlDataReader reader2 = com.ExecuteReader();
while (reader2.Read())
{
this.Label6.Text = reader2["f_no"].ToString();
this.Label7.Text = rdate.ToString();
this.Label8.Text = reader2["f_dept_time"].ToString();
this.Label9.Text = reader2["f_arr_time"].ToString();
this.Label10.Text = rcl.ToString();
this.Label13.Text = ft.ToString();
this.Label14.Text = ff.ToString();
}
con.Close();
}
else
{
Label6.Visible = false;
Label7.Visible = false;
Label8.Visible = false;
Label9.Visible = false;
Label10.Visible = false;
Label13.Visible = false;
Label14.Visible = false;
}
if (IsPostBack == false)
{
bind();
Label18.Text = webfare.ToString();
}
}
public void bind()
{
da = new SqlDataAdapter("select p_id 'ID',title 'Title',fname 'First
Name',lname 'Last Name',gender 'Gender',age 'Age' from passenger_details
where gr_id='" + gid + "'", con);
da.Fill(ds, "tt");
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs
e)
{
this.GridView1.EditIndex = e.NewEditIndex;
bind();
}

105
protected void GridView1_RowCancelingEdit(object sender,
GridViewCancelEditEventArgs e)
{
this.GridView1.EditIndex = -1;
bind();
}
protected void GridView1_RowUpdating(object sender,
GridViewUpdateEventArgs e)
{
TextBox tc1 = (TextBox)
(this.GridView1.Rows[e.RowIndex].Cells[1].Controls[0]);
TextBox tc2 = (TextBox)
(this.GridView1.Rows[e.RowIndex].Cells[3].Controls[0]);
TextBox tc3 = (TextBox)
(this.GridView1.Rows[e.RowIndex].Cells[4].Controls[0]);
TextBox tc4 = (TextBox)
(this.GridView1.Rows[e.RowIndex].Cells[5].Controls[0]);
TextBox tc5 = (TextBox)
(this.GridView1.Rows[e.RowIndex].Cells[6].Controls[0]);
com = new SqlCommand("update passenger_details set fname='" +
tc2.Text + "',lname='" + tc3.Text + "',gender='" + tc4.Text + "',age='" +
tc5.Text + "' where p_id='" + tc1.Text + "'", con);
con.Open();
com.ExecuteNonQuery();
this.GridView1.EditIndex = -1;
bind();
con.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{

int sa = 0;
com = new SqlCommand("update passenger_details set date='" + ddate +
"',f_sl_no='" +fsl1+ "'where gr_id='" + gid + "'", con);
con.Open();
com.ExecuteNonQuery();
con.Close();
com2 = new SqlCommand("select * from seat where f_sl_no='" + fsl1 +
"' and date='" + ddate + "'", con);
con.Open();
SqlDataReader reader = com2.ExecuteReader();
while (reader.Read())
{
sa = Convert.ToInt32(reader["s_no"].ToString());
//Response.Write(sa);
}
con.Close();
if (sa == 0)
{
int eco = 1;
int bus = 1;
int fc = 1;
com4 = new SqlCommand("select * from seat where f_sl_no='" + fsl1
+ "' ", con);
Response.Write(fsl1);
con.Open();
SqlDataReader reader3 = com4.ExecuteReader();

105
while (reader3.Read())
{
eco = Convert.ToInt32(reader3["t_e_seat"].ToString());
bus = Convert.ToInt32(reader3["t_b_seat"].ToString());
fc = Convert.ToInt32(reader3["t_f_seat"].ToString());
}
con.Close();
int beco = eco;
int bbus = bus;
int bfc = fc;
if (dcl == "Economy")
{
beco = eco - tot;
//Response.Write(beco);
}
if (dcl == "Business")
{
bbus = bus - tot;
//Response.Write(bbus);
}
if (dcl == "First Class")
{
bfc = fc - tot;
//Response.Write(bfc);
}
com3 = new SqlCommand("insert into
seat(date,f_sl_no,t_e_seat,t_b_seat,t_f_seat,b_e_seat,b_b_seat,b_f_seat)value
s('" + ddate + "','" + fsl1 + "','" + eco + "','" + bus + "','" + fc + "','"
+ beco + "','" + bbus + "','" + bfc + "')", con);
con.Open();
com3.ExecuteNonQuery();
con.Close();
}
else
{
int eco = 1;
int bus = 1;
int fc = 1;
com6 = new SqlCommand("select * from seat where f_sl_no='" + fsl1
+ "' and date='" + ddate + "' ", con);
con.Open();
SqlDataReader reader4 = com6.ExecuteReader();
while (reader4.Read())
{
eco = Convert.ToInt32(reader4["b_e_seat"].ToString());
bus = Convert.ToInt32(reader4["b_b_seat"].ToString());
fc = Convert.ToInt32(reader4["b_f_seat"].ToString());
}
con.Close();
int beco = eco;
int bbus = bus;
int bfc = fc;
if (dcl == "Economy")
{
beco = eco - tot;
Response.Write(beco);
}

105
if (dcl == "Business")
{
bbus = bus - tot;
//Response.Write(bbus);
}
if (dcl == "First Class")
{
bfc = fc - tot;
//Response.Write(bfc);
}
com5 = new SqlCommand("update seat set b_e_seat='" + beco +
"',b_b_seat='" + bbus + "',b_f_seat='" + bfc + "' where date='" + ddate + "'
and f_sl_no='" + fsl1 + "'", con);
con.Open();
com5.ExecuteNonQuery();
con.Close();
}
if (ftrip == 1)
{
com1 = new SqlCommand("insert into
passenger_details(gr_id,date,f_sl_no)values('" + gid + "','" + rdate + "','"
+ fsl2 + "')", con);
con.Open();
com1.ExecuteNonQuery();
con.Close();
int sa2 = 0;
com7 = new SqlCommand("select * from seat where f_sl_no='" + fsl2
+ "' and date='" + rdate + "'", con);
con.Open();
SqlDataReader reader5 = com7.ExecuteReader();
while (reader5.Read())
{
sa2 = Convert.ToInt32(reader5["s_no"].ToString());
//Response.Write(sa);
}
con.Close();
if (sa2 == 0)
{
int eco = 1;
int bus = 1;
int fc = 1;
com8 = new SqlCommand("select * from seat where f_sl_no='" +
fsl2 + "' ", con);
Response.Write(fsl2);
con.Open();
SqlDataReader reader6 = com8.ExecuteReader();
while (reader6.Read())
{
eco = Convert.ToInt32(reader6["t_e_seat"].ToString());
bus = Convert.ToInt32(reader6["t_b_seat"].ToString());
fc = Convert.ToInt32(reader6["t_f_seat"].ToString());
}
con.Close();
int beco = eco;
int bbus = bus;
int bfc = fc;
if (rcl == "Economy")

105
{
beco = eco - tot;
//Response.Write(beco);
}
if (rcl == "Business")
{
bbus = bus - tot;
//Response.Write(bbus);
}
if (rcl == "First Class")
{
bfc = fc - tot;
//Response.Write(bfc);
}
com9 = new SqlCommand("insert into
seat(date,f_sl_no,t_e_seat,t_b_seat,t_f_seat,b_e_seat,b_b_seat,b_f_seat)value
s('" + rdate + "','" + fsl2 + "','" + eco + "','" + bus + "','" + fc + "','"
+ beco + "','" + bbus + "','" + bfc + "')", con);
con.Open();
com9.ExecuteNonQuery();
con.Close();
}
else
{
int eco = 1;
int bus = 1;
int fc = 1;
com10 = new SqlCommand("select * from seat where f_sl_no='" +
fsl2 + "' and date='" + rdate + "' ", con);
con.Open();
SqlDataReader reader7 = com10.ExecuteReader();
while (reader7.Read())
{
eco = Convert.ToInt32(reader7["b_e_seat"].ToString());
bus = Convert.ToInt32(reader7["b_b_seat"].ToString());
fc = Convert.ToInt32(reader7["b_f_seat"].ToString());
}
con.Close();
int beco = eco;
int bbus = bus;
int bfc = fc;
if (rcl == "Economy")
{
beco = eco - tot;
//Response.Write(beco);
}
if (rcl == "Business")
{
bbus = bus - tot;
//Response.Write(bbus);
}
if (rcl == "First Class")
{
bfc = fc - tot;
//Response.Write(bfc);
}

105
com11 = new SqlCommand("update seat set b_e_seat='" + beco +
"',b_b_seat='" + bbus + "',b_f_seat='" + bfc + "' where date='" + rdate + "'
and f_sl_no='" + fsl2 + "'", con);
con.Open();
com11.ExecuteNonQuery();
con.Close();
}
}
Response.Redirect("confirm.aspx");
}
protected void Radio3_ServerChange(object sender, EventArgs e)
{

}
}

Confirmation Page

105
Code For Confirmation Page
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;

105
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["AirlineConnectionString"
].ToString());
SqlCommand com = new SqlCommand();
SqlCommand com2 = new SqlCommand();
DataSet ds = new DataSet();
SqlDataAdapter da;
static string gid = null;
static string ddate = null;
static string rdate = null;
static string fsl1 = null;
static string fsl2 = null;
static string dcl = null;
static string rcl = null;
static int ftrip = 0;
protected void Page_Load(object sender, EventArgs e)
{
ftrip = Convert.ToInt32(Request.Cookies["trip"].Value);
fsl1 = Request.Cookies["fsld"].Value;
fsl2 = Request.Cookies["fslr"].Value;
ddate = Request.Cookies["dd"].Value;
rdate = Request.Cookies["rd"].Value;
dcl = Request.Cookies["dc"].Value;
rcl = Request.Cookies["rc"].Value;
string ff = Request.Cookies["from"].Value.ToString();
string ft = Request.Cookies["to"].Value.ToString();
string webfare = Request.Cookies["tfare"].Value.ToString();
gid = Request.Cookies["grid"].Value.ToString();
com2 = new SqlCommand("select top(1) * from passenger_details where
gr_id='" + gid + "'", con);
con.Open();
SqlDataReader reader3 = com2.ExecuteReader();
while (reader3.Read())
{
string fn;
string ln;
fn = reader3["fname"].ToString();
ln = reader3["lname"].ToString();
this.Label25.Text = fn + ' ' + ln;
this.Label27.Text = reader3["land"].ToString();
this.Label29.Text = reader3["mobile"].ToString();
this.Label31.Text = reader3["email"].ToString();
}
con.Close();
com = new SqlCommand("select * from flight_schedule where f_sl_no='"
+ fsl1 + "'", con);
con.Open();
SqlDataReader reader = com.ExecuteReader();
while (reader.Read())

105
{
this.Label1.Text = reader["f_no"].ToString();
this.Label2.Text = ddate.ToString();
this.Label3.Text = reader["f_dept_time"].ToString();
this.Label4.Text = reader["f_arr_time"].ToString();
this.Label5.Text = dcl.ToString();
this.Label11.Text = ff.ToString();
this.Label12.Text = ft.ToString();
}
con.Close();
if (ftrip == 1)
{
com = new SqlCommand("select * from flight_schedule where
f_sl_no='" + fsl2 + "'", con);
con.Open();
SqlDataReader reader2 = com.ExecuteReader();
while (reader2.Read())
{
this.Label6.Text = reader2["f_no"].ToString();
this.Label7.Text = rdate.ToString();
this.Label8.Text = reader2["f_dept_time"].ToString();
this.Label9.Text = reader2["f_arr_time"].ToString();
this.Label10.Text = rcl.ToString();
this.Label13.Text = ft.ToString();
this.Label14.Text = ff.ToString();
}
con.Close();
}
else
{
Label6.Visible = false;
Label7.Visible = false;
Label8.Visible = false;
Label9.Visible = false;
Label10.Visible = false;
Label13.Visible = false;
Label14.Visible = false;
}
if (IsPostBack == false)
{
bind();
Label17.Text = DateTime.Today.ToShortDateString();
Label33.Text = gid.ToString();
}
}
public void bind()
{
da = new SqlDataAdapter("select title + ' ' + fname + ' ' + lname AS
Guest_Details from passenger_details where date='" + ddate + "' and f_sl_no='"
+ fsl1 + "' and gr_id='" + gid + "'", con);
da.Fill(ds, "tt");
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
Session["user_id"] = Panel1 ;

105
ClientScript.RegisterStartupScript(this.GetType(), "onclick",
"<script
language=javascript>window.open('Print.aspx','PrintMe','height=400px,width=80
0px,scrollbars=1');</script>");
}
}

Print Out of Ticket

105
Employee Manager Page

105
Code For Employee Manager Page

using System;

105
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["AirlineConnectionString"
].ToString());
SqlCommand com = new SqlCommand();
SqlDataAdapter da;
DataSet ds = new DataSet();
SqlCommandBuilder bb;
static string k_id = null;
public void bind()
{
da = new SqlDataAdapter("select emp_id 'Emp Id',name 'Name',dsg
'Designation',sex 'Sex',age 'Age',address 'Address',mobile 'Mobile No.',email
'E-Mail'from employee", con);
da.Fill(ds, "tt");
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
}
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack == false)
{
bind();
}
}

protected void ImageButton3_Click(object sender, ImageClickEventArgs e)


{
this.TextBox1.Text = "";
this.TextBox2.Text = "";
this.TextBox3.Text = "";
this.TextBox7.Text = "";
this.TextBox4.Text = "";
GridView1.Visible = false;
Panel1.Visible = false;
PlaceHolder1.Visible = true;
Panel2.Visible = true;
TextBox5.Visible = true;
TextBox6.Visible = true;
Label9.Visible = true;
Label10.Visible = true;
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{

105
da = new SqlDataAdapter("select emp_id 'Emp Id',name 'Name',dsg
'Designation',sex 'Sex',age 'Age',address 'Address',mobile 'Mobile No.',email
'E-Mail'from employee", con);
da.Fill(ds, "tt");
int i = 0;
int j = 0;
int k = 0;
for (; i < ds.Tables["tt"].Rows.Count ; i++)
{
CheckBox ck = (CheckBox)
(this.GridView1.Rows[i].Cells[0].Controls[1]);
if (ck.Checked == true)
{
j = 1;
k = 0;
string str = this.GridView1.Rows[i].Cells[1].Text;
k_id = str;
ds.Clear();
com = new SqlCommand("select * from employee where emp_id='"
+ str + "'", con);
con.Open();
SqlDataReader reader = com.ExecuteReader();
while (reader.Read())
{
TextBox1.Text = reader["name"].ToString();
this.DropDownList1.Text = reader["dsg"].ToString();
this.RadioButtonList1.Text = reader["sex"].ToString();
this.TextBox2.Text = reader["age"].ToString();
this.TextBox3.Text = reader["address"].ToString();
this.TextBox7.Text = reader["mobile"].ToString();
this.TextBox4.Text = reader["email"].ToString();

}
con.Close();
GridView1.Visible = false;
Panel1.Visible = false;
Panel3.Visible = true;
PlaceHolder1.Visible = true;
TextBox5.Visible = false;
TextBox6.Visible = false;
Label9.Visible = false;
Label10.Visible = false;
}
else
{
k = 1;
}

}
if (k == 1 && j != 1)
{
Response.Write("<script> alert('Please select a User from the
list to edit')</script>");
}

}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)

105
{
da = new SqlDataAdapter("select emp_id 'Emp Id',name 'Name',dsg
'Designation',sex 'Sex',age 'Age',address 'Address',mobile 'Mobile No.',email
'E-Mail'from employee", con);
da.Fill(ds, "tt");
int i = 0;
int j = 0;
int k=0;
for (; i <= ds.Tables["tt"].Rows.Count - 1; i++)
{
CheckBox ck = (CheckBox)
(this.GridView1.Rows[i].Cells[0].Controls[1]);
if (ck.Checked == true)
{
ds.Tables["tt"].Rows[i].Delete();
j = 1;
k = 0;
}
else
{
k = 1;
}
}
if (k == 1 && j!=1)
{
Response.Write("<script> alert('Please select a User from the
list to delete')</script>");
}
bb = new SqlCommandBuilder(da);
da.Update(ds, "tt");
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
}
protected void ImageButton5_Click(object sender, ImageClickEventArgs e)
{
com = new SqlCommand("insert into
employee(name,dsg,sex,age,address,email,psw,mobile)values('" +
this.TextBox1.Text + "','" + this.DropDownList1.Text + "','" +
this.RadioButtonList1.Text + "','" + this.TextBox2.Text + "','" +
this.TextBox3.Text + "','" + this.TextBox4.Text + "','" + this.TextBox5.Text
+ "','" + this.TextBox7.Text + "')", con);
con.Open();
com.ExecuteNonQuery();
bind();
con.Close();
GridView1.Visible = true;
PlaceHolder1.Visible = false;
Panel2.Visible = false;
Panel1.Visible = true;
}
protected void ImageButton6_Click(object sender, ImageClickEventArgs e)
{
GridView1.Visible = true;
PlaceHolder1.Visible = false;
Panel2.Visible = false;
Panel1.Visible = true;
}

105
protected void ImageButton8_Click(object sender, ImageClickEventArgs e)
{
GridView1.Visible = true;
PlaceHolder1.Visible = false;
Panel3.Visible = false;
Panel1.Visible = true;
}
protected void ImageButton7_Click(object sender, ImageClickEventArgs e)
{
com = new SqlCommand("update employee set name='" +
this.TextBox1.Text + "',dsg='" + this.DropDownList1.Text + "',sex='" +
this.RadioButtonList1.Text + "',age='" + this.TextBox2.Text + "',address='" +
this.TextBox3.Text + "',email='" + this.TextBox4.Text + "',mobile='" +
this.TextBox7.Text + "' where emp_id='" + k_id + "'", con);
con.Open();
com.ExecuteNonQuery();
bind();
con.Close();
GridView1.Visible = true;
Panel3.Visible = false;
Panel1.Visible = true;
PlaceHolder1.Visible = false;
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
da = new SqlDataAdapter("select emp_id 'Emp Id',name 'Name',dsg
'Designation',sex 'Sex',age 'Age',address 'Address',mobile 'Mobile No.',email
'E-Mail'from employee", con);
da.Fill(ds, "tt");
for (int i = 0; i < ds.Tables["tt"].Rows.Count; i++)
{
CheckBox ck = (CheckBox)
(this.GridView1.Rows[i].Cells[0].Controls[1]);
ck.Checked = true;
}
}
}

Airport Manager Page

105
Code For Airport Manager Page

using System;
using System.Data;

105
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["AirlineConnectionString"
].ToString());
SqlCommand com = new SqlCommand();
SqlDataAdapter da;
DataSet ds = new DataSet();
SqlCommandBuilder bb;
static string k_id = null;
public void bind()
{
da = new SqlDataAdapter("select iata 'IATA',a_name 'Airport
Name',city 'City',state 'State'from airport", con);
da.Fill(ds, "tt");
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
}
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack == false)
{
bind();
}
}
protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
{
this.TextBox1.Text = "";
this.TextBox2.Text = "";
this.TextBox3.Text = "";
this.TextBox4.Text = "";
GridView1.Visible = false;
Panel1.Visible = false;
PlaceHolder1.Visible = true;
Panel2.Visible = true;
TextBox1.Enabled = true;
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
da = new SqlDataAdapter("select iata 'IATA',a_name 'Airport
Name',city 'City',state 'State'from airport", con);
da.Fill(ds, "tt");
int i = 0;
int j = 0;
int k = 0;
for (; i < ds.Tables["tt"].Rows.Count; i++)
{

105
CheckBox ck = (CheckBox)
(this.GridView1.Rows[i].Cells[0].Controls[1]);
if (ck.Checked == true)
{
j = 1;
k = 0;
string str = this.GridView1.Rows[i].Cells[1].Text;
//Response.Write(str);
k_id = str;
ds.Clear();
com = new SqlCommand("select * from airport where iata='" +
str + "'", con);
con.Open();
SqlDataReader reader = com.ExecuteReader();
while (reader.Read())
{
TextBox1.Text = reader["iata"].ToString();
this.TextBox2.Text = reader["a_name"].ToString();
this.TextBox3.Text = reader["city"].ToString();
this.TextBox4.Text = reader["state"].ToString();

}
con.Close();
GridView1.Visible = false;
Panel1.Visible = false;
Panel3.Visible = true;
PlaceHolder1.Visible = true;
TextBox1.Enabled = false;
}
else
{
k = 1;
}

}
if (k == 1 && j != 1)
{
Response.Write("<script> alert('Please select a User from the
list to edit')</script>");
}

}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
da = new SqlDataAdapter("select iata 'IATA',a_name 'Airport
Name',city 'City',state 'State'from airport", con);
da.Fill(ds, "tt");
int i = 0;
int j = 0;
int k = 0;
for (; i <= ds.Tables["tt"].Rows.Count - 1; i++)
{
CheckBox ck = (CheckBox)
(this.GridView1.Rows[i].Cells[0].Controls[1]);
if (ck.Checked == true)
{
ds.Tables["tt"].Rows[i].Delete();

105
j = 1;
k = 0;
}
else
{
k = 1;
}
}
if (k == 1 && j != 1)
{
Response.Write("<script> alert('Please select a User from the
list to delete')</script>");
}
bb = new SqlCommandBuilder(da);
da.Update(ds, "tt");
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
}
protected void ImageButton5_Click(object sender, ImageClickEventArgs e)
{
com = new SqlCommand("insert into
airport(iata,a_name,city,state)values('" + this.TextBox1.Text + "','" +
this.TextBox2.Text + "','" + this.TextBox3.Text + "','" + this.TextBox4.Text
+ "')", con);
con.Open();
com.ExecuteNonQuery();
bind();
con.Close();
GridView1.Visible = true;
PlaceHolder1.Visible = false;
Panel2.Visible = false;
Panel1.Visible = true;
}
protected void ImageButton6_Click(object sender, ImageClickEventArgs e)
{
GridView1.Visible = true;
PlaceHolder1.Visible = false;
Panel2.Visible = false;
Panel1.Visible = true;
}

protected void ImageButton8_Click(object sender, ImageClickEventArgs e)


{
GridView1.Visible = true;
PlaceHolder1.Visible = false;
Panel3.Visible = false;
Panel1.Visible = true;
}
protected void ImageButton7_Click(object sender, ImageClickEventArgs e)
{
com = new SqlCommand("update airport set a_name='" +
this.TextBox2.Text + "',city='" + this.TextBox3.Text + "',state='" +
this.TextBox4.Text + "'where iata='" + k_id + "'", con);
con.Open();
com.ExecuteNonQuery();
bind();
con.Close();

105
GridView1.Visible = true;
Panel3.Visible = false;
Panel1.Visible = true;
PlaceHolder1.Visible = false;
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
da = new SqlDataAdapter("select iata 'IATA',a_name 'Airport
Name',city 'City',state 'State'from airport", con);
da.Fill(ds, "tt");
for (int i = 0; i < ds.Tables["tt"].Rows.Count; i++)
{
CheckBox ck = (CheckBox)
(this.GridView1.Rows[i].Cells[0].Controls[1]);
ck.Checked = true;
}
}
}

Flight Details Page

105
Code For Flight Details Page

105
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["AirlineConnectionString"
].ToString());
SqlCommand com = new SqlCommand();
SqlDataAdapter da;
DataSet ds = new DataSet();
SqlCommandBuilder bb;
static string k_id = null;
public void bind()
{
da = new SqlDataAdapter("select f_no 'Flight No.',src 'Origin',dest
'Destination',via 'Via',days 'Days Operated',f_dept_time
'Departure',f_arr_time 'Arrival' from flight_details ", con);
da.Fill(ds, "tt");
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
}
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack == false)
{
bind();
}
}
protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
{
TextBox1.Enabled = true;
this.TextBox1.Text = "";
this.TextBox2.Text = "";
this.TextBox3.Text = "";
this.TextBox4.Text = "";
this.TextBox5.Text = "";
this.TextBox6.Text = "";
this.TextBox9.Text = "";
GridView1.Visible = false;
Panel1.Visible = false;
PlaceHolder1.Visible = true;
Panel2.Visible = true;
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
da = new SqlDataAdapter("select * from flight_details", con);
da.Fill(ds, "tt");

105
int i = 0;
int j = 0;
int k = 0;
for (; i < ds.Tables["tt"].Rows.Count; i++)
{
CheckBox ck = (CheckBox)
(this.GridView1.Rows[i].Cells[0].Controls[1]);
if (ck.Checked == true)
{
j = 1;
k = 0;
string str = this.GridView1.Rows[i].Cells[1].Text;
//Response.Write(str);
k_id = str;
ds.Clear();
com = new SqlCommand("select * from flight_details where
f_no='" + str + "'", con);
con.Open();
SqlDataReader reader = com.ExecuteReader();
while (reader.Read())
{
TextBox1.Enabled=false;
this.TextBox1.Text = reader["f_no"].ToString();
this.TextBox2.Text = reader["src"].ToString();
this.TextBox3.Text = reader["dest"].ToString();
this.TextBox4.Text = reader["days"].ToString();
this.TextBox5.Text = reader["f_dept_time"].ToString();
this.TextBox6.Text = reader["f_arr_time"].ToString();
this.TextBox9.Text = reader["via"].ToString();

}
con.Close();
GridView1.Visible = false;
Panel1.Visible = false;
Panel3.Visible = true;
PlaceHolder1.Visible = true;
}
else
{
k = 1;
}

}
if (k == 1 && j != 1)
{
Response.Write("<script> alert('Please select a User from the
list to edit')</script>");
}

}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
da = new SqlDataAdapter("select * from flight_details", con);
da.Fill(ds, "tt");
int i = 0;
int j = 0;
int k = 0;

105
for (; i <= ds.Tables["tt"].Rows.Count - 1; i++)
{
CheckBox ck = (CheckBox)
(this.GridView1.Rows[i].Cells[0].Controls[1]);
if (ck.Checked == true)
{
ds.Tables["tt"].Rows[i].Delete();
j = 1;
k = 0;
}
else
{
k = 1;
}
}
if (k == 1 && j != 1)
{
Response.Write("<script> alert('Please select a User from the
list to delete')</script>");
}
bb = new SqlCommandBuilder(da);
da.Update(ds, "tt");
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
}
protected void ImageButton5_Click(object sender, ImageClickEventArgs e)
{
com = new SqlCommand("insert into
flight_details(f_no,src,dest,days,f_dept_time ,f_arr_time,via)values('" +
this.TextBox1.Text + "','" + this.TextBox2.Text + "','" + this.TextBox3.Text
+ "','" + this.TextBox4.Text + "','" + this.TextBox5.Text + "','" +
this.TextBox6.Text + "','" + this.TextBox9.Text + "')", con);
con.Open();
com.ExecuteNonQuery();
bind();
con.Close();
GridView1.Visible = true;
PlaceHolder1.Visible = false;
Panel2.Visible = false;
Panel1.Visible = true;
}
protected void ImageButton6_Click(object sender, ImageClickEventArgs e)
{
GridView1.Visible = true;
PlaceHolder1.Visible = false;
Panel2.Visible = false;
Panel1.Visible = true;
}

protected void ImageButton8_Click(object sender, ImageClickEventArgs e)


{
GridView1.Visible = true;
PlaceHolder1.Visible = false;
Panel3.Visible = false;
Panel1.Visible = true;
}
protected void ImageButton7_Click(object sender, ImageClickEventArgs e)

105
{
com = new SqlCommand("update flight_details set src='" +
this.TextBox2.Text + "',dest='" + this.TextBox3.Text + "',days='" +
this.TextBox4.Text + "',f_dept_time='" + this.TextBox5.Text + "',f_arr_time='"
+ this.TextBox6.Text + "',via='" + this.TextBox9.Text + "'where f_no='" +
k_id + "'", con);
con.Open();
com.ExecuteNonQuery();
bind();
con.Close();
GridView1.Visible = true;
Panel3.Visible = false;
Panel1.Visible = true;
PlaceHolder1.Visible = false;
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
da = new SqlDataAdapter("select * from flight_details", con);
da.Fill(ds, "tt");
for (int i = 0; i < ds.Tables["tt"].Rows.Count; i++)
{
CheckBox ck = (CheckBox)
(this.GridView1.Rows[i].Cells[0].Controls[1]);
ck.Checked = true;
}
}
}

Flight Schedule Page

105
Code For Flight Schedule Page

using System;

105
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["AirlineConnectionString"
].ToString());
SqlCommand com = new SqlCommand();
SqlDataAdapter da;
DataSet ds = new DataSet();
SqlCommandBuilder bb;
static string k_id = null;
public void bind()
{
da = new SqlDataAdapter("select f_sl_no 'Schedule No',f_no 'Flight
No.',src 'Origin',dest 'Destination',via 'Via',days 'Days
Operated',f_dept_time 'Departure',f_arr_time 'Arrival',dod 'Eff From',doa
'Eff Till' from flight_schedule", con);
da.Fill(ds, "tt");
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
}
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack == false)
{
bind();
Panel4.Visible = false;
}
}
protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
{
this.TextBox1.Text = "";
this.TextBox2.Text = "";
this.TextBox3.Text = "";
this.TextBox4.Text = "";
this.TextBox5.Text = "";
this.TextBox6.Text = "";
this.TextBox9.Text = "";
GridView1.Visible = false;
Panel1.Visible = false;
Panel4.Visible = true;
Panel2.Visible = true;
Label11.Visible = false;
TextBox10.Visible = false;
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{

105
Label11.Visible = true;
TextBox10.Visible = true;
TextBox10.Enabled = false;
da = new SqlDataAdapter("select f_sl_no 'Schedule No',f_no 'Flight
No.',src 'Origin',dest 'Destination',via 'Via',days 'Days
Operated',f_dept_time 'Departure',f_arr_time 'Arrival',dod 'Eff From',doa
'Eff Till' from flight_schedule", con);
da.Fill(ds, "tt");
int i = 0;
int j = 0;
int k = 0;
for (; i < ds.Tables["tt"].Rows.Count; i++)
{
CheckBox ck = (CheckBox)
(this.GridView1.Rows[i].Cells[0].Controls[1]);
if (ck.Checked == true)
{
j = 1;
k = 0;
string str = this.GridView1.Rows[i].Cells[1].Text;
//Response.Write(str);
k_id = str;
ds.Clear();
com = new SqlCommand("select * from flight_schedule where
f_sl_no='" + str + "'", con);
con.Open();
SqlDataReader reader = com.ExecuteReader();
while (reader.Read())
{
TextBox1.Text = reader["f_no"].ToString();
this.TextBox2.Text = reader["src"].ToString();
this.TextBox3.Text = reader["dest"].ToString();
this.TextBox4.Text = reader["days"].ToString();
this.TextBox5.Text = reader["f_dept_time"].ToString();
this.TextBox6.Text = reader["f_arr_time"].ToString();
this.TextBox9.Text = reader["via"].ToString();
this.TextBox10.Text = reader["f_sl_no"].ToString();

}
con.Close();
GridView1.Visible = false;
Panel1.Visible = false;
Panel3.Visible = true;
Panel4.Visible = true;
}
else
{
k = 1;
}

}
if (k == 1 && j != 1)
{
Response.Write("<script> alert('Please select a User from the
list to edit')</script>");
}

105
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
da = new SqlDataAdapter("select f_sl_no 'Schedule No',f_no 'Flight
No.',src 'Origin',dest 'Destination',via 'Via',days 'Days
Operated',f_dept_time 'Departure',f_arr_time 'Arrival',dod 'Eff From',doa
'Eff Till' from flight_schedule", con);
da.Fill(ds, "tt");
int i = 0;
int j = 0;
int k = 0;
for (; i <= ds.Tables["tt"].Rows.Count - 1; i++)
{
CheckBox ck = (CheckBox)
(this.GridView1.Rows[i].Cells[0].Controls[1]);
if (ck.Checked == true)
{
ds.Tables["tt"].Rows[i].Delete();
j = 1;
k = 0;
}
else
{
k = 1;
}
}
if (k == 1 && j != 1)
{
Response.Write("<script> alert('Please select a User from the
list to delete')</script>");
}
bb = new SqlCommandBuilder(da);
da.Update(ds, "tt");
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
}
protected void ImageButton5_Click(object sender, ImageClickEventArgs e)
{
com = new SqlCommand("insert into
flight_schedule(f_no,src,dest,days,f_dept_time ,f_arr_time
,dod,doa,via)values('" + this.TextBox1.Text + "','" + this.TextBox2.Text +
"','" + this.TextBox3.Text + "','" + this.TextBox4.Text + "','" +
this.TextBox5.Text + "','" + this.TextBox6.Text + "','" +
this.RadDatePicker1.SelectedDate.Value.ToShortDateString() + "','" +
this.RadDatePicker2.SelectedDate.Value.ToShortDateString() + "','" +
this.TextBox9.Text + "')", con);
con.Open();
com.ExecuteNonQuery();
bind();
con.Close();
GridView1.Visible = true;
Panel4.Visible = false;
Panel2.Visible = false;
Panel1.Visible = true;
}
protected void ImageButton6_Click(object sender, ImageClickEventArgs e)
{

105
GridView1.Visible = true;
Panel4.Visible = false;
Panel2.Visible = false;
Panel1.Visible = true;
}

protected void ImageButton8_Click(object sender, ImageClickEventArgs e)


{
GridView1.Visible = true;
Panel4.Visible = false;
Panel3.Visible = false;
Panel1.Visible = true;
}
protected void ImageButton7_Click(object sender, ImageClickEventArgs e)
{
com = new SqlCommand("update flight_schedule set f_no='" +
this.TextBox1.Text + "',src='" + this.TextBox2.Text + "',dest='" +
this.TextBox3.Text + "',days='" + this.TextBox4.Text + "',f_dept_time='" +
this.TextBox5.Text + "',f_arr_time='" + this.TextBox6.Text + "',dod='" +
this.RadDatePicker1.SelectedDate.Value.ToShortDateString() + "',doa='" +
this.RadDatePicker2.SelectedDate.Value.ToShortDateString() + "',via='" +
this.TextBox9.Text + "'where f_sl_no='" + k_id + "'", con);
con.Open();
com.ExecuteNonQuery();
bind();
con.Close();
GridView1.Visible = true;
Panel3.Visible = false;
Panel1.Visible = true;
Panel4.Visible = false;
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
da = new SqlDataAdapter("select f_sl_no 'Schedule No',f_no 'Flight
No.',src 'Origin',dest 'Destination',via 'Via',days 'Days
Operated',f_dept_time 'Departure',f_arr_time 'Arrival',dod 'Eff From',doa
'Eff Till' from flight_schedule", con);
da.Fill(ds, "tt");
for (int i = 0; i < ds.Tables["tt"].Rows.Count; i++)
{
CheckBox ck = (CheckBox)
(this.GridView1.Rows[i].Cells[0].Controls[1]);
ck.Checked = true;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
com = new SqlCommand("select * from flight_details where f_no='" +
this.TextBox1.Text + "'", con);
con.Open();
SqlDataReader reader = com.ExecuteReader();
while (reader.Read())
{

this.TextBox2.Text = reader["src"].ToString();
this.TextBox3.Text = reader["dest"].ToString();
this.TextBox4.Text = reader["days"].ToString();

105
this.TextBox5.Text = reader["f_dept_time"].ToString();
this.TextBox6.Text = reader["f_arr_time"].ToString();
//this.TextBox8.Text = reader["doa"].ToString();
this.TextBox9.Text = reader["via"].ToString();

}
}
}

Passengers Details Page

105
Code For Passengers Details Page
using System;
using System.Data;
using System.Configuration;
using System.Collections;

105
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

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


{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["AirlineCon
nectionString"].ToString());
SqlCommand com = new SqlCommand();
SqlDataAdapter da;
DataSet ds = new DataSet();
public void bind()
{
da = new SqlDataAdapter("select fname + ' ' + lname AS
Name,gender 'Gender',age 'Age',mobile,land,email from
passenger_details where date='" + this.TextBox1.Text + "' and
f_sl_no='" + this.TextBox2.Text + "'", con);
da.Fill(ds, "tt");
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
}
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
bind();
}
}

Tables of the Airline Database

Flight Details Table


105
Flight Schedule Table

105
Passengers Details Table

105
Seat Table

105
Future Scope

105
Though the system is working well and efficiently, there
are still some scopes for future enhancement.

• The system may be further simplified.

• Database can be further normalized.

• There may be many more features that can be


added.

• Further we add the international flights details into


our databases.

• More advance and efficient techniques can be used


to increase speed and efficiency.

Limitations

105
There are certain limitations in this project that can be
stated as follows:

 The database may not be normalized to unlimited


level.

 There are limited data in the database.

 The system has not been compared with other


similar kind of system to check its efficiency.

Conclusion

105
The project is designed to execute accurately as Internet/Intranet
based system. It operates using many terminals, which are
connected with the server through internet/intranet and update
the data, as well as queries to server and also get various reports.
The web based features shall help the customer to know/book
flight from anywhere and any type of OS. This project is a cost
effective solution for any small or big airlines. The scope of this
system is very wide. Any type of small to large aviation can think
of implements this system. The feasibility and idea of this project
is being acquired from the quick launch of a few new private
airlines that needs a preferably robust, extensive and scalable
solution for their flight management. Unlike other airline systems,
they require a system which mainly deals with dynamic fare
(DynaFare) calculation based on demand criteria and baseline
prices. This dynamic fare calculation process made this system
unique and thus helping the presently airline system and its
operation. This project is focusing on to that customer group.

105
Bibliography

Books
Following books and websites has been used for making this project work

• HTML Black Book


• Asp.Net Black Book
• Introduction to SQl Server
• Database Concept by Korth
• Software Project Management by Rajiv Mall

Websites Reffered
• www.wikipedia.org
• www.google.co.in
• www.dotnetspider.com
• www.microsoft.com
• www.airdecan.net
• www.jetlite.com

105

Vous aimerez peut-être aussi