Air Reservation System

63
AIR TICKET BOOKING SYSTEM Submitted in partial fulfillment of the requirement For the award of degree of Bachelor of Technology In Computer Science & Engineering FACULITY GUIDE: SUBMITTED BY: Ms. Rupali Rohankar Vidya Niwas Mishra (A2305208501) 3 nd Year (5 th Semester) Amity School of Engineering and Technology Amity University, Noida (2008-2012)

Transcript of Air Reservation System

Page 1: Air Reservation System

AIR TICKET BOOKING SYSTEMSubmitted in partial fulfillment of the requirement

For the award of degree of

Bachelor of Technology In

Computer Science & EngineeringFACULITY GUIDE: SUBMITTED BY:

Ms. Rupali Rohankar Vidya Niwas Mishra (A2305208501)

3nd Year (5th Semester)

Amity School of Engineering and TechnologyAmity University, Noida

(2008-2012)

Page 2: Air Reservation System

ACKNOWLEDGEMENT

We would like to take this opportunity to express my gratitude towards all the people

who have in various ways, helped in the successful completion of my project.

We must convey our gratitude to Ms. Rupali Rohankar for giving me the constant

source of inspiration and help in preparing the project, personally correcting my work

and

providing encouragement throughout the project.

I also thank all my faculty members for steering me through the tough as well as

easy phases of the project in a result oriented manner with concern attention.

.

Vidya Niwas Mishra

Page 3: Air Reservation System

TABLE OF CONTENT

1. Introduction

2. Material and Methods

1. Understanding Air Ticket Booking System

2. Creating Database for Air Ticket Booking

1. Outline of the Project

2. E-R Diagram for Booking Department (Domestic)

3. E-R Diagram for Booking Department (International)

4. E-R Diagram for Cancellation (International)

5. E-R Diagram for Cancellation (Domestic)

3. Algorithms

1. Algorithm for Booking

2. Algorithm for Cancellation

3. Algorithm for Airport Locator

4. Algorithm for Availability Check

4. Establishing Connection

5. System Requirements

1. Hardware Requirements

2. Software Requirements

6. Material Used

3. Results and Discussion

1. Codes

2. Screenshots

4. Conclusion

5. Implication for Future Research

6. Reference

Page 4: Air Reservation System

ABSTRACT

This Air Ticket Booking System project has accomplished the implementation of SQL

Queries and the development of the programming skills of an individual. It is a

microscopic clone of the actual air ticket booking system. The database is read by C

sharp programming language wherein SQL Queries are applied for the retrieval and

manipulation of the data.

This particular technical system of retrieval and manipulation of data is fast and reliable

and is also error free while adjudging it as user friendly. On the other hand stands the

counterpart which is the manual system. It is time consuming and more prone to errors,

also at times the approach to various problems is unstructured, therefore acknowledging

it as redundant.

The new technical system that has been developed in this project is a direct outcome of

the demands made by the airline industry for a faster system with accuracy and

reliability along with providing the customers a user friendly and informative system.

The new system is even capable of allowing customers to make reservations or

cancellations from any given place, hence allowing them complete freedom.

The system in question has a wide and varied scope. The scope of this air ticket booking

system is in direct relation to the feasibility of the said project. The three major

feasibilities are economic, technical and operational. While the economic and technical

scope for this new technical system is beyond that of the manual system but in the case

of operational scope the technical system lags.

When considering the economic scope we see that with the old manual system the

operating cost amounted to 60 lacks per annum, this cost comprises the salary of 25

people, stationary, building rent, electricity, water, telephone etc. whereas with the new

system the cost is reduced by about 40 lacks and amounts to a minimum of 20 lacks per

annum. One can easily see that with such a high reduction in the cost the scope of this

new system far exceeds that of the old one.

Page 5: Air Reservation System

Similar is the case with the technical scope where we observe that the new system

requires only six trained person to work with the system and overall ten people per

office are more than sufficient. So all that is required of us is to identify and train the six

best people from the already existing system. Since our existing system is purely

manual, we only need a one time investment of Rs. 4 lacks for the purchase of 7

computers, 5 Ticket printers, a laser printer, AC and networking etc. It requires 20

Lacks per annum as its operating cost. With the above details our system is technically

feasible for after investing 24 lacks in a full year, the company is still saving Rs. 25

Lacks per annum. Again the new system surpasses the older one hence deeming its

scope better in the field of technicality.

The only one scope that is limited with the new system is the operational scope since the

new system calls for the expulsion of at least fifteen employees from the company. It

can create an environment of joblessness and fear among the employees. It can also lead

to an indefinite strike in the company and hence it is required by the management to

take corrective measures to avoid such a situation.

Page 6: Air Reservation System

INTRODUCATION

The focus of this project is to develop an Air Ticket Booking System which is better than the existing systems. Understanding the air ticket booking system was a necessary step to move forward with the project and to create one.

The Air Ticket Booking System is connected to an airline reservation system which is linked to a database which processes the queries and retrieves the data from the database for manipulation. It also saves the processed query into the data base so as to be able to retrieve it for further manipulation if the need arises. Also the air line reservation system generates a report about the changes in the database such as the command list, passenger list etc. Tickets are booked via the above mentioned pathway.

This Air Ticket Booking System is totally executable and that too with just a double click on the vivap.exe. It has been programmed in such a manner that it is error free and exceptional handling has been used for this purpose.

Page 7: Air Reservation System

MATERIALS AND METHODS

1. Understanding Air Ticket Booking System:

An Airline Reservation System is part of the so-called Passenger Service

Systems (PSS), which are applications supporting the direct contact with the

passenger.

The Airline Reservations System (ARS) was one of the earliest changes to

improve efficiency. ARS eventually evolved into the Computer Reservations

System (CRS). A Computer Reservation System is used for the reservations of a

particular airline and interfaces with a Global Distribution System (GDS) which

supports travel agencies and other distribution channels in making reservations

for most major airlines in a single system. An airline’s inventory contains all

flights with their available seats. The inventory of an airline is generally divided

into service classes (e.g. First, Business or Economy class) and up to 26 booking

classes, for which different prices and booking conditions apply. Inventory data

is imported and maintained through a Schedule Distribution System over

standardized interfaces. One of the core functions of the inventory management

is the inventory control. Inventory control steers how many seats are available in

the different booking classes, by opening and closing individual booking classes

for sale. In combination with the fares and booking conditions stored in the Fare

Quote System the price for each sold seat is determined. In most cases inventory

control has a real time interface to an airline’s Yield management system to

support a permanent optimization of the offered booking classes in response to

changes in demand or pricing strategies of a competitor

Page 8: Air Reservation System

2. Creating Database for Air Ticket Booking

Outline of the Project

Page 9: Air Reservation System

E-R DIAGRAM FOR BOOKING DEPARTMENT (DOMESTIC)

PASSENGER

Name

Email ID ContactNumber

Age

PNR

Seat Available ?

VALID?

BOOKING ON THE SPOT

MODE OF PAYMENT

CASH

CARD

PNR

Name

CLASSCASH PAID

PNR

Name

CLASSCASH PAID

Page 10: Air Reservation System

E-R DIAGRAM FOR BOOKING DEPARTMENT

(INTERNATIONAL)

PASSENGER

Name

Email ID ContactNumber

Age

PNR

Seat Available ?

VALID?

BOOKING ON THE SPOT

MODE OF PAYMENT

CASH

CARD

PNR

Name

CLASSCASH PAID

PNR

Name

CLASSCASH PAID

PASSPORT NUMBER

Page 11: Air Reservation System

E-R DIAGRAM FOR CANCELLATION (INTERNATIONAL)

3.

PASSENGER

Name

Email ID ContactNumber

Age

PNR

CACEL?

CANCEL PNR

Name

CLASSCASH PAID

PASSPORT NUMBER

Page 12: Air Reservation System

E-R DIAGRAM FOR CANCELLATION (DOMESTIC)

4.

PASSENGER

Name

Email ID ContactNumber

Age

PNR

CACEL?

CANCEL PNR

Name

CLASSCASH PAID

Page 13: Air Reservation System

3. Algorithms

ALGORITH FOR BOOKING

A COSTUMER COME FOR TICKET BOOKING

THEN HE HIS FLIGHT TYPE i.e. DOMESTIC or INTERNATIONAL.

THEN HE WILL CHOSE HIS DEPARTURE POINT, ARRIVAL

POINT, NUMBER OF PASSENGERS, CLASS and DATE OF

JOURNEY.

THEN THE COMPUTER WILL CHECK FLIGHTS FOR THE GIVEN

DATE BETWEEN THE STATIONS

IF NO FLIGHT IS FOUND :MESSAGE WILL BE

DISPLAYED

IF FLIGHT IS FOUND, IT WILL THEN CHECK FOR

AVAILABLE SEATS.

o IF NUMBER OF AVAILABLE SEATS ARE LESS

THEN ASKED SEATS THEN :MESSAGE WILL BE

DISPLAYED

o ELSE THE COSTUMER IS DIRECTED TO

PASSENGER’S INFORMATIONA FORM.

AND AFTER THAT PAYMENT OPTION IS

DISPLAYED. AFTER PAYMENT TICKET IS

BOOKED AND PRINT OUT IS GIVEN.

Page 14: Air Reservation System

ALGORITHM FOR CANCELLATION

A USER WANTS TO CANCEL TICKET.

THEN HE CLICK ON THE CANCEL TICKET AND CHOSE HIS FLIGHT

TYPE

THEN HE WILL FILL IN THE REQUIRED DETAILS ALONG WITH

HIS/HER PNR.

THEN THE COMPUTER WILL SEARCH THE DATABASE

IF NO DATA IS FOUND : ERROR MESSAGE WILL BE

GENERATED

IF BOOKING IS FOUND : SHOW THE CONTENT

o THEN USER WILL CHOSE THE PASSENGER’S FOR

CANCELLATION OR CAN CANCEL FULL TICKET.

o REFUND AND PRINT OUT IS GIVEN TO THE CUSTOREM.

Page 15: Air Reservation System

ALGORITHM FOR AIRPORT LOCATOR

THE COSTUMER WILL CLICK THE AIRPORT FINDER LINK

ON A NEW FORM, THE COSTUMER IS ALLOWED TO CHOSE

STATES AND THEN HIT THE SEARCH BUTTON

THE COMPUTER WILL SEARCH THE DATABASE AND

RETRIEVE THE NAME AND LOCATION OF AIRPORTS PRESENT

IN THAT STATE.

THE RESULT IS SHOWN ON THE FORM.

Page 16: Air Reservation System

ALGORITHM FOR AVAILABILITY CHECK

WHEN AVAILABILITY CHECH IS CLICKED A NEW FORM WILL

OPEN.

THE PERSON IS ASKED TO FILL IN ALL THE REQUIRED

DETAILS AND CLICK SEARCH FLIGHT.

WHEN SEARCH FLIGHT IS CLICKED THE COMPUTER WILL

SEARCH THE DATABASE FOR THE FLIGHT FOR THE GIVEN

DATE AND STATIONS.

THE LIST OF FLIGHT IS SHOWN. THE USER CAN CLICK ON

THE BUTTON NEXT TO THE FLIGHT TO GET ITS

AVAILABILITY.

THE MESSAGE IS DISPLAYED AS SOON AS ANY FLIGHT IS

CHOSEN.

(FOR DOMESTIC FLIGHTS

TOTAL SEATS IN ECONOMY CLASS IS 60

AND TOTAL SEATS IN BUSINESS CLASS IS 30

FOR INTERNATIONAL FLIGHTS

TOTAL SEATS IN ECONOMY CLASS IS 100

AND TOTAL SEATS IN BUSINESS CLASS IS 50)

Page 17: Air Reservation System

4. Establishing Connection

Once the GUI was designed .NET FRAMEWORK using C# is programming language,

it was time for us to provide database functionality. ADO.NET is used to connect our

GUI with the database and the database which is used in our project is SQL server 2005.

We created database for Airport Finder and separate table is made for each State. We

also created separate database for the example cities for Air Ticket Booking also

separate database is made for each flights. The flight database contains two tables

Economy_”Date”

Business_”Date”

(“Date” is Variable)

Several “Try Catch” statements are used in the creation of the tables in the databases

and once the database is accessed through SqlConnection(“Connection String”) class,

the tables are created by using SqlCommand(“SQL QUERY”) class.

Then by using various DDL (Data Definition Language) and DML (Data Manipulation

Language) are used to for making the project work.

Page 18: Air Reservation System

5. System Requirements

HARDWARE REQUIREMENTS

1. 2 GB Hard Disk

2. 512 MB or more Ram

3. Monitor

4. Keyboard

5. Recommended: Pentium Processor 1 GHz or Faster

SOFTWARE REQUIREMENTS

1) Microsoft .Net Framework 4

2) SQL server 2005 or above

3) Operating System:

Windows 7

Windows Server 2003

Windows Vista

Windows XP Service Pack 3

Page 19: Air Reservation System

6. Material Used

Visual Studio 2008

.Net Framework v3.5

ADO.Net

C#

SQL server 2005

Photoshop CS2

Page 20: Air Reservation System

RESULTS AND DISCUSSIONS

After going through a lot of hurdles we finally are able to create an executable program

that can be executed just by double click on vivap.exe. Several Databases are created

and are populated with many tables that are created by dynamic coding. Our project is

the microscopic clone of the actual Air Ticket Booking System. The real Air Ticket

Booking system consists of airlines schedules, fare tariffs, passenger reservation and

ticket records. All the data is published on the GDS (Global Distribution System).

We programmed our project in such a way that there is no chance for error occurrence

or the occurrence of the exception. For achieving that we have used exceptional

handling. Several “try catch” statements have added to avoid all the exceptions.

After going through a lot of research material on www.scribd.com we found one

project which was designed under the guidance of Ms Sunita Bawari of JIMS

(Jagannath Institute of Management Sciences) by a sixth semester student. After

comparing our project with hers we found that the GUI of our project is better and our

programming is exceptional yet complex than hers. We also found out that she created

just one database and two tables in it where as the database schema of our project is like

the actual Air Ticket Booking System. Also our project gives many facilities to the user

i.e. Airport Finder and Availability Check.

The detailed source code would have taken more than 120 pages; hence we have kept it

in the CD-ROM attached with this project report to save the paper work. However the

simplest code from where we started our project is provided below:

Page 21: Air Reservation System

CODES FOR THE MAIN FORM

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;

namespace WindowsFormsApplication17{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void exitToolStripMenuItem_Click(object sender, EventArgs e) { Close(); }

private void aboutUsToolStripMenuItem_Click(object sender, EventArgs e) {

} Form2 f2; private void airportFinderToolStripMenuItem_Click(object sender, EventArgs e) { bool IsOpen = false; foreach (Form f in Application.OpenForms) { if (f.Text == "Form2") { IsOpen = true; f.Focus(); break; } }

if (IsOpen == false) { f2 = new Form2(); f2.MdiParent = this; f2.Show(); }

Page 22: Air Reservation System

}

private void aboutUsToolStripMenuItem1_Click(object sender, EventArgs e) { MessageBox.Show("This Software is designed by Vidya Niwas Mishra (Enrollment No:A2305208501), Vatsalya Mishra (Enrollment No:A2305208448) and Prateek Bamel (Enrollment No: A2305208518) of CS9(Y) under the guidance of Ms.Rupali Rohankar (Project Mentor). We are highly obliged to our HOD Col.Kaiser Singh for providing us with this oppourtunity to learn and flourish under the able guidance of Ms.Rupali Rohankar"); }

private void exitToolStripMenuItem1_Click(object sender, EventArgs e) { Close(); } Form3 f3; Form4 f4; private void roundTripToolStripMenuItem2_Click(object sender, EventArgs e) { bool IsOpen = false;

if (IsOpen == false) { f4 = new Form4(); f4.MdiParent = this; f4.Show(); } }

private void internationalFlightsToolStripMenuItem1_Click(object sender, EventArgs e) {

}

private void timer1_Tick(object sender, EventArgs e) {

}

private void domesticToolStripMenuItem1_Click(object sender, EventArgs e) { bool IsOpen = false; foreach (Form f in Application.OpenForms) { if (f.Text == "Form3") {

Page 23: Air Reservation System

IsOpen = true; f.Focus(); break; } } if (IsOpen == false) { f3 = new Form3(); f3.MdiParent = this; f3.Show(); } } Form6 f6; private void internationalToolStripMenuItem1_Click(object sender, EventArgs e) { bool IsOpen = false; foreach (Form f in Application.OpenForms) { if (f.Text == "Form6") { IsOpen = true; f.Focus(); break; } }

if (IsOpen == false) { f6 = new Form6(); f6.MdiParent = this; f6.Show(); }

} Form7 f7; private void domesticFlightsToolStripMenuItem_Click(object sender, EventArgs e) { bool IsOpen = false; foreach (Form f in Application.OpenForms) { if (f.Text == "Form7") { IsOpen = true; f.Focus(); break; } }

if (IsOpen == false)

Page 24: Air Reservation System

{ f7 = new Form7(); f7.MdiParent = this; f7.Show(); } } Form10 f10; private void internationalFlightsToolStripMenuItem2_Click(object sender, EventArgs e) { bool IsOpen = false; foreach (Form f in Application.OpenForms) { if (f.Text == "Form10") { IsOpen = true; f.Focus(); break; } } if (IsOpen==false) { f10 = new Form10(); f10.MdiParent = this; f10.Show(); } } Form13 f13; private void domesticBookingsToolStripMenuItem_Click(object sender, EventArgs e) { bool IsOpen = false; foreach (Form f in Application.OpenForms) { if (f.Text == "Form13") { IsOpen = true; f.Focus(); break; } }

if (IsOpen == false) { f13 = new Form13(); f13.MdiParent = this; f13.Show(); } }

Page 25: Air Reservation System

Form16 f16; private void internationalBookingsToolStripMenuItem_Click(object sender, EventArgs e) { bool IsOpen = false; foreach (Form f in Application.OpenForms) { if (f.Text == "Form16") { IsOpen = true; f.Focus(); break; } }

if (IsOpen == false) { f16 = new Form16(); f16.MdiParent = this; f16.Show(); } } Form20 f20; private void domesticToolStripMenuItem2_Click(object sender, EventArgs e) { f20 = new Form20(); f20.MdiParent = this; f20.Show(); } Form22 f22; private void internationalToolStripMenuItem2_Click(object sender, EventArgs e) { f22 = new Form22(); f22.MdiParent = this; f22.Show(); } }}

Page 26: Air Reservation System

CODES FOR BOOKING (DOMESTIC FLIGHTS)

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;

namespace WindowsFormsApplication17{ public partial class Form3 : Form { public Form3() { InitializeComponent(); }

private void monthcal_DateChanged(object sender, DateRangeEventArgs e) { monthcal.MinDate = DateTime.Now; label4.Text = monthcal.SelectionStart.DayOfWeek.ToString(); calcu.Text = monthcal.SelectionStart.Date.ToString(); } public void button1_Click(object sender, EventArgs e) { string a, b; a = from.Text; b = to.Text;

if (label9.Text == "kaka") { MessageBox.Show("Select Date of Journey"); } else if (a == b) { MessageBox.Show("Boarding and Destination cannot be same"); } else {

SqlConnection con = new SqlConnection("Data Source=ASHUTOSH-PC\\SQLEXPRESS;Initial Catalog=model;Integrated Security=True"); SqlCommand cmd = new SqlCommand("Select Flight_Name,Departure_Time,Arrival_Time,"+comboBox1.Text+"Fare From " +

Page 27: Air Reservation System

from.Text + " where Destination = '" + to.Text + "' and Travelling_Days like '%" + label4.Text + "%'", con); SqlDataAdapter da = new SqlDataAdapter(cmd);

SqlCommandBuilder commandBuilder = new SqlCommandBuilder(da); da.Fill(dtable); bsource.DataSource = dtable; dataGridView.DataSource = dtable; DataGridViewButtonColumn buttonColumn = new DataGridViewButtonColumn(); buttonColumn.Name = "Book"; buttonColumn.HeaderText = "Click to Book"; buttonColumn.Text = "Book"; dataGridView.Columns.Add(buttonColumn); fs.Show(); } } BindingSource bsource = new BindingSource(); DataTable dtable = new DataTable();

string x; double f; private void monthcal_DateChanged_1(object sender, DateRangeEventArgs e) { monthcal.MinDate = DateTime.Now; label4.Text = monthcal.SelectionStart.DayOfWeek.ToString(); calcu.Text = monthcal.SelectionStart.Date.ToLongDateString(); label9.Text = monthcal.SelectionStart.Date.ToLongDateString(); f = monthcal.SelectionStart.Date.ToOADate(); } DataGridView da; int a; private void dataGridView_CellClick(object sender, DataGridViewCellEventArgs e) { if (comboBox1.Text == "Economy") { try { Form3 f3 = new Form3(); SqlConnection conn = new SqlConnection("Data Source=ASHUTOSH-PC\\SQLEXPRESS;Initial Catalog=" + x + ";Integrated Security=True"); SqlCommand cmd1 = new SqlCommand("Select * from " + comboBox1.Text + "_" + f + "", conn); DataTable dtb = new DataTable(); SqlDataAdapter daa = new SqlDataAdapter(cmd1); SqlCommandBuilder commandbuilder = new SqlCommandBuilder(daa); daa.Fill(dtb); BindingSource bs = new BindingSource();

Page 28: Air Reservation System

bs.DataSource = dtb; DataGridView dv = new DataGridView(); dv.Location = new Point(640, 255); dv.Size = new Size(1, 1); dv.DataSource = dtb; f3.Controls.Add(dv); dv.Rows.Count.ToString(); string z = dv.Rows[0].Cells[0].Value.ToString(); int y = Convert.ToInt32(z); int c = 60 - y; string n = adults.Text; int m = Convert.ToInt32(n); if (m > c) { MessageBox.Show("Not Enough seats for " + n + " Passengers"); }

} catch (Exception) { } } else { try { Form3 f3 = new Form3(); SqlConnection conn = new SqlConnection("Data Source=ASHUTOSH-PC\\SQLEXPRESS;Initial Catalog=" + x + ";Integrated Security=True"); SqlCommand cmd1 = new SqlCommand("Select * from " + comboBox1.Text + "_" + f + "", conn); DataTable dtb = new DataTable(); SqlDataAdapter daa = new SqlDataAdapter(cmd1); SqlCommandBuilder commandbuilder = new SqlCommandBuilder(daa); daa.Fill(dtb); BindingSource bs = new BindingSource(); bs.DataSource = dtb; DataGridView dv = new DataGridView(); dv.Location = new Point(640, 255); dv.Size = new Size(1, 1); dv.DataSource = dtb; f3.Controls.Add(dv); dv.Rows.Count.ToString(); string g = dv.Rows[0].Cells[0].Value.ToString(); int h = Convert.ToInt32(g); int j = 30 - h; string q = adults.Text; int w = Convert.ToInt32(q); if (w > j)

Page 29: Air Reservation System

{ MessageBox.Show("Not Enough seats for " + q + " Passengers"); }

} catch (Exception) { } } fs.Visible = false; Form5 f5 = new Form5(); f5.MdiParent = Form1.ActiveForm; f5.Show();

x = dataGridView.CurrentRow.Cells[1].Value.ToString(); string s = dataGridView.CurrentRow.Cells[4].Value.ToString(); SqlConnection con = new SqlConnection("Data Source=ASHUTOSH-PC\\SQLEXPRESS;Initial Catalog='" + x + "';Integrated Security=True"); SqlCommand cmd = new SqlCommand("Create table " + comboBox1.Text + "_" + f + " (name varchar(50),emailID varchar(100) NULL,contactnumber varchar(50) NULL,age varchar(50),pnr varchar(50));", con); try { con.Open(); cmd.ExecuteNonQuery(); con.Close(); } catch (Exception) {

} string k = adults.Text; a = Convert.ToInt32(k);

da = new DataGridView(); da.Location = new Point(12,175); da.Size = new Size(640,200); da.Columns.Add("Name", "Name"); da.Columns.Add("Email", "Email ID"); da.Columns.Add("Contact", "Contact Number"); da.Columns.Add("Age", "Age"); da.Rows.Add(a); da.BackgroundColor = Color.White; da.AllowUserToAddRows = false; da.AllowUserToDeleteRows = false; da.AllowUserToOrderColumns = false; da.AllowUserToResizeColumns = false; da.AllowUserToResizeRows = false;

Page 30: Air Reservation System

f5.Controls.Add(da); int coj = Convert.ToInt32(s); Button bt = new Button(); bt.Location = new Point(499, 93); bt.Size = new Size(118, 56); bt.Text = "Book Now"; bt.Click += new EventHandler(bt_Click); f5.Controls.Add(bt);

lbl = new Label(); lbl.Location = new Point(12,150 ); int sum = a * coj; string sum1 = Convert.ToString(sum); lbl.Text = "AirFare Rs " + sum1 + ""; lbl.BackColor = Color.White;

f5.Controls.Add(lbl); } Label lbl;

private void bt_Click(object sender, EventArgs e) { Form19 f19 = new Form19(); Label lbo = new Label(); lbo.Location = new Point(17, 56); lbo.Text = lbl.Text; f19.Controls.Add(lbo); RadioButton rb1 = new RadioButton(); rb1.Checked=false; rb1.CheckedChanged+=new EventHandler(rb1_CheckedChanged); rb1.Location = new Point(50, 99); rb1.Text = "Cash"; f19.Controls.Add(rb1); RadioButton rb2 = new RadioButton(); rb2.Location = new Point(50, 136); rb2.Text = "Card"; rb2.CheckedChanged+=new EventHandler(rb2_CheckedChanged); rb2.Checked=false; f19.Controls.Add(rb2); Form5 f5 = new Form5(); f5.Close(); f19.Show(); }

private void rb1_CheckedChanged(object sender, EventArgs e) { try

Page 31: Air Reservation System

{ Random pnr = new Random(); int b = pnr.Next(10000000, 99999999); string c = Convert.ToString(b); for (int doc = 0; doc < a; doc++) { SqlConnection con = new SqlConnection("Data Source=ASHUTOSH-PC\\SQLEXPRESS;Initial Catalog='" + x + "';Integrated Security=True"); SqlCommand cmd = new SqlCommand("Insert into " + comboBox1.Text + "_" + f + " values ('" + da.Rows[doc].Cells["Name"].Value.ToString() + "','" + da.Rows[doc].Cells["Email"].Value.ToString() + "','" + da.Rows[doc].Cells["Contact"].Value.ToString() + "'," + da.Rows[doc].Cells["Age"].Value.ToString() + ",'" + c + "');", con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); } PrintDialog ptr = new PrintDialog(); ptr.ShowDialog(); } catch (Exception) { MessageBox.Show("Personal Infromation is not filled correctly. Please Fill all the fields. In case any information is unavailable please type 'NA'.Kindly close the payment form and fill all the fields.");

} MessageBox.Show("Kindly Pay "+lbl.Text+""); Form5 f5 = new Form5(); Form19 f19 = new Form19(); f5.Close(); f19.Close(); Form3 f3=new Form3(); f3.Close(); } private void rb2_CheckedChanged(object sender, EventArgs e) { try { Random pnr = new Random(); int b = pnr.Next(10000000, 99999999); string c = Convert.ToString(b); for (int doc = 0; doc < a; doc++) { SqlConnection con = new SqlConnection("Data Source=ASHUTOSH-PC\\SQLEXPRESS;Initial Catalog='" + x + "';Integrated Security=True"); SqlCommand cmd = new SqlCommand("Insert into " + comboBox1.Text + "_" + f + " values ('" + da.Rows[doc].Cells["Name"].Value.ToString() + "','" + da.Rows[doc].Cells["Email"].Value.ToString() + "','" +

Page 32: Air Reservation System

da.Rows[doc].Cells["Contact"].Value.ToString() + "'," + da.Rows[doc].Cells["Age"].Value.ToString() + ",'" + c + "');", con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); } PrintDialog ptr = new PrintDialog(); ptr.ShowDialog(); } catch (Exception) { MessageBox.Show("Personal Infromation is not filled correctly. Please Fill all the fields. In case any information is unavailable please type 'NA'.Kindly close the payment form and fill all the fields.");

} Form5 f5 = new Form5(); Form19 f19 = new Form19(); f5.Close(); f19.Close(); Form3 f3 = new Form3(); f3.Close(); }

private void child_Click(object sender, EventArgs e) {

}

private void from_SelectedIndexChanged(object sender, EventArgs e) { }

private void from_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; }

private void to_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; }

private void adults_SelectedIndexChanged(object sender, EventArgs e) {

Page 33: Air Reservation System

}

private void adults_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; }

private void childs_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; }

private void infant_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; }

private void comboBox1_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; }

private void calcu_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; }

private void Form3_FormClosing(object sender, FormClosingEventArgs e) {

} }}

Page 34: Air Reservation System

CODES FOR CANCELLATION OF TICKET

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;

namespace WindowsFormsApplication17{ public partial class Form20 : Form { public Form20() { InitializeComponent(); } DataGridView dg1; Form21 f21; private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "") { MessageBox.Show("Please Enter PNR Number"); } else if (label9.Text == "kaka") { MessageBox.Show("Please Select Date of Journey"); } else { try { f21 = new Form21(); f21.MdiParent = Form1.ActiveForm; SqlConnection con = new SqlConnection("Data Source=ASHUTOSH-PC\\SQLEXPRESS;Initial Catalog=" + from.Text + ";Integrated Security=True;Pooling=False"); SqlCommand cmd = new SqlCommand("Select name,emailID,contactnumber,age From " + comboBox1.Text + "_" + f + " where pnr ='" + textBox1.Text + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd); SqlCommandBuilder cb = new SqlCommandBuilder(da); DataTable dt = new DataTable(); BindingSource s = new BindingSource(); da.Fill(dt); s.DataSource = dt;

Page 35: Air Reservation System

dg1 = new DataGridView(); dg1.Location = new Point(20, 156); dg1.AllowUserToAddRows = false; dg1.AllowUserToDeleteRows = true; dg1.AllowUserToOrderColumns = false; dg1.AllowUserToResizeColumns = false; dg1.AllowUserToResizeRows = false; dg1.BackgroundColor = Color.White; dg1.Size = new Size(640, 200); dg1.DataSource = dt; f21.Controls.Add(dg1); Button btn = new Button(); btn.Location = new Point(516,78); btn.Size = new Size(115,50); btn.Click -= new EventHandler(btn_Click); btn.Click += new EventHandler(btn_Click); btn.Text = "Done"; f21.Controls.Add(btn); f21.Show();

} catch { MessageBox.Show("Incorrect PNR or Filght Name or Date of Journey"); }

} } private void btn_Click(object sender, EventArgs e) { Random pnr1 = new Random(); int a = pnr1.Next(10000000, 99999999); SqlConnection conn = new SqlConnection("Data Source=ASHUTOSH-PC\\SQLEXPRESS;Initial Catalog=" + from.Text + ";Integrated Security=True;Pooling=False"); for (int i = 0; i < Convert.ToInt32(dg1.Rows.Count.ToString()); i++) { conn.Open(); SqlCommand cmd1 = new SqlCommand("Insert into " + comboBox1.Text + "_" + f + " values ('" + dg1.Rows[i].Cells[0].Value.ToString() + "','" + dg1.Rows[i].Cells[1].Value.ToString() + "','" + dg1.Rows[i].Cells[2].Value.ToString() + "','" + dg1.Rows[i].Cells[3].Value.ToString() + "','" + a.ToString() + "')", conn); cmd1.ExecuteNonQuery(); conn.Close(); PrintDialog ptr = new PrintDialog(); ptr.ShowDialog(); }

Page 36: Air Reservation System

SqlConnection con = new SqlConnection("Data Source=ASHUTOSH-PC\\SQLEXPRESS;Initial Catalog=" + from.Text + ";Integrated Security=True;Pooling=False"); SqlCommand cmd = new SqlCommand("Delete From " + comboBox1.Text + "_" + f + " where pnr = '"+textBox1.Text+"'", con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); }

double f; private void monthcal_DateChanged(object sender, DateRangeEventArgs e) { calcu.Text = monthcal.SelectionStart.Date.ToShortDateString(); label9.Text = monthcal.SelectionStart.Date.ToLongDateString(); f = monthcal.SelectionStart.Date.ToOADate(); monthcal.MinDate = DateTime.Now; }

private void from_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; }

private void comboBox1_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; }

}}

Page 37: Air Reservation System

CODES FOR AVALIBALITY CHECK

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;

namespace WindowsFormsApplication17{ public partial class Form7 : Form { public Form7() { InitializeComponent(); } DataTable dtable = new DataTable(); double f; private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e) { monthCalendar1.MinDate = DateTime.Now; label3.Text = monthCalendar1.SelectionStart.DayOfWeek.ToString(); textBox1.Text = monthCalendar1.SelectionStart.Date.ToLongDateString(); label4.Text = monthCalendar1.SelectionStart.Date.ToLongDateString(); f = monthCalendar1.SelectionStart.Date.ToOADate(); } DataGridView dataGridView; BindingSource bsource = new BindingSource(); Form8 f8; private void button1_Click(object sender, EventArgs e) { if (From.Text == To.Text) { MessageBox.Show("Boarding and Destination cannot be same"); } else if (label4.Text == "label4") { MessageBox.Show("Select Date for Availability Check"); } else { f8 = new Form8(); f8.MdiParent = Form1.ActiveForm; f8.Show();

Page 38: Air Reservation System

SqlConnection con = new SqlConnection("Data Source=ASHUTOSH-PC\\SQLEXPRESS;Initial Catalog=model;Integrated Security=True"); SqlCommand cmd = new SqlCommand("Select Flight_Name,Departure_Time,Arrival_Time," + comboBox1.Text + "Fare From " + From.Text + " where Destination = '" + To.Text + "' and Travelling_Days like '%" + label3.Text + "%'", con); SqlDataAdapter da = new SqlDataAdapter(cmd); SqlCommandBuilder commandBuilder = new SqlCommandBuilder(da); dataGridView = new DataGridView(); dataGridView.Location = new Point(12,154); dataGridView.Size = new Size(640,223); dataGridView.AllowUserToAddRows = false; dataGridView.AllowUserToDeleteRows = false; dataGridView.AllowUserToOrderColumns = false; dataGridView.AllowUserToResizeColumns = false; dataGridView.AllowUserToResizeRows = false; dataGridView.BackgroundColor = Color.White; dataGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCellsExceptHeaders; da.Fill(dtable); bsource.DataSource = dtable; dataGridView.DataSource = dtable; DataGridViewButtonColumn buttonColumn = new DataGridViewButtonColumn(); buttonColumn.Name = "Check"; buttonColumn.HeaderText = "Click to Check Availability"; buttonColumn.Text = "Chech"; dataGridView.Columns.Add(buttonColumn); dataGridView.CellClick+=new DataGridViewCellEventHandler(dataGridView_CellClick); f8.Controls.Add(dataGridView);

} }

private void dataGridView_CellClick(object sender, DataGridViewCellEventArgs e) { string x = dataGridView.CurrentRow.Cells[1].Value.ToString(); if (comboBox1.Text == "Economy") { try {

SqlConnection conn = new SqlConnection("Data Source=ASHUTOSH-PC\\SQLEXPRESS;Initial Catalog=" + x + ";Integrated Security=True"); SqlCommand cmd1 = new SqlCommand("Select count(*) from " + comboBox1.Text + "_" + f + "", conn);

Page 39: Air Reservation System

DataTable dtb = new DataTable(); SqlDataAdapter daa = new SqlDataAdapter(cmd1); SqlCommandBuilder commandbuilder = new SqlCommandBuilder(daa); daa.Fill(dtb); BindingSource bs = new BindingSource(); bs.DataSource = dtb; DataGridView dv = new DataGridView(); dv.Location = new Point(640,255); dv.Size = new Size(1, 1); dv.DataSource = dtb; f8.Controls.Add(dv); dv.Rows.Count.ToString(); string z = dv.Rows[0].Cells[0].Value.ToString();

int y = Convert.ToInt32(z); int c = 60 - y; MessageBox.Show("" + c.ToString() + " Seats are Available"); } catch (Exception) { MessageBox.Show("60 Seats are Available"); }

} else { try { SqlConnection conn1 = new SqlConnection("Data Source=ASHUTOSH-PC\\SQLEXPRESS;Initial Catalog=" + x + ";Integrated Security=True"); SqlCommand cmd11 = new SqlCommand("Select * from " + comboBox1.Text + "_" + f + "", conn1); DataTable dtb1 = new DataTable(); SqlDataAdapter daa1 = new SqlDataAdapter(cmd11); SqlCommandBuilder commandbuilder = new SqlCommandBuilder(daa1); daa1.Fill(dtb1); BindingSource bs1 = new BindingSource(); bs1.DataSource = dtb1; DataGridView dv1 = new DataGridView(); dv1.Location = new Point(640, 255); dv1.Size = new Size(1, 1); dv1.DataSource = dtb1; f8.Controls.Add(dv1); dv1.Rows.Count.ToString();

string g = dv1.Rows[0].Cells[0].Value.ToString(); int h = Convert.ToInt32(g); int j = 30 - h; MessageBox.Show("" + j.ToString() + " Seats are available");

Page 40: Air Reservation System

} catch { MessageBox.Show("30 Seats are Available"); } } } private void From_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; }

private void To_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; }

private void comboBox1_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; } }}

Page 41: Air Reservation System

SCREENSHOTS

The Main MDI (Multiple Document Interface) Form of the Application

Utilities have 24 Hours Clock and Phonetic Alphabets.

Page 42: Air Reservation System

Windows Form for Airport Finder

Select State and Hit the Search Button

Page 43: Air Reservation System

Windows Form for Availability Check

After filling all the Details click on Search Flight Button and click on your suitable

Flight button. A Message Box will pop out showing available number of seats.

Page 44: Air Reservation System

Booking Air Ticket (Domestic)

Window Form will be opened when Book Ticket >> Domestic is clicked.

After filling all the details click on search flight button and chose your flight according

to your feasibility. Passenger’s Information Form will appear.

Page 45: Air Reservation System

After filling all the details click on Book Now Button and Payment Option Form will

appear.

Page 46: Air Reservation System

Windows Form for Ticket Cancellation

After fill all the details click on GO button and the details of Passenger will be shown

on another Form.

Page 47: Air Reservation System

Select the row that user wants to delete and press delete key and then click on Done

button. The New Ticket will be Printed.

Page 48: Air Reservation System

CONCLUSION

After successful completion of our project we end up on a conclusion that.Net

Framework is a powerful tool for software development. Our Project is a microscopic

clone of the actual Air Ticket Booking System.

The system developed in this project proves to be great for booking agencies on due

time. The aforementioned system is not restricted to air tickets only and can be used for

booking movies, bus, train tickets for that matter by making some slight changes in the

coding of the system.

Page 49: Air Reservation System

IMPLICATIONS FOR FUTURE RESEARCH

Though the system still is containing lot of scope of improvement in it. But its overall

look and feel gives rough picture of on existing automation system.

We have used Microsoft SQL server 2005 at backhand and the maximum capacity of

the database size is 1,048,516 TB but limited but the number of object in a database

(Database objects include all tables, views, stored procedures, extended stored

procedures, triggers, rules, defaults, and constraints. The sum of the number of all these

objects in a database cannot exceed 2,147,483,647.) . Oracle can be used to break this

banner.

Page 50: Air Reservation System

REFERENCES

For Studying .Net

http://msdn.microsoft.com

www.dotnetspider.com

www.w3schools.com

For Project Images

http://aviationexplorer.com

Photoshop CS2

For Content of the Report

http://wikipedia.org