Airline Reservation System
Airline Reservation System
Airline Reservation System
SYSTEM
ACKNOWLEDGEMENT
SRIJAN GAUTAM
2
CONTENTS
INTRODUCTION
PROBLEM DEFINATION
2. FEASIBILITY STUDY
o ECONOMIC FEASIBIITY
o TECHNICAL FEASIBILITY
o OPERATIONAL FEASIBILITY.
3. SYSTEM ANALYSIS
4. SYSTEM DESIGN
o E-R DIAGRAM
o DATA FLOW DIAGRAM
o REPORTS
o TABLES.
5. PROJECT CATEGORY
6. HARDWARE SPECIFICATION
7. SOFTWARE SPECIFICATION
9. FUTURE ENHANCEMENT
10. BILBIOGRAPHY
3
INTRODUCTION
4
Objectives
5
Tools/Environment Used
Technology Used
1. VB.NET
2. Microsoft .NET FRAMEWORK 3.5
3. ADO.NET
Front End
1. VB.NET Window Forms Application
Back End
1. Microsoft SQL Server 2005
Languages Used
1. Visual Basic
Operating System
1. Microsoft Windows XP Professional SP-2
Reporting Tool
1. Crystal Reports 2008
6
ANALYSIS DOCUMENT
PROBLEM DEFINITION
The definition of our problem lies in manual system and a fully automated system.
Manual system(Existing) : The system is very time consuming and lazy. This system is more
prone to errors and sometimes the approach to various problems is unstructured.
Technical system(Proposed) : With the advent of latest technology if we do not update our
system then our business result in losses gradually with time. The technical systems contains
the tools of latest trend i.e. computers printers, fax, Internet etc. The systems with this
technology are very fast, accurate, user-friendly and reliable.
A few factors that directs us to develop a new system are given below -:
1) Faster System
2) Accuracy
3) Reliability
4) Informative
5) Centralized Control.
6) Reservations and cancellations from anywhere.
AIRLINES SYSTEM
RESERVATION CANCELLATION
UPDATION
7
FEASIBILITY STUDY
Feasibility study is to check the viability of the project under consideration. Theoretically various
types of feasibilities are conducted, but we have conducted three type of feasibilities explained as
under.
ECONOMIC FEASIBILITY
With the manual system the operating cost of the system is about 60 Lacks P.A.. This cost
comprises salary of 25 people, stationary, building rent, electricity, water, telephone etc. But with
the new system this reoccurring cost comes out to be about 20 Lacks P.A. Hence the new system is
economically feasible.
TECHNICAL FEASIBILITY
The new system requires only 6 trained person to work with the system and in overall 10 people
per office are sufficient. So we will identify 6 best people from existing system and train them.
As our existing system is purely manual, so we need a one time investment of Rs 4 Laks for the
purchase of 7 computers, 5 Ticket printers, a laser printer, AC and networking etc. It requires 20
Lacks PA as a operating cost.
With the above details our system is technically feasible as after investing 24 Lacks in a year, the
company is still saving Rs 25 Lacks PA.
OPERATIONAL FEASIBILITY
The new solution is feasible in all sence but operationally it is not. The new system demands the
expulsion of at least 15 people from the company. It creates an environment of joblessness and fear
among the employees. It can lead to an indefinite strike in the company also. So the management
must take corrective actions prior in advance in order to start the further proceedings.
8
BASIC FUNCTIONING OF AIRLINES RESERVATION
SYSTEM
This was the most important phase of my project life cycle .It had connected my maximum
time .The block diagram given bellow depict various fact which were understood by one during
the analysis phase.
BLOCKDIAGRAM
BOOKING
DEPARTMENT
PASSENGER
LIST
CONFIRMED
LIST
AIRLINE
PASSENGER RESERVATION REPORTS
SYSTEM WAITING LIST
CANCELLATION
Passenger list,
Fleet info
Ticket reservation concession
Cancellation, database Flight information,
Request for enquiry Fare details,
9
ANALYSIS DOCUMENT
SRS
1. INTRODUCTION
a. Purpose
The purpose of this SRS document is to describe the basic functioning and
operating requirements of the proposed system. This document will try to
explain all the external requiremtns that may be needed for the proposed
system to word smoothly and efficiently.
It also describes the basic framework of the proposed system, so as to help the
future developers in easy understanding and maintainance of the proposed
system.
b. Scope
i. In Scope:
1. Provide Automation of all the Reservation work carried out
nationvide through a centralized location.
2. Allow loggin to system from remote locations and allow
reservation from any airport to any airport where route does
exists.
3. Allow passenger to select seat of his own choice.
4. Manage Crew Details, Flight Details, Airport Details.
5. Manage Financial statements to show net profit or losses.
6. Allow Cancellation and should deduct cancellation charges as
applicable.
7. Will allow updation of flight fare whenever desired.
8. Provide Major Reports like Passenger master list, Reservation
chart, cash register etc.
ii. Crew :
10
Staff deputed on a flight, which help in smooth functioning of aircraft.
iii. PNR:
A System generated number to identify each ticket separately.
It is expected that in near future the airline market will be a very steep rise
and hence it will lead to opening of new airlines companies which will require
reservation softwares, we can provide this solution to them.
b. Product Functions:
Class of use case Use case Description of use case
Security Check Login User provide Userid and
Password. System check in
Database. If Both are correct.
System is Started.
Exit Exits from the system
Reservation Search Flight User Provides Origin and
Destination, select date of
journey. The system will
provide list of available
flights between airports.
Generate PNR User Selects Flight, Enter
Applicant name, address
phone no and generate PNR
Number
Reserve Seats User Provide Passenger
details for current PNR
Number.
Cancellation Search PNR User Enters PNR Number to
get applicant details
Cancel Ticket User verify details and then
cancel tickets.
11
Flight Management Search Search Flight on basis of
Flight Number, origin-
Destination
Add User Provide details of new
Flights and Add them to
system
Update Update existing flight details
Delete Delete Flights that have been
discontinued
Manage Flight Fare Search Search Flight fare on basis
on FlightFareID
Add User Provide details of new
Flights Fare and Add them to
system
Update Update Fare details
Delete Delete Fare details from
system
Manage Crew Search Search crew on basis of
CrewID
Add Add New Crew to the System
Update Update Crew Details.
Delete Delete Crew Details from the
System
Depute Depute idle crew members to
other flights.
Manage User Add Add New Users of this
system.
Update Update Password and
Locked status details of Users
Delete Delete Users
Password Reset Reset Password and Locked
status details of users.
c. User Characterstics
12
d. Constrains:
i. A good speed LAN/WAN network is desired for proper and speedy
connectivity of this system.
ii. Terminal PC should be running Windows XP or up with .NET
Framework 3.5 installed on them.
4. SPECIFIC REQUIREMENTS:
a. Hardware Requirements:
i. CPU - Pentium 4 or higher with 2.0 GHz Minimum
ii. RAM - 512 MB, Recommended 1 GB.
iii. SVGA Color wide screen Monitor with 1280x800 Resolution
iv. CD-Writer
v. Any Printer
vi. HDD - 20 GB Server.
vii. Qwerty Keyboard, Mouse
viii. Ethernet card 10 MBPS
ix. Working internet Connection/LAN/WAN Network.
b. Software Requirements:
i. Microsoft Windows XP SP-2 or UP.
ii. Microsoft .NET Framwork 3.5
iii. Crystal Reports 2010 Runtime
iv. Micosoft SqlServer 2005
c. EXTERNAL INTERFACE
i. The software should have low graphic content and should be designed
neatly using common controls. The appropriate colors should be used
whenever desired. The Interface should be GUI based, that allow
pointing device and touch screen functionality both.
d. PERFORMANCE REQUIREMENTS
i. The software should have internal memory optimization techniques
and should work with less memory and processing requirements.
Every form should open withing 0.5 Seconds on click to meet required
performance. The data retrieval should not exceed 3 Seconds in any
case.
e. LOGICAL DATABASE REQUIREMENTS
i. Database server should be capable of handling remote requests.
ii. Should support fault tolerance and provide good security over http.
iii. The tables should be normalized to 2 NF. Assumptions might be there.
iv. Constraints and foreign keys should be used to avoid data redundancy
and duplicity.
f. Design Constraints
i. Security:
Security to this application is prime concern because, it will work on
intranet/internet. Users with appropriate permissions should only be
allowed to access the resources.
13
The application should be designed in such a way that it will avoid any
crashes at runtime. Transactions features may be used in application to
avoid incomplete data insertion in database.
g. Acceptance Criteria
The developer must demonstrate that the application is working fine as per
requirements by inserting some dummy data and producing output for the
same.
5. Additional Comments
a. None
14
SYSTEM DESIGN
In this phase initially I had designed E-R diagram of the processes , in order to identify various
entities and relationship set ,entity set ,attributers, link attributes The Diagram of this process as
under.
After this step we had tried design the data base for the new system and normalized it
The tables motivated in data dictionaries enclosed as annex II is an out come of this step
15
16
DATA FLOW DIAGRAM
In order to design a better solution. I had designed the DFD for system including all technical
processing details is given bellow
17
18
GHANTT CHART
AIRLINES RESERVATION SYSTEM
19
PROCESS LOGIC
RESERVATION
• END.
CANCELLATION
20
• AGENT QUOTE PNR NUMBER FROM CUSTOMER AND FILL IT IN SYSTEM AND
CLICK ON GET DETAILS.
• VERIFY THE DETAILS PROVIDED BY CUSTOMER WITH THE SYSTEM
GENERATED DETAILS.
• IF DETAILS FOUND CORRECT, CLICK ON CANCEL TICKET.
• SYSTEM WILL DISPLAY AMOUNT THAT IS REQUIRED TO BE RETURENED.
• RETURN AMOUNT. PRINT CANCELLED TICKET.
• END
21
REPORTS
1 CASH REPORT
2 PASSENGER LIST
3 CANCELLATION LIST
4 RESERVATION CHART
22
MODULARIZATION DETAILS:
Form Details:
1. AboutBox1.vb
2. frmCancellation.vb
3. frmCash.vb
4. frmcrew.vb
5. frmfare.vb
6. frmFlight.vb
7. frmFlights.vb
8. frmPrintTicket.vb
9. frmReservation.vb
10. frmSeats.vb
11. frmUserAccounts.vb
12. LoginForm1.vb
13. MDIParent2.vb
14. RepCan.vb
15. RepCash.vb
16. repCrew.vb
17. repPassenger.vb
18. repRes.vb
19. SplashScreen1.vb
20. Stations.vb
23
CLASS DIAGRAM
24
25
DATA TABLES/DATADICTIONARY
Cash
Column Name Data Type Null? Constraint Description
TxnNo numeric(10, 0) NO Primary Key
pnrno numeric(10, 0) NO
datentime datetime NO
details varchar(50) NO
type nchar(10) NO
Amount numeric(10, 2) NO Default=0
transactionby numeric(4, 0) NO
Crew
Column Name Data Type Null? Constraint Description
CrewId numeric(18, 0) NO Primary Key
Name varchar(50) NO
DateOfBirth datetime NO
Sex char(6) NO
Post char(10) NO
Address varchar(50) NO
MobileNo numeric(18, 0) NO
EMailID varchar(50) NO
flightID numeric(3, 0) YES
Status char(10) NO
Fare
Column Name Data Type Null? Constraint Description
fareid numeric(18, 0) NO Primary Key
details varchar(50) NO
class char(10) NO
ResCharge numeric(7, 2) NO
ChargePerKm numeric(7, 2) NO
AirportTaxPercent numeric(7, 2) NO
ServiceTaxPercent numeric(7, 2) NO
Valid bit NO
Flights
Column Name Data Type Null? Constraint Description
flightno numeric(18, 0) NO Primary Key
OriginStation char(4) NO
DestStation char(4) NO
distance numeric(5, 0) NO
ActualDepTime datetime NO
ExpDepTime datetime NO
ActualArrivalTim datetime NO
26
e
ExpArrivalTime datetime NO
services varchar(50) NO
status varchar(10) NO
Login
Column Name Data Type Null? Constraint Description
loginid varchar(50) NO Primary Key
passw varchar(50) NO
locked bit NO
id numeric(18, 0) NO
Pnr
Column Name Data Type Null? Constraint Description
pnrno numeric(18, 0) NO Primary Key
bookingdate datetime NO
bookingby numeric(4, 0) NO
flightno numeric(3, 0) NO
class char(10) NO
dateofjourney datetime NO
applicantname varchar(50) NO
address varchar(100) NO
phoneNo numeric(18, 0) NO
OrigionalNumOfPass numeric(2, 0) NO
CurrentNumOfPass numeric(2, 0) NO
currentstatus char(5) NO
amount numeric(10, 2) NO Default=0
Reservation
Column Name Data Type Null? Constraint Description
ResID char(20) NO Primary Key
doj datetime NO
PassName varchar(50) NO
Age numeric(3, 0) NO
sex char(6) NO
SeatCode varchar(4) NO
status char(3) NO
PNR numeric(20, 0) NO
Seats
Column Name Data Type Null? Constraint Description
SeatCode varchar(20) NO Primary Key
Class char(10) NO
27
PositionH numeric(1, 0) NO
PositionV numeric(2, 0) NO
Quota char(3) NO
28
Form Design
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Coding
FORM : loginform1.vb
Imports System.Data.SqlClient
Public Class LoginForm1
Public usercode As Decimal
Public user As String
Dim con As New SqlConnection("Data Source=localhost\sqlexpress;Initial
Catalog=airline;Integrated Security=True")
Dim com As New SqlCommand
Dim dr As SqlDataReader
Dim reader As SqlDataReader
con.Open()
com = New SqlCommand("Select loginid, passw, id From login where
loginid=@loginid and locked=0", con)
com.Parameters.AddWithValue("loginid", UsernameTextBox.Text)
dr = com.ExecuteReader
If dr.Read Then
If PasswordTextBox.Text = dr.GetString(1).ToString Then
usercode = dr.GetDecimal(2)
user = dr.GetString(0).ToString
SplashScreen1.Show()
Me.Hide()
End If
Else
MessageBox.Show("Invalid Username or Password", "SECURITY CHECK",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
con.Close()
End Sub
End Class
47
FORM : frmcancellation.vb
Imports System.Data.SqlClient
Public Class frmCancellation
Dim con As New SqlConnection("Data Source=localhost\sqlexpress;Initial
Catalog=airline;Integrated Security=True")
Dim com As New SqlCommand
Dim dr As SqlDataReader
com.Parameters.AddWithValue("pnr", txtpnr.Text)
dr = com.ExecuteReader
If dr.Read Then
txtFlightno.Text = dr.GetDecimal(2).ToString
dtdate.Value = dr.GetDateTime(4).ToString
txtappname.Text = dr.GetString(5).ToString
txtaddress.Text = dr.GetString(6).ToString
txtContactNo.Text = dr.GetDecimal(7).ToString
lblActualAmt.Text = dr.GetDecimal(8).ToString
lbltime.Text = DateDiff(DateInterval.Minute, Now.Date,
dtdate.Value.Date)
If Integer.Parse(lbltime.Text) < 1440 Then
lbldeduction.Text = 75
ElseIf (Integer.Parse(lbltime.Text) < 2880) And
(Integer.Parse(lbltime.Text) > 1440) Then
lbldeduction.Text = 50
Else
lbldeduction.Text = 25
End If
lblRetAmount.Text = Decimal.Parse(lblActualAmt.Text) -
((Decimal.Parse(lbldeduction.Text) / 100) * Decimal.Parse(lblActualAmt.Text))
Else
MsgBox("Reservation doesnot exists", MsgBoxStyle.Critical)
End If
con.Close()
End Sub
48
temp = com.ExecuteNonQuery()
If temp < 0 Then
MsgBox("Error Occured")
Else
MsgBox(temp & " Records AFFECTED")
End If
con.Close()
con.Open()
com = New SqlCommand("INSERT INTO cash (pnrno ,datentime ,details ,type
,Amount ,transactionby) VALUES (@pnrno, @datentime, @details, @type, @Amount,
@transactionby)", con)
com.Parameters.AddWithValue("pnrno", Decimal.Parse(txtpnr.Text))
com.Parameters.AddWithValue("datentime", Now.Date)
com.Parameters.AddWithValue("details", "CASH PAID FOR CANCELLATION")
com.Parameters.AddWithValue("type", "OUT")
com.Parameters.AddWithValue("Amount",
-Decimal.Parse(lblRetAmount.Text))
com.Parameters.AddWithValue("transactionby",
Decimal.Parse(MDIParent2.lblusercode.Text))
temp = com.ExecuteNonQuery()
If temp < 0 Then
MsgBox("Error Occured")
End If
con.Close()
End Sub
End Sub
End Class
49
FORM : frmcash.vb
Imports System.Data.SqlClient
End Sub
con.Open()
com = New SqlCommand("Select sum(Amount) from cash where type ='OUT'
AND DATENTIME > '" & DATE1.Value & "' and datentime < '" & DATE2.Value & "'",
con)
dr = com.ExecuteReader
If dr.Read() Then
lblOUTcash.Text = dr.GetDecimal(0).ToString()
CASHOUT = dr.GetDecimal(0)
End If
lblTotalcash.Text = CASHIN - CASHOUT
con.Close()
End Sub
50
Me.Close()
End Sub
51
FORM : frmcrew.vb
Imports System.Data.SqlClient
Public Class frmcrew
Dim con As New SqlConnection("Data Source=localhost\sqlexpress;Initial
Catalog=airline;Integrated Security=True")
Dim com As New SqlCommand
Dim dr As SqlDataReader
Dim reader As SqlDataReader
End Sub
52
MsgBox("Generated Crew ID is :" & dr.GetDecimal(0).ToString,
MsgBoxStyle.Information)
txtCrewID.Text = dr.GetDecimal(0).ToString
Else
MsgBox("Error Fetching Crew ID. Please Check from List.",
MsgBoxStyle.Critical)
End If
End If
con.Close()
populategrid()
End Sub
End Sub
53
com.Parameters.AddWithValue("crewid", crewid)
End If
Dim da As New SqlDataAdapter(com)
da.Fill(ds)
dgcrew.DataSource = ds
dgcrew.DataMember = ds.Tables(0).ToString()
con.Close()
End Sub
Sub getidleemployees(ByVal post As String)
Dim ds As New DataSet
con.Open()
com = New SqlCommand("Select * From Crew where post = @post", con)
com.Parameters.AddWithValue("post", post)
Dim da As New SqlDataAdapter(com)
da.Fill(ds)
dgDepute.DataSource = ds
dgDepute.DataMember = ds.Tables(0).ToString()
con.Close()
End Sub
Sub populatefields()
txtCrewID.Text = dgcrew.SelectedRows.Item(0).Cells(0).Value
txtName.Text = dgcrew.SelectedRows.Item(0).Cells(1).Value
dtdob.Value = dgcrew.SelectedRows.Item(0).Cells(2).Value
cmbsex.SelectedItem =
RTrim(LTrim(dgcrew.SelectedRows.Item(0).Cells(3).Value))
cmbpost.SelectedItem =
RTrim(LTrim(dgcrew.SelectedRows.Item(0).Cells(4).Value))
txtaddress.Text = dgcrew.SelectedRows.Item(0).Cells(5).Value
txtmobile.Text = dgcrew.SelectedRows.Item(0).Cells(6).Value
txtemail.Text = dgcrew.SelectedRows.Item(0).Cells(7).Value
txtflightno.Text = dgcrew.SelectedRows.Item(0).Cells(8).Value
cmbstatus.SelectedItem =
RTrim(LTrim(dgcrew.SelectedRows.Item(0).Cells(9).Value))
End Sub
54
com = New SqlCommand("Update Crew set flightid =@flightid where
crewid=@crewid", con)
com.Parameters.AddWithValue("flightid", txtdeputeflightno.Text)
com.Parameters.AddWithValue("crewid", lblcrewid.Text)
temp = com.ExecuteNonQuery()
If temp < 0 Then
MsgBox("Error Adding data. Please Try Again")
Else
MsgBox(temp & "Rows Affected. Update Sucessful")
End If
con.Close()
populategrid()
getidleemployees(cmbsearchfor.SelectedItem)
End Sub
End Sub
55
FORM : frmfare.vb
Imports System.Data.SqlClient
56
AirportTaxPercent=@AirportTaxPercent, ServiceTaxPercent=@ServiceTaxPercent,
Valid=@Valid WHERE FareID=@FareID", con)
com.Parameters.AddWithValue("fareid", Decimal.Parse(txtfareid.Text))
com.Parameters.AddWithValue("details", txtdeatils.Text)
com.Parameters.AddWithValue("class", cmbclass.SelectedItem)
com.Parameters.AddWithValue("ResCharge", txtres.Text)
com.Parameters.AddWithValue("ChargePerKm", txtKm.Text)
com.Parameters.AddWithValue("AirportTaxPercent", txtaai.Text)
com.Parameters.AddWithValue("ServiceTaxPercent", txtST.Text)
com.Parameters.AddWithValue("VALID", chkvalid.Checked)
temp = com.ExecuteNonQuery()
If temp < 0 Then
MsgBox("Error Updating data. Please Try Again")
Else
MsgBox(temp & "Rows Affected. Update Sucessful")
End If
con.Close()
populategrid()
End Sub
57
Sub populatefields()
txtfareid.Text = dgfare.SelectedRows.Item(0).Cells(0).Value
txtdeatils.Text = dgfare.SelectedRows.Item(0).Cells(1).Value
cmbclass.SelectedItem =
LTrim(RTrim(dgfare.SelectedRows.Item(0).Cells(2).Value))
txtres.Text = dgfare.SelectedRows.Item(0).Cells(3).Value
txtKm.Text = dgfare.SelectedRows.Item(0).Cells(4).Value
txtaai.Text = dgfare.SelectedRows.Item(0).Cells(5).Value
txtST.Text = dgfare.SelectedRows.Item(0).Cells(6).Value
chkvalid.Checked = dgfare.SelectedRows.Item(0).Cells(7).Value
End Sub
End Sub
58
FORM : frmflights.vb
Imports System.Data.SqlClient
59
con.Open()
com = New SqlCommand("UPDATE flights SET OriginStation=@OriginStation,
DestStation=@DestStation, distance=@distance, ActualDepTime=@ActualDepTime,
ExpDepTime=@ExpDepTime, ActualArrivalTime=@ActualArrivalTime,
ExpArrivalTime=@ExpArrivalTime, services=@services, status=@status WHERE
Flightno=@Flightno", con)
com.Parameters.AddWithValue("flightno",
Decimal.Parse(txtFlightno.Text))
com.Parameters.AddWithValue("OriginStation", cmborigin.SelectedItem)
com.Parameters.AddWithValue("DestStation", cmbdest.SelectedItem)
com.Parameters.AddWithValue("distance", txtdist.Text)
com.Parameters.AddWithValue("ActualDepTime", dtAcDep.Value)
com.Parameters.AddWithValue("ExpDepTime", dtExDep.Value)
com.Parameters.AddWithValue("ActualArrivalTime", dtAcArr.Value)
com.Parameters.AddWithValue("ExpArrivalTime", dtExArr.Value)
com.Parameters.AddWithValue("services", txtServices.Text)
com.Parameters.AddWithValue("status", txtstatus.Text)
temp = com.ExecuteNonQuery()
If temp < 0 Then
MsgBox("Error Updating data. Please Try Again")
Else
MsgBox(temp & "Rows Affected. Update Sucessful")
End If
con.Close()
populategrid()
End Sub
60
dgFlights.DataSource = ds
dgFlights.DataMember = ds.Tables(0).ToString()
con.Close()
End Sub
Sub populatefields()
txtFlightno.Text = dgFlights.SelectedRows.Item(0).Cells(0).Value
cmborigin.SelectedItem = dgFlights.SelectedRows.Item(0).Cells(1).Value
cmbdest.SelectedItem = dgFlights.SelectedRows.Item(0).Cells(2).Value
txtdist.Text = dgFlights.SelectedRows.Item(0).Cells(3).Value
dtAcDep.Value = dgFlights.SelectedRows.Item(0).Cells(4).Value
dtExDep.Value = dgFlights.SelectedRows.Item(0).Cells(5).Value
dtAcArr.Value = dgFlights.SelectedRows.Item(0).Cells(6).Value
dtExArr.Value = dgFlights.SelectedRows.Item(0).Cells(7).Value
txtServices.Text = dgFlights.SelectedRows.Item(0).Cells(8).Value
txtstatus.Text = dgFlights.SelectedRows.Item(0).Cells(9).Value
End Sub
Sub LoadData()
con.Open()
com = New SqlCommand("Select stationcode, name From station", con)
dr = com.ExecuteReader
Do While dr.Read
cmbdest.Items.Add(dr.GetString(0))
cmbFrom.Items.Add(dr.GetString(0))
cmborigin.Items.Add(dr.GetString(0))
cmbTo.Items.Add(dr.GetString(0))
61
Loop
con.Close()
End Sub
62
FORM : frmprintticket.vb
Public Class frmPrintTicket
End Sub
If MDIParent2.currentpnr = 0 Then
discval.Value = InputBox("Please Enter PNR Number", "Duplicate
Ticket Printing")
Else
discval.Value = MDIParent2.currentpnr
End If
paramfield.CurrentValues.Add(discval)
paramfields.Add(paramfield)
CrystalReportViewer1.ParameterFieldInfo = paramfields
MDIParent2.currentpnr = 0
'CrystalReportViewer1.ParameterFieldInfo.Add("pnrno",
CrystalDecisions.Shared.ParameterValueKind.NumberParameter,
CrystalDecisions.Shared.DiscreteOrRangeKind.DiscreteValue, "ticket.rpt")
'CrystalReportViewer1.ParameterFieldInfo.Insert(0,
CrystalDecisions.Shared.IParameters(1))
'CrystalReportViewer1.RefreshReport()
End Sub
End Class
63
FORM : frmreservation.vb
Imports System.Data.SqlClient
Public Class frmReservation
Dim con As New SqlConnection("Data Source=localhost\sqlexpress;Initial
Catalog=airline;Integrated Security=True")
Dim con2 As New SqlConnection("Data Source=localhost\sqlexpress;Initial
Catalog=airline;Integrated Security=True")
Dim com As New SqlCommand
Dim com2 As New SqlCommand
Dim dr As SqlDataReader
''**********************************
''***********************************
''*************************************
End Sub
64
Private Sub cmdsearch_flt_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
End Sub
End Sub
Sub LoadData()
con.Open()
com = New SqlCommand("Select stationcode, name From station", con)
dr = com.ExecuteReader
Do While dr.Read
cmbfrom.Items.Add(dr.GetString(0))
cmbto.Items.Add(dr.GetString(0))
Loop
con.Close()
End Sub
End Sub
setSeatingplan()
con.Open()
com = New SqlCommand("INSERT INTO pnr
(bookingdate,bookingby,flightno,class,dateofjourney,applicantname,address,phone
No,OrigionalNumOfPass,CurrentNumOfPass,currentstatus)values (@bookingdate,
@bookingby, @flightno, @class, @dateofjourney, @applicantname, @address,
@phoneNo, @OrigionalNumOfPass, @CurrentNumOfPass, @currentstatus)", con)
com.Parameters.AddWithValue("bookingdate", Now)
com.Parameters.AddWithValue("bookingby",
Decimal.Parse(MDIParent2.lblusercode.Text))
com.Parameters.AddWithValue("flightno", lstflt.SelectedItem)
com.Parameters.AddWithValue("class", cmbclass.SelectedItem)
com.Parameters.AddWithValue("dateofjourney", dtdate.Value)
com.Parameters.AddWithValue("applicantname", txtappname.Text)
com.Parameters.AddWithValue("address", txtaddress.Text)
com.Parameters.AddWithValue("phoneNo", txtcontactno.Text)
com.Parameters.AddWithValue("OrigionalNumOfPass", 0)
com.Parameters.AddWithValue("CurrentNumOfPass", 0)
com.Parameters.AddWithValue("currentstatus", "VALID")
temp = com.ExecuteNonQuery()
If temp < 0 Then
MsgBox("Error Adding PNR. Please Try Again")
con.Close()
Exit Sub
65
Else
com = New SqlCommand("select @@identity", con)
dr = com.ExecuteReader()
If dr.Read Then
MsgBox("Generated PNR is : " & dr.GetDecimal(0).ToString,
MsgBoxStyle.Information)
lblpnr.Text = dr.GetDecimal(0).ToString
Else
MsgBox("Error Fetching PNR. Please contact Administrator.",
MsgBoxStyle.Critical)
End If
dr.Close()
com.Dispose()
End If
GroupBox1.Enabled = True
GroupBox4.Enabled = True
GroupBox3.Enabled = False
GroupBox2.Enabled = False
Frame1.Enabled = False
con.Close()
createTable()
End Sub
con.Open()
com = New SqlCommand("Select Flightno, distance From flights where
deststation=@deststation and originstation=@originstation", con)
com.Parameters.AddWithValue("originstation", cmbfrom.SelectedItem)
com.Parameters.AddWithValue("deststation", cmbto.SelectedItem)
dr = com.ExecuteReader
Do While dr.Read
lstflt.Items.Add(dr.GetDecimal(0))
lblDistance.Text = dr.GetDecimal(1)
Loop
con.Close()
End Sub
con.Open()
com = New SqlCommand("select rescharge 'RESERVATION CHARGES',
(ChargePerKm * @kms)'CHARGE/KM', ((AirportTaxPercent/100)* @kms) 'AAI TAX',
((ServiceTaxPercent/100)* @kms) 'SERVICETAX' , ((select count(seatcode) from
seats where right(seatcode, len(seatcode)-3)=1 and left(seatcode,1)='a' )-
66
(select count(SeatCode) from reservation where right(seatcode, len(seatcode)-
3)=1 and left(seatcode,1)='a' and doj='1-feb-2011')) 'REMAINING SEATS' from
fare where class='ECONOMY' ", con)
com.Parameters.AddWithValue("kms", Integer.Parse(lblDistance.Text))
dr = com.ExecuteReader
If dr.Read Then
lblrate.Text = dr.GetDecimal(0) + dr.GetDecimal(1) +
dr.GetDecimal(2) + dr.GetDecimal(3)
lblseats.Text = dr.GetInt32(4)
End If
con.Close()
End Sub
67
com.Parameters.AddWithValue("Age", a(2))
com.Parameters.AddWithValue("sex", a(3))
com.Parameters.AddWithValue("SeatCode", a(4))
com.Parameters.AddWithValue("status", a(5))
com.Parameters.AddWithValue("pnr", Decimal.Parse(lblpnr.Text))
Dim da As New SqlDataAdapter(com)
da.Fill(dt)
Next
MDIParent2.currentpnr = Decimal.Parse(lblpnr.Text)
frmPrintTicket.ShowDialog(Me)
End Sub
Sub setSeatingplan()
' Dim a As New Collection()
' Dim b As New Collection()
' Dim ex As New Collection()
a.Add(a01)
a.Add(a02)
a.Add(a03)
a.Add(a04)
a.Add(a05)
a.Add(a06)
a.Add(a07)
a.Add(a08)
a.Add(a09)
a.Add(a10)
a.Add(a11)
a.Add(a12)
a.Add(a13)
a.Add(a14)
a.Add(a15)
a.Add(a16)
a.Add(a17)
a.Add(a18)
a.Add(a19)
a.Add(a20)
a.Add(a21)
a.Add(a22)
a.Add(a23)
a.Add(a24)
a.Add(a25)
a.Add(a26)
a.Add(a27)
a.Add(a28)
a.Add(a29)
a.Add(a30)
a.Add(a31)
a.Add(a32)
a.Add(a33)
a.Add(a34)
a.Add(a35)
a.Add(a36)
b.Add(b01)
68
b.Add(b02)
b.Add(b03)
b.Add(b04)
b.Add(b05)
b.Add(b06)
b.Add(b07)
b.Add(b08)
ex.Add(e01)
ex.Add(e02)
ex.Add(e03)
ex.Add(e04)
For Each ctrl As RadioButton In a
ctrl.Enabled = False
Next
For Each ctrl As RadioButton In b
ctrl.Enabled = False
Next
For Each ctrl As RadioButton In ex
ctrl.Enabled = False
Next
con2.Open()
Dim dr2 As SqlDataReader
com2 = New SqlCommand("select left(SeatCode, 3) from reservation where
right(seatcode, len(seatcode)-3)=@flight and left(seatcode,1)=@class and
doj=@doj AND STATUS = 'CNF'", con2)
com2.Parameters.AddWithValue("doj", dtdate.Value.Date)
com2.Parameters.AddWithValue("flight", lstflt.SelectedItem)
com2.Parameters.AddWithValue("class", "a")
dr2 = com2.ExecuteReader()
Do While dr2.Read
'If cmbclass.SelectedItem = "EXECUTIVE " Then
69
'ElseIf cmbclass.SelectedItem = "BUSSINESS" Then
'End If
Loop
con2.Close()
End Sub
lblseatcode.Text = "SELECT"
txtpassName.Text = ""
txtage.Text = ""
cmbsex.SelectedItem = "FEMALE"
End Sub
70
lblseatcode.Text = ctrl.Name
End If
Next
End Sub
Private Sub b_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles b01.CheckedChanged, b02.CheckedChanged,
b03.CheckedChanged, b04.CheckedChanged, b05.CheckedChanged, b06.CheckedChanged,
b07.CheckedChanged, b08.CheckedChanged
For Each ctrl As RadioButton In b
If ReferenceEquals(ctrl, sender) Then
lblseatcode.Text = ctrl.Name
End If
Next
End Sub
Private Sub ex_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles e01.CheckedChanged, e02.CheckedChanged,
e03.CheckedChanged, e04.CheckedChanged
For Each ctrl As RadioButton In ex
If ReferenceEquals(ctrl, sender) Then
lblseatcode.Text = ctrl.Name
End If
Next
End Sub
71
FORM : frmseats.vb
Imports System.Data.SqlClient
End Sub
End Sub
End Sub
72
a.Add(a22)
a.Add(a23)
a.Add(a24)
a.Add(a25)
a.Add(a26)
a.Add(a27)
a.Add(a28)
a.Add(a29)
a.Add(a30)
a.Add(a31)
a.Add(a32)
a.Add(a33)
a.Add(a34)
a.Add(a35)
a.Add(a36)
b.Add(b01)
b.Add(b02)
b.Add(b03)
b.Add(b04)
b.Add(b05)
b.Add(b06)
b.Add(b07)
b.Add(b08)
ex.Add(e01)
ex.Add(e02)
ex.Add(e03)
ex.Add(e04)
con.Open()
73
End If
Next
For Each ctrl As CheckBox In a
If ctrl.Checked = True Then
Dim temp As Integer
com = New SqlCommand("INSERT INTO seats ( SeatCode, Class,
PositionH, PositionV, Quota) values( @SeatCode, @Class, @PositionH, @PositionV,
@Quota)", con)
If ctrl.Tag = "VIP" Then
com.Parameters.AddWithValue("Quota", "VIP")
Else
com.Parameters.AddWithValue("Quota", "GEN")
End If
com.Parameters.AddWithValue("SeatCode", ctrl.Name &
Trim(txtFlightNo.Text))
com.Parameters.AddWithValue("Class", "ECONOMY")
com.Parameters.AddWithValue("PositionH", 0)
com.Parameters.AddWithValue("PositionV", 0)
temp = com.ExecuteNonQuery
If temp < 0 Then
MsgBox("Seats Not Inserted Try Again",
MsgBoxStyle.Critical)
ctrl.BackColor = Color.Red
Else
MsgBox(ctrl.Name)
ctrl.Text = Strings.Right(ctrl.Name, 2)
End If
End If
Next
For Each ctrl As CheckBox In b
If ctrl.Checked = True Then
Dim temp As Integer
com = New SqlCommand("INSERT INTO seats ( SeatCode, Class,
PositionH, PositionV, Quota) values( @SeatCode, @Class, @PositionH, @PositionV,
@Quota)", con)
If ctrl.Tag = "VIP" Then
com.Parameters.AddWithValue("Quota", "VIP")
Else
com.Parameters.AddWithValue("Quota", "GEN")
End If
com.Parameters.AddWithValue("SeatCode", ctrl.Name &
Trim(txtFlightNo.Text))
com.Parameters.AddWithValue("Class", "BUSSINESS")
com.Parameters.AddWithValue("PositionH", 0)
com.Parameters.AddWithValue("PositionV", 0)
temp = com.ExecuteNonQuery
If temp < 0 Then
MsgBox("Seats Not Inserted Try Again",
MsgBoxStyle.Critical)
ctrl.BackColor = Color.Red
Else
MsgBox(ctrl.Name)
ctrl.Text = Strings.Right(ctrl.Name, 2)
End If
End If
74
Next
con.Close()
Exit Sub
jk:
MsgBox(Err.Description)
End Sub
75
FORM : frmuseraccounts.vb
Imports System.Data.SqlClient
End Sub
End Sub
Sub populategrid()
Dim ds As New DataSet
con.Open()
com = New SqlCommand("Select loginid , locked From login", con)
Dim da As New SqlDataAdapter(com)
da.Fill(ds)
DataGridView1.DataSource = ds
DataGridView1.DataMember = ds.Tables(0).ToString()
con.Close()
End Sub
76
MsgBox("Error Adding data. Please Try Again")
End If
con.Close()
populategrid()
Else
MsgBox("Passwords are nt same", MsgBoxStyle.Critical)
End If
End Sub
End Sub
77
populategrid()
Else
MsgBox("UserName are not same", MsgBoxStyle.Critical)
End If
End Sub
End Sub
End Sub
End Class
78
FORM : mdiparent1.vb
Imports System.Windows.Forms
ChildForm.MdiParent = Me
m_ChildFormNumber += 1
ChildForm.Text = "RESERVATION"
ChildForm.Show()
End Sub
If (SaveFileDialog.ShowDialog(Me) =
System.Windows.Forms.DialogResult.OK) Then
Dim FileName As String = SaveFileDialog.FileName
' TODO: Add code here to save the current contents of the form to a
file.
End If
End Sub
79
' Use My.Computer.Clipboard to insert the selected text or images into
the clipboard
End Sub
End Sub
80
ChildForm.MdiParent = Me
m_ChildFormNumber += 1
ChildForm.Text = "RESERVATION"
ChildForm.Show()
End Sub
ChildForm.MdiParent = Me
m_ChildFormNumber += 1
ChildForm.Text = "CANCELLATION"
ChildForm.Show()
End Sub
ChildForm.MdiParent = Me
m_ChildFormNumber += 1
ChildForm.MdiParent = Me
m_ChildFormNumber += 1
81
ChildForm.MdiParent = Me
m_ChildFormNumber += 1
ChildForm.Text = "RESERVATION"
ChildForm.Show()
End Sub
ChildForm.MdiParent = Me
m_ChildFormNumber += 1
ChildForm.Text = "RESERVATION"
ChildForm.Show()
End Sub
82
Dim childform As New RepRes
childform.MdiParent = Me
childform.Show()
End Sub
ChildForm.MdiParent = Me
m_ChildFormNumber += 1
ChildForm.Text = "CANCELLATION"
ChildForm.Show()
End Sub
End Sub
83
ChildForm.MdiParent = Me
m_ChildFormNumber += 1
84
TESTING
Overview:
The aim of testing process is to identify all defects in a software product. Testing is any
activity aimed at evaluating the software for quality results it produces and the quality of
results it can handle. Testing is an operation to detect the differences between the
expected (required) result and the actual result.
Testing a program consists of subjecting the program to a test inputs or test cases and
observing if the program behaves as expected. If the program fails to behave as
expected, then the condition under which failures occurs are noted for later debugging
and correction. There are many stages of testing depending on the complexity of the
software.
Levels of Testing:
The basic levels of testing are:-
1. Unit Testing.
2. Integration Testing.
3. System Testing
85
UNIT TEST REPORT:
86
Future Enhancement
1. In Future the Customer will be able to logon to public portal(Website) to book their
tickets online from their homes using internet.
2. Support for Portable devices like Mobile phones/PDA will be provided in future.
3. In Future Customers the Software will be able to send SMS Message to customers
about best deals and Flight schedule.
Bibliography
Websites Used
1. www.google.com
2. www.thinkdigit.com
3. www.programmersheaven.com
4. www.codeguru.com
5. www.airindia.in
87