Вы находитесь на странице: 1из 87

AIRLINE RESERVATION

SYSTEM
ACKNOWLEDGEMENT

I take this opportunity to express my profound sense of gratitude and respect to


all those who helped me throughout the duration of this project. I express my
sincere gratitude and thankfulness towards Mr. Vinay Tiwari , Lab Incharge,
UICSA, Ranidurgawati Vishwavidyalaya, (project guide) for providing his
valuable time and guidance throughout the project development.

I feel privileged to offer my sincere thanks and deep sense of gratitude


to Mr S Srinivas, Regional Director, RC-41, IGNOU for providing me
encouragement to perform this complex project.

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

8. TOOLS AND SOFTWARES USED

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

GUI based RAD tools:


1. Microsoft Visual Studio 2008 Express Edition
This is a RAD tool developed by Microsoft Corporation, to help developers design application
rapidly. This Software provides a common platform for almost every type of development
whether it is Web Application, Desktop Application, and Windows Mobile Application of any
console based application. This software works on Language Neutral Concepts of Microsoft.
This means developer can develop their applications using any language available for Visual
Studio. By default Microsoft provides support for C#.NET, VB.NET, C++.NET and J++.NET.
The application developed out of any language works exactly same as it may have been
developed with any other language. All languages provide equal power to the application as
per Microsoft. It provides a very powerful designer interface, by using which one can easily
develop rich GUI based applications in less time. It’s intellisense feature is a boon for
programmers. This feature provides programmer code prediction which he/she is expected
next.
2. Microsoft SQL Server Management Studio
This is a RAD tool for database development and maintenance. Using this tool the developer
has the power to work graphically to create tables, test their SQL Queries and embed
security. This tool can be freely downloaded from Microsoft’s website.

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.

.Need of Airlines system

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

Flight MAINTENANCE, RECEIVE


CUSTOMER
Booking, cancellation REQUEST

PASSENGER
LIST
CONFIRMED
LIST
AIRLINE
PASSENGER RESERVATION REPORTS
SYSTEM WAITING LIST
CANCELLATION

DATA STIRAGE DATA ACCESS

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. Out of Scope:


1. To Provide Highly detailed financial reports like ledgers, or
balance sheet.
2. Allow reservation from stating station to end station,
intermediate stations are not allowed to be reserved. Hence for
each pair of airports, separate flight number has to be
generated.
3. Reservation through Website.
4. Waitlisting on Reservation.
2. Definitions, acronyms, and abbreviations
a. Definations:
i. Airlines Reservation System:
A System used to manage reservation tasks for an airlines company.

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.

b. Acronyms and Abbreviations:


i. CAN : Cancelled Status
ii. CNF : Confirmed Status
iii. SRS : Software Requirement specification
iv. DD : Date
v. MM : Month
vi. YY : Year
vii. MISC: Miscellaneous
3. Overall Description:
a. PRODUCT PERSPECTIVES
Airlines reservation system has been designed in aim in providing a efficient,
reliable and distributive type of reservation system to help a company run its
operation at very low cost and that too smoothly.

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

BOOKING AGENT : A person who will be available at every reservation


counter to reserve tickets. Key characterstics are : He should be able to
Read/Write/Speak English and regional language in order to assist customer
efficiently. He/she should be well educated eg. Graduate or more. Last but not
leat he should be well computer literate, He should have operating knowledge
of computer and other computer security issues.

ADMINISTRATOR : A person who will be responsible for


addition/deletion/updation of crew, flight, System users. It may be manager or
a separate entity for this task.

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.

ii. Fault Tolerant:

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

The symbols for Entity Relationship Diagrams are shown bellow

Relation ship set


Entity sets

Connecting line oval


bal

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

LEVEL 0 DATA FLOW DIAGRAM

LEVEL 1 DATA FLOW DIAGRAM

17
18
GHANTT CHART
AIRLINES RESERVATION SYSTEM

CREATED USING MICROSOFT VISIO 2003

Oct 2010 Nov 2010 Dec 2010


ID Task Name Start Finish Duration
10/10 17/10 24/10 31/10 7/11 14/11 21/11 28/11 5/12 12/12 19/12 26/12 2/1

1 TOPIC SELECTION 9/6/2010 9/8/2010 .6w

2 REQUIREMENT ANALYSIS 9/7/2010 9/20/2010 2w

3 SYSTEM DESIGN 9/20/2010 10/4/2010 2.2w

4 DATABASE DESIGN 10/4/2010 10/6/2010 .6w

5 FORM DESIGN 10/5/2010 10/21/2010 2.6w

6 CRYSTAL REPORTS DESIGNING 10/15/2010 10/22/2010 1.2w

7 CODING 10/22/2010 11/11/2010 3w

8 TESTING 11/11/2010 11/19/2010 1.4w

9 MAINTENANCE 11/19/2010 11/24/2010 .8w

10 TESTING 12/20/2010 12/30/2010 1.8w

19
PROCESS LOGIC
RESERVATION

MENU : START > NEW RESERVATION


SHORTCUT : CTRL+N

• A PERSON VISIT RESERVATION COUNTER.

• CUSTOMER FILLS IN RESERVATION FORM AND PROVIDE ALL DETAILS

• BOOKING AGENT ENTER ORIGIN, DESTINATION , CLASS AND DATE ON


RESERVATION FORM ABD CLICK ON SEARCH.

• SYSTEM WILL DISPLAY LIST OF AVAILABLE FLIGHTS. AGENT SELECT THE


FLIGHT OUT OF THE LIST. THE SYSTEM WILL DISPLAY AVAILABILITY
STATUS, TIMING ETC.

• IF THE SEATS ARE AVAILABLE AGENT ENTERS APPLICANT DETAILS INTO


THE SYSTEM AND CLICK ON GENERATE PNR NUMBER BUTTON.

• THEN SYSTEM WILL DISPLAY GENERATED PNR NUMBER ON SCREEN.

• NOW AGENT ENTER PASSENGER DETAILS, SELECT DESIRED SEAT AND


CLICK ON ADD.

• REPEAT ABOVE STEP TILL ALL PASSENDERS HAVE BEEN ADDED.

• THEN CLICK ON “SAVE DETAILS AND PRINT TICKET”.

• PRINT THE TICKET AND COLLECT CASH FROM CUSTOMER.

• END.

CANCELLATION

MENU : START > CANCELLATION


SHORTCUT : CTRL+X

• A PASSENGER VISIT RESERVATION COUNTER TO CANCEL TICKET.

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

5 CREW DEPUTATION LIST

6 FLIGHT INFORMATION LIST

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

Private Sub OK_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles OK.Click

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

Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Cancel.Click
Me.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

Dim reader As SqlDataReader


Dim ds As New DataSet
Dim dt As New DataTable("Attn")
Private Sub btnGetdata_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnGeneratePNR.Click
con.Open()
com = New SqlCommand("select ResID, pnrno, flightno, class,
dateofjourney, applicantname, address, phoneNo, amount from reservation, pnr
where pnr.pnrno = reservation.pnr and pnr.pnrno=@pnr and status='CNF'", con)

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

Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnDelete.Click
Dim temp As Integer
con.Open()
com = New SqlCommand("update reservation set status='CAN' where
pnr=@pnr; update pnr set currentstatus='CAN' where pnrno=@pnr", con)
com.Parameters.AddWithValue("pnr", txtpnr.Text)

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

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub

Private Sub frmCancellation_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load

End Sub
End Class

49
FORM : frmcash.vb
Imports System.Data.SqlClient

Public Class frmCash


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
Private Sub frmCash_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

End Sub

Private Sub btnGetBalance_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnGetBalance.Click
On Error Resume Next
Dim ds As New DataSet
Dim cm As New SqlCommand("Select * From cash where DATENTIME > '" &
DATE1.Value & "' and datentime < '" & DATE2.Value & "'", con)
Dim da As New SqlDataAdapter(cm)
Dim CASHOUT As Decimal, CASHIN As Decimal
lblINCash.Text = "0.0"
lblOUTcash.Text = "0.0"
lblTotalcash.Text = "0.0"
con.Open()
da.Fill(ds)
DataGridView1.DataSource = ds
DataGridView1.DataMember = ds.Tables(0).ToString()
con.Close()
con.Open()
com = New SqlCommand("Select sum(Amount) from cash where type ='IN' AND
DATENTIME > '" & DATE1.Value & "' and datentime < '" & DATE2.Value & "'", con)
dr = com.ExecuteReader
If dr.Read() Then
lblINCash.Text = dr.GetDecimal(0).ToString()
CASHIN = dr.GetDecimal(0)
End If
con.Close()

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

Private Sub BTNCLOSE_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles BTNCLOSE.Click

50
Me.Close()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
repcash.ShowDialog()
End Sub
End Class

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

Private Sub Label7_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Label7.Click

End Sub

Private Sub frmcrew_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'AirlineDataSet.Crew'
table. You can move, or remove it, as needed.
Me.CrewTableAdapter.Fill(Me.AirlineDataSet.Crew)
'MsgBox(AirlineDataSet.Crew.Rows(0).Item(0).ToString())
populategrid()
End Sub

Private Sub btnaddnew_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnaddnew.Click
'dgcrew.ConnectionSt()
'dgcrew.SelectCommand = "Select ExpID, Company, Desig, sal, duration
from CandExperience where Cid=" &
Integer.Parse(Session.Contents("CID").ToString)
'\dgcrew.UpdateCommand = "Update CandExperience set Company=@Company,
Desig=@Desig, sal=@Sal, duration=@duration where ExpID=@ExpID"
'gcrew.DeleteCommand = "Delete from CandExperience where ExpID=@ExpID"

Dim temp As Integer


con.Open()
com = New SqlCommand("INSERT INTO Crew(Name ,DateOfBirth ,Sex ,Post
,Address ,MobileNo ,EMailID ,flightID ,Status) VALUES (@Name ,@DateOfBirth
,@Sex ,@Post ,@Address ,@MobileNo ,@EMailID ,@flightID ,@Status)", con)
com.Parameters.AddWithValue("Name", txtName.Text)
com.Parameters.AddWithValue("DateOfBirth", dtdob.Value)
com.Parameters.AddWithValue("Sex", cmbsex.SelectedItem)
com.Parameters.AddWithValue("Post", cmbpost.SelectedItem)
com.Parameters.AddWithValue("Address", txtaddress.Text)
com.Parameters.AddWithValue("MobileNo", txtmobile.Text)
com.Parameters.AddWithValue("EMailID", txtemail.Text)
com.Parameters.AddWithValue("flightID", txtflightno.Text)
com.Parameters.AddWithValue("Status", cmbstatus.SelectedItem)
temp = com.ExecuteNonQuery()
If temp < 0 Then
MsgBox("Error Adding data. Please Try Again")
Else
com = New SqlCommand("select @@identity", con)
dr = com.ExecuteReader()
If dr.Read Then

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

Private Sub btnupdate_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnupdate.Click
Dim temp As Integer
con.Open()
com = New SqlCommand("UPDATE Crew SET Name=@Name
,DateOfBirth=@DateOfBirth ,Sex=@Sex ,Post=@Post ,Address=@Address
,MobileNo=@MobileNo ,EMailID=@EMailID ,flightID=@flightID ,Status=@Status WHERE
CrewID=@CrewID", con)
com.Parameters.AddWithValue("crewid", Decimal.Parse(txtCrewID.Text))
com.Parameters.AddWithValue("Name", txtName.Text)
com.Parameters.AddWithValue("DateOfBirth", dtdob.Value)
com.Parameters.AddWithValue("Sex", cmbsex.SelectedItem)
com.Parameters.AddWithValue("Post", cmbpost.SelectedItem)
com.Parameters.AddWithValue("Address", txtaddress.Text)
com.Parameters.AddWithValue("MobileNo", txtmobile.Text)
com.Parameters.AddWithValue("EMailID", txtemail.Text)
com.Parameters.AddWithValue("flightID", txtflightno.Text)
com.Parameters.AddWithValue("Status", cmbstatus.SelectedItem)
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

Private Sub dgcrew_CellContentClick(ByVal sender As System.Object, ByVal e


As System.Windows.Forms.DataGridViewCellEventArgs) Handles
dgcrew.CellContentClick
txtCrewID.Text = dgcrew.SelectedRows.Item(0).Cells(1).Value.ToString
populatefields()
End Sub
Sub populategrid(Optional ByVal crewid As Integer = 0)
Dim ds As New DataSet
con.Open()
If crewid = 0 Then
com = New SqlCommand("Select * From Crew", con)
Else
com = New SqlCommand("Select * From Crew where crewid=@crewid",
con)

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

Private Sub btnsearch_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnsearch.Click
populategrid(Integer.Parse(txtCrewID.Text))
End Sub

Private Sub dgcrew_SelectionChanged(ByVal sender As Object, ByVal e As


System.EventArgs) Handles dgcrew.SelectionChanged
On Error Resume Next
populatefields()
End Sub

Private Sub cmbsearchidle_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles cmbsearchidle.Click
getidleemployees(cmbsearchfor.SelectedItem)
End Sub

Private Sub btndepute_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btndepute.Click
Dim temp As Integer
con.Open()

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

Private Sub dgDepute_CellContentClick(ByVal sender As System.Object, ByVal


e As System.Windows.Forms.DataGridViewCellEventArgs) Handles
dgDepute.CellContentClick

End Sub

Private Sub dgDepute_SelectionChanged(ByVal sender As Object, ByVal e As


System.EventArgs) Handles dgDepute.SelectionChanged
Try
lblcrewid.Text = dgDepute.SelectedRows.Item(0).Cells(0).Value
lblcrewname.Text = dgDepute.SelectedRows.Item(0).Cells(1).Value
btndepute.Enabled = True
Catch
lblcrewid.Text = "xxx"
lblcrewname.Text = "xxxx"
btndepute.Enabled = False
End Try
End Sub

Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnexit.Click
Me.Close()
End Sub

Private Sub btndel_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btndel.Click
Dim temp As Integer
con.Open()
com = New SqlCommand("delete from Crew where crewid=@crewid", con)
com.Parameters.AddWithValue("crewid", txtCrewID.Text)
temp = com.ExecuteNonQuery()
If temp < 0 Then
MsgBox("Error Deleting data. Please Try Again")
Else
MsgBox(temp & "Rows Affected. Delete Sucessful")
End If
con.Close()
populategrid()
End Sub
End Class

55
FORM : frmfare.vb
Imports System.Data.SqlClient

Public Class frmfare


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
Private Sub frmfare_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
populategrid()
End Sub

Private Sub btnAddNew_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnAddNew.Click

Dim temp As Integer


con.Open()
com = New SqlCommand("INSERT INTO Fare (details, class, ResCharge,
ChargePerKm, AirportTaxPercent, ServiceTaxPercent, Valid) VALUES (@details,
@class, @ResCharge, @ChargePerKm, @AirportTaxPercent, @ServiceTaxPercent,
@Valid)", con)
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 Adding data. Please Try Again")
Else
com = New SqlCommand("select @@identity", con)
dr = com.ExecuteReader()
If dr.Read Then
MsgBox("Generated Fare ID is :" & dr.GetDecimal(0).ToString,
MsgBoxStyle.Information)
txtfareid.Text = dr.GetDecimal(0).ToString
Else
MsgBox("Error Fetching Fare ID. Please Check from List.",
MsgBoxStyle.Critical)
End If
End If
con.Close()
populategrid()
End Sub

Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnUpdate.Click
Dim temp As Integer
con.Open()
com = New SqlCommand("UPDATE fare SET details=@details, class=@class,
ResCharge=@ResCharge, ChargePerKm=@ChargePerKm,

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

Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnDelete.Click
Dim temp As Integer
con.Open()
com = New SqlCommand("delete from fare where fareid=@fareid", con)
com.Parameters.AddWithValue("fareid", txtfareid.Text)
temp = com.ExecuteNonQuery()
If temp < 0 Then
MsgBox("Error Deleting data. Please Try Again")
Else
MsgBox(temp & "Rows Affected. Delete Sucessful")
End If
con.Close()
populategrid()
End Sub

Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnexit.Click
Me.Close()
End Sub
Sub populategrid(Optional ByVal fareid As Integer = 0)
Dim ds As New DataSet
con.Open()
If fareid = 0 Then
com = New SqlCommand("Select * From fare", con)
Else
com = New SqlCommand("Select * From fare where fareid=@fareid",
con)
com.Parameters.AddWithValue("fareid", fareid)
End If
Dim da As New SqlDataAdapter(com)
da.Fill(ds)
dgfare.DataSource = ds
dgfare.DataMember = ds.Tables(0).ToString()
con.Close()
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

Private Sub dgfare_CellContentClick(ByVal sender As System.Object, ByVal e


As System.Windows.Forms.DataGridViewCellEventArgs) Handles
dgfare.CellContentClick

End Sub

Private Sub dgfare_SelectionChanged(ByVal sender As Object, ByVal e As


System.EventArgs) Handles dgfare.SelectionChanged
On Error Resume Next
populatefields()
End Sub
End Class

58
FORM : frmflights.vb
Imports System.Data.SqlClient

Public Class frmFlights


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
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
populategrid()
LoadData()
End Sub

Private Sub btnAddNew_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnAddNew.Click
Dim temp As Integer
con.Open()
com = New SqlCommand("INSERT INTO flights (OriginStation, DestStation,
distance, ActualDepTime, ExpDepTime, ActualArrivalTime, ExpArrivalTime,
services, status) VALUES(@OriginStation, @DestStation, @distance,
@ActualDepTime, @ExpDepTime, @ActualArrivalTime, @ExpArrivalTime, @services,
@status)", con)
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 Adding data. Please Try Again")
Else
com = New SqlCommand("select @@identity", con)
dr = com.ExecuteReader()
If dr.Read Then
MsgBox("Generated Flight Number is : AI-" &
dr.GetDecimal(0).ToString, MsgBoxStyle.Information)
txtFlightno.Text = dr.GetDecimal(0).ToString
Else
MsgBox("Error Fetching Flight Number. Please Check from List.",
MsgBoxStyle.Critical)
End If
End If
con.Close()
populategrid()
End Sub

Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnUpdate.Click
Dim temp As Integer

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

Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnDelete.Click
Dim temp As Integer
con.Open()
com = New SqlCommand("delete from flights where flightno=@flightno",
con)
com.Parameters.AddWithValue("flightno", txtFlightno.Text)
temp = com.ExecuteNonQuery()
If temp < 0 Then
MsgBox("Error Deleting data. Please Try Again")
Else
MsgBox(temp & "Rows Affected. Delete Sucessful")
End If
con.Close()
populategrid()
End Sub

Sub populategrid(Optional ByVal flightno As Integer = 0)


Dim ds As New DataSet
con.Open()
If flightno = 0 Then
com = New SqlCommand("Select * From flights", con)
Else
com = New SqlCommand("Select * From flights where
flightno=@flightno", con)
com.Parameters.AddWithValue("flightno", flightno)
End If
Dim da As New SqlDataAdapter(com)
da.Fill(ds)

60
dgFlights.DataSource = ds
dgFlights.DataMember = ds.Tables(0).ToString()
con.Close()
End Sub

Sub populategrid(ByVal source As String, ByVal Dest As String)


Dim ds As New DataSet
con.Open()
com = New SqlCommand("Select * From flights where
OriginStation=@OriginStation and DestStation=@DestStation", con)
com.Parameters.AddWithValue("OriginStation", source)
com.Parameters.AddWithValue("DestStation", Dest)
Dim da As New SqlDataAdapter(com)
da.Fill(ds)
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

Private Sub btnSearchFlightNum_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles btnSearchFlightNum.Click
Try
populategrid(Integer.Parse(txtSFlightno.Text))
Catch
MsgBox(Err.Description, MsgBoxStyle.Critical)
End Try
End Sub

Private Sub btnSearchFromto_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnSearchFromto.Click
populategrid(cmbFrom.SelectedItem, cmbTo.SelectedItem)
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

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
End Class

62
FORM : frmprintticket.vb
Public Class frmPrintTicket

Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles CrystalReportViewer1.Load

End Sub

Private Sub frmPrintTicket_Load(ByVal sender As Object, ByVal e As


System.EventArgs) Handles Me.Load
Dim paramfields As New CrystalDecisions.Shared.ParameterFields
Dim paramfield As New CrystalDecisions.Shared.ParameterField
Dim discval As New CrystalDecisions.Shared.ParameterDiscreteValue
paramfield.ParameterFieldName = "pnr"

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

'discreteVal.Value = "Levy Year: " & glbLevyYear & " | Commitment


Number: " & glbCommitNumber
'paramfield.CurrentValues.Add(discreteVal)
'paramfields.Add(paramfield)
'Dim c As CrystalDecisions.Shared.ParameterValue
'c = 1

'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

Dim reader As SqlDataReader


Dim ds As New DataSet
Dim dt As New DataTable("Attn")

Dim a As New Collection()


Dim b As New Collection()
Dim ex As New Collection()
Public Sub createTable()
Dim cm1 As New DataColumn("ReservationID")
Dim cm2 As New DataColumn("Name")
Dim cm3 As New DataColumn("Age")
Dim cm4 As New DataColumn("Sex")
Dim cm5 As New DataColumn("SeatCode")
Dim cm6 As New DataColumn("Status")
Dim cm7 As New DataColumn("PNR")
dt.Columns.Add(cm1)
dt.Columns.Add(cm2)
dt.Columns.Add(cm3)
dt.Columns.Add(cm4)
dt.Columns.Add(cm5)
dt.Columns.Add(cm6)
dt.Columns.Add(cm7)
dgpassenger.DataSource = dt

''**********************************

''***********************************

''*************************************

End Sub

64
Private Sub cmdsearch_flt_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)

End Sub

Private Sub frmReservation_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
LoadData()

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

Private Sub Frame1_Enter(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Frame1.Enter

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnGeneratePNR.Click
Dim temp As Integer

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

Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnSearch.Click
GroupBox3.Enabled = True
If (cmbfrom.Text = "") And (cmbto.Text = "") And (cmbquota.Text = "")
And (cmbclass.Text = "") Then
MsgBox("Please Fill All four Fields")
Exit Sub
End If

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

Private Sub lstflt_SelectedIndexChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles lstflt.SelectedIndexChanged
GroupBox2.Enabled = True

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

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnPrint.Click
GroupBox1.Enabled = False
GroupBox2.Enabled = False
GroupBox3.Enabled = False
GroupBox4.Enabled = False
Frame1.Enabled = True
Dim temp As Integer
con.Open()
com = New SqlCommand("update pnr set amount = @amt where pnrno=@pnr",
con)
com.Parameters.AddWithValue("pnr", Integer.Parse(lblpnr.Text))
com.Parameters.AddWithValue("amt", Decimal.Parse(lblamt.Text))
temp = com.ExecuteNonQuery
If temp < 0 Then
MsgBox("Unable to Insert Amount in Database. Please contact
administrator")
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(lblpnr.Text))
com.Parameters.AddWithValue("datentime", Now.Date)
com.Parameters.AddWithValue("details", "CASH RECV FOR RESERVATION")
com.Parameters.AddWithValue("type", "IN")
com.Parameters.AddWithValue("Amount", Decimal.Parse(lblamt.Text))
com.Parameters.AddWithValue("transactionby",
Decimal.Parse(MDIParent2.lblusercode.Text))
temp = com.ExecuteNonQuery()
If temp < 0 Then
MsgBox("Error Occured")
End If
con.Close()

For Each a As DataRow In dt.Rows


Dim com As New SqlCommand("INSERT INTO Reservation (ResID ,doj
,PassName ,Age ,sex ,SeatCode ,status, pnr) values
(@ResID,@doj,@PassName,@Age,@sex,@SeatCode,@status, @pnr)", con)
com.Parameters.AddWithValue("ResID", a(0))
com.Parameters.AddWithValue("doj", dtdate.Value.Date)
com.Parameters.AddWithValue("PassName", a(1))

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

If cmbclass.SelectedItem = "ECONOMY" Then


For Each ctrl As RadioButton In a
ctrl.Enabled = True
Next
ElseIf cmbclass.SelectedItem = "BUSSINESS" Then
For Each ctrl As RadioButton In b
ctrl.Enabled = True
Next
ElseIf cmbclass.SelectedItem = "EXECUTIVE" Then
For Each ctrl As RadioButton In ex
ctrl.Enabled = True
Next
End If

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

'ElseIf cmbclass.SelectedItem = "ECONOMY" Then


'a.Item(Strings.Right(dr.GetString(0), 2))
For Each ctrl As RadioButton In a
If ctrl.Name = dr2.GetString(0) Then
ctrl.Enabled = False
ctrl.BackColor = Color.Red
Else
ctrl.Select()
End If
Next

69
'ElseIf cmbclass.SelectedItem = "BUSSINESS" Then

'End If
Loop

con2.Close()
End Sub

Private Sub btnaddPass_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnaddPass.Click
If lblseatcode.Text = "SELECT" And txtpassName.Text = "" And
txtage.Text = "" Then
MsgBox("Please Fill All the Fields. And Select Seat From Left Side
PANNEL")
Exit Sub
End If

Dim dr As DataRow = dt.NewRow


dr(0) = lblseatcode.Text & Integer.Parse(lstflt.SelectedItem).ToString
& lblpnr.Text
dr(1) = txtpassName.Text
dr(2) = txtage.Text
dr(3) = cmbsex.SelectedItem
dr(4) = lblseatcode.Text & lstflt.SelectedItem.ToString
dr(5) = "CNF"
dr(6) = Integer.Parse(lblpnr.Text)
dt.Rows.Add(dr)
lblamt.Text = Decimal.Parse(lblamt.Text) + Decimal.Parse(lblrate.Text)
btnRemPass.Enabled = True

lblseatcode.Text = "SELECT"
txtpassName.Text = ""
txtage.Text = ""
cmbsex.SelectedItem = "FEMALE"

End Sub

Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnexit.Click
Me.Close()
End Sub

Private Sub a_CheckedChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles a01.CheckedChanged, a02.CheckedChanged,
a03.CheckedChanged, a04.CheckedChanged, a05.CheckedChanged, a06.CheckedChanged,
a07.CheckedChanged, a08.CheckedChanged, a09.CheckedChanged, a10.CheckedChanged,
a11.CheckedChanged, a12.CheckedChanged, a13.CheckedChanged, a14.CheckedChanged,
a15.CheckedChanged, a16.CheckedChanged, a17.CheckedChanged, a18.CheckedChanged,
a19.CheckedChanged, a20.CheckedChanged, a21.CheckedChanged, a22.CheckedChanged,
a23.CheckedChanged, a24.CheckedChanged, a25.CheckedChanged, a26.CheckedChanged,
a27.CheckedChanged, a28.CheckedChanged, a29.CheckedChanged, a30.CheckedChanged,
a31.CheckedChanged, a32.CheckedChanged, a33.CheckedChanged, a34.CheckedChanged,
a35.CheckedChanged, a36.CheckedChanged
For Each ctrl As RadioButton In a
If ReferenceEquals(ctrl, sender) Then

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

Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs)
MsgBox("hello")
End Sub

Private Sub btnRemPass_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnRemPass.Click
dt.Rows.RemoveAt(dgpassenger.CurrentRow.Index)
lblamt.Text = Decimal.Parse(lblamt.Text) - Decimal.Parse(lblrate.Text)
If Integer.Parse(lblamt.Text) = 0 Then
btnRemPass.Enabled = False
End If
End Sub
End Class

71
FORM : frmseats.vb
Imports System.Data.SqlClient

Public Class frmSeats


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
Private Sub b1_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles a01.CheckedChanged

End Sub

Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles GroupBox1.Enter

End Sub

Private Sub frmSeats_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnSaveSeats.Click
On Error GoTo jk
If Trim(txtFlightNo.Text) = "" Then
MsgBox("Please Fillin the Flight Number.")
Exit Sub
End If
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)

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()

For Each ctrl As CheckBox In ex


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", "EXECUTIVE")
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

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

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
End Class

75
FORM : frmuseraccounts.vb

Imports System.Data.SqlClient

Public Class frmUserAccounts


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

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs)

End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button7.Click
Me.Close()
End Sub

Private Sub frmUserAccounts_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load

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

Private Sub btnAddUser_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnAddUser.Click
If txtusername.Text = "" And txtpass1.Text = "" Then
MsgBox("Please fill all the fields", MsgBoxStyle.Information)
Exit Sub
End If

If txtpass1.Text = txtpass2.Text Then


Dim temp As Integer
con.Open()
com = New SqlCommand("INSERT INTO login (loginid, passw, locked)
VALUES(@loginid, @passw, @locked)", con)
com.Parameters.AddWithValue("loginid", txtusername.Text)
com.Parameters.AddWithValue("passw", txtpass1.Text)
com.Parameters.AddWithValue("locked", chklocked.Checked)
temp = com.ExecuteNonQuery()
If temp < 0 Then

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

Private Sub btndel_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btndel.Click
If txtupdusername.Text = "" Then
MsgBox("Please fill all the fields", MsgBoxStyle.Information)
Exit Sub
End If

Dim temp As Integer


con.Open()
If txtupdusername.Text = txtupdusername2.Text Then
com = New SqlCommand("delete from login where loginid=@loginid",
con)
com.Parameters.AddWithValue("loginid", txtusername.Text)
temp = com.ExecuteNonQuery()
If temp < 0 Then
MsgBox("Error Deleting data. Please Try Again")
Else
MsgBox(temp & "Rows Affected. Delete Sucessful")
End If
con.Close()
populategrid()
Else
MsgBox("UserName are not same", MsgBoxStyle.Critical)
End If

End Sub

Private Sub btnupdate_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnupdate.Click
If txtupdusername.Text = "" And txtupdPass.Text = "" Then
MsgBox("Please fill all the fields", MsgBoxStyle.Information)
Exit Sub
End If
If txtupdusername.Text = txtupdusername2.Text Then
Dim temp As Integer
con.Open()
com = New SqlCommand("UPDATE login SET passw=@passw, locked=@locked
where loginid=@loginid", con)
com.Parameters.AddWithValue("loginid", txtupdusername.Text)
com.Parameters.AddWithValue("passw", txtupdPass.Text)
com.Parameters.AddWithValue("locked", chkupdlocked.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()

77
populategrid()
Else
MsgBox("UserName are not same", MsgBoxStyle.Critical)
End If
End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtupdPass.TextChanged

End Sub

Private Sub btnreset_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnreset.Click
If txtresetuid.Text = txtresetuid2.Text Then
If txtresetpass.Text = txtresetpass2.Text Then
Dim temp As Integer
con.Open()
com = New SqlCommand("UPDATE login SET passw=@passw,
locked=@locked where loginid=@loginid", con)
com.Parameters.AddWithValue("loginid", txtresetuid.Text)
com.Parameters.AddWithValue("passw", txtresetpass.Text)
com.Parameters.AddWithValue("locked", False)
temp = com.ExecuteNonQuery()
If temp < 0 Then
MsgBox("Error RESETTING PASSWORD. Please Try Again")
Else
MsgBox("PASSWORD RESET SUCCESSFUL")
End If
con.Close()
Else
MsgBox("passwords are nt same")
End If
Else
MsgBox("UserID arenot same")
End If

End Sub
End Class

78
FORM : mdiparent1.vb
Imports System.Windows.Forms

Public Class MDIParent2


Public currentpnr As Decimal = 0
Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs)
Handles NewToolStripMenuItem.Click, tsreservation.Click
' Create a new instance of the child form.
Dim ChildForm As New frmReservation

ChildForm.MdiParent = Me

m_ChildFormNumber += 1

ChildForm.Text = "RESERVATION"
ChildForm.Show()
End Sub

Private Sub OpenFile(ByVal sender As Object, ByVal e As EventArgs)


Dim OpenFileDialog As New OpenFileDialog
OpenFileDialog.InitialDirectory =
My.Computer.FileSystem.SpecialDirectories.MyDocuments
OpenFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
If (OpenFileDialog.ShowDialog(Me) =
System.Windows.Forms.DialogResult.OK) Then
Dim FileName As String = OpenFileDialog.FileName
' TODO: Add code here to open the file.
End If
End Sub

Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As Object, ByVal e


As EventArgs)
Dim SaveFileDialog As New SaveFileDialog
SaveFileDialog.InitialDirectory =
My.Computer.FileSystem.SpecialDirectories.MyDocuments
SaveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"

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

Private Sub ExitToolsStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs) Handles ExitToolStripMenuItem.Click
End
End Sub

Private Sub CutToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)

79
' Use My.Computer.Clipboard to insert the selected text or images into
the clipboard
End Sub

Private Sub CopyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
' Use My.Computer.Clipboard to insert the selected text or images into
the clipboard
End Sub

Private Sub PasteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
'Use My.Computer.Clipboard.GetText() or My.Computer.Clipboard.GetData
to retrieve information from the clipboard.
End Sub

Private Sub CascadeToolStripMenuItem_Click(ByVal sender As Object, ByVal e


As EventArgs)
Me.LayoutMdi(MdiLayout.Cascade)
End Sub

Private Sub TileVerticalToolStripMenuItem_Click(ByVal sender As Object,


ByVal e As EventArgs)
Me.LayoutMdi(MdiLayout.TileVertical)
End Sub

Private Sub TileHorizontalToolStripMenuItem_Click(ByVal sender As Object,


ByVal e As EventArgs)
Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub

Private Sub ArrangeIconsToolStripMenuItem_Click(ByVal sender As Object,


ByVal e As EventArgs)
Me.LayoutMdi(MdiLayout.ArrangeIcons)
End Sub

Private Sub CloseAllToolStripMenuItem_Click(ByVal sender As Object, ByVal e


As EventArgs)
' Close all child forms of the parent.
For Each ChildForm As Form In Me.MdiChildren
ChildForm.Close()
Next
End Sub

Private m_ChildFormNumber As Integer

Private Sub ViewMenu_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles ViewMenu.Click

End Sub

Private Sub ToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles ToolStripMenuItem3.Click
Dim ChildForm As New frmCash
' Make it a child of this MDI form before showing it.

80
ChildForm.MdiParent = Me

m_ChildFormNumber += 1

ChildForm.Text = "RESERVATION"
ChildForm.Show()
End Sub

Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles ToolStripMenuItem1.Click
' Create a new instance of the child form.
Dim ChildForm As New frmCancellation
' Make it a child of this MDI form before showing it.

ChildForm.MdiParent = Me

m_ChildFormNumber += 1

ChildForm.Text = "CANCELLATION"
ChildForm.Show()
End Sub

Private Sub ToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles ToolStripMenuItem2.Click
' Create a new instance of the child form.
Dim ChildForm As New frmFlights
' Make it a child of this MDI form before showing it.

ChildForm.MdiParent = Me

m_ChildFormNumber += 1

ChildForm.Text = "FLIGHT DETAILS"


ChildForm.Show()
End Sub

Private Sub SeatingManagementToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
SeatingManagementToolStripMenuItem.Click
Dim ChildForm As New frmSeats
' Make it a child of this MDI form before showing it.

ChildForm.MdiParent = Me

m_ChildFormNumber += 1

ChildForm.Text = "SEATING DETAILS"


ChildForm.Show()
End Sub

Private Sub ManageFlightFareToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ManageFlightFareToolStripMenuItem.Click
Dim ChildForm As New frmfare
' Make it a child of this MDI form before showing it.

81
ChildForm.MdiParent = Me

m_ChildFormNumber += 1

ChildForm.Text = "RESERVATION"
ChildForm.Show()
End Sub

Private Sub ManageCrewToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ManageCrewToolStripMenuItem.Click
Dim ChildForm As New frmcrew
' Make it a child of this MDI form before showing it.

ChildForm.MdiParent = Me

m_ChildFormNumber += 1

ChildForm.Text = "RESERVATION"
ChildForm.Show()
End Sub

Private Sub CashReportToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
CashReportToolStripMenuItem.Click
Dim childform As New repcash
childform.MdiParent = Me
childform.Show()
End Sub

Private Sub CrewDeputationListToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
CrewDeputationListToolStripMenuItem.Click
Dim childform As New repCrew
childform.MdiParent = Me
childform.Show()
End Sub

Private Sub PassengerListToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
PassengerListToolStripMenuItem.Click
Dim childform As New RepPassenger
childform.MdiParent = Me
childform.Show()
End Sub

Private Sub CancellationListToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
CancellationListToolStripMenuItem.Click
Dim childform As New RepCan
childform.MdiParent = Me
childform.Show()
End Sub

Private Sub ReservationChartToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ReservationChartToolStripMenuItem.Click

82
Dim childform As New RepRes
childform.MdiParent = Me
childform.Show()
End Sub

Private Sub FlightsInformationToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
FlightsInformationToolStripMenuItem.Click
Dim childform As New frmFlight
childform.MdiParent = Me
childform.Show()
End Sub

Private Sub MDIParent2_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
lblusercode.Text = LoginForm1.usercode
lbluser.Text = LoginForm1.user
End Sub

Private Sub tscancellation_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles tscancellation.Click
Dim ChildForm As New frmCancellation

ChildForm.MdiParent = Me

m_ChildFormNumber += 1

ChildForm.Text = "CANCELLATION"
ChildForm.Show()
End Sub

Private Sub txprintticket_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txprintticket.Click
currentpnr = 0
frmPrintTicket.ShowDialog()
End Sub

Private Sub PrintToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles PrintToolStripMenuItem.Click
currentpnr = 0
frmPrintTicket.ShowDialog()
End Sub

Private Sub AirportsInformationToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
AboutBox1.ShowDialog()
End Sub

Private Sub ManageUsersToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ManageUsersToolStripMenuItem.Click
Dim ChildForm As New frmUserAccounts

83
ChildForm.MdiParent = Me

m_ChildFormNumber += 1

ChildForm.Text = "Manage User Accounts"


ChildForm.Show()
End Sub
End Class

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

1. Introduction to Microsoft Visual Basic.NET 2.0 by Steven Holzner


2. Software Engineering by Roger S Pressman

Websites Used
1. www.google.com
2. www.thinkdigit.com
3. www.programmersheaven.com
4. www.codeguru.com
5. www.airindia.in

87

Вам также может понравиться