airlines registration system black book

Upload: jasmit-kaur

Post on 07-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/4/2019 Airlines Registration System Black Book

    1/86

    APROJECT REPORT

    ON

    AIRLINES RESERVATION SYSTEMSUBMITTED TO

    YASHWANTRAO CHAVAN MAHARASHTRA OPEN

    UNIVERSITY, NASHIKIN PARTIAL FULFILLMENT OF THE

    REQUIREMENT FOR THE DEGREE OF

    BACHELOR OF COMPUTER APPLICATIONBY

    Mr.SWAPNISH S. JADHAV PRN No. Y004592

    Mr.HEMANT B. GAIKWAD PRN No. Y004586Mr.SAHIL A. KAPDI PRN No. Y004599

    UNDER GUIDANCE OFMrs. GAYTRI KARNIK

    Mrs. JYOTI BHOITE

    ATHARVA EDUCATIONAL TRUSTSATHARVA INSTITUTE OF INFORMATION TECHNOLOGY

    MALAD-MARVE ROAD, CHARKOP NAKA, MALAD(W),

    MUMBAI-400067.2010-2011

  • 8/4/2019 Airlines Registration System Black Book

    2/86

    CERTIFICATE

    This is to certify that the dissertation entitled

    AIRLINES RESERVATION SYSTEM

    is bonafide work carried outby

    Mr.SWAPNISH S. JADHAV PRN No. Y004592

    Mr.HEMANT B. GAIKWAD PRN No. Y004586

    Mr.SAHIL A. KAPDI PRN No. Y004599

    under our supervision, during the year 2010-11 and is submitted to the

    faculty of Atharva Institute of Information Technology under Yashwantrao

    Chavan Maharashtra Open University, Nashik in partial fulfillment of the

    requirement for the Degree of Bachelor of Computer Application.

    Mrs. Lata Bhatia Mrs. ShilpaMistry(Director A.I.I.T.) (H.O.D. A.I.I.T.)

    Mrs. Gaytri Karnik & Mrs. Jyoti Bhoite(Project Guide) EXTERNALEXAMINER

    ACKNOWLEDGEMENT

  • 8/4/2019 Airlines Registration System Black Book

    3/86

    I would like to take this opportunity to express my gratitudetowards all the people who have in various ways, helped in thesuccessful completion of my project.I also thank all my faculty members for steering me through the

    tough as well as easy phases of the project in a result orientedmanner with concern attention.

  • 8/4/2019 Airlines Registration System Black Book

    4/86

    Airlines Reservation System

    Index

  • 8/4/2019 Airlines Registration System Black Book

    5/86

    1. Problem Definition

    2. Feasibility Study

    3. System Analysis

    4. Dataflow Diagram

    5.Software Product Feature

    6.Software System Attributes

    7. Coding

    8. Testing

    9. Conclusion

  • 8/4/2019 Airlines Registration System Black Book

    6/86

    PROBLEM DEFINITION

  • 8/4/2019 Airlines Registration System Black Book

    7/86

    PROBLEM DEFINITION

    The definition of our problem lies in manual system and afully automated system.

    Manual system :The system is very time consuming and lazy. This system is

    more prone toerrors and sometimes the approach to various problems isunstructured.

    Technical system :

    With the advent of latest technology if we do not update oursystem then our business result in losses gradually with time. Thetechnical systems contains the tools of latest trend i.e. computersprinters, fax, Internet etc. The systems with this technology arevery fast,accurate, user-friendly and reliable.

  • 8/4/2019 Airlines Registration System Black Book

    8/86

    Need of Airlines systemA few factors that directs us to develop a new system are givenbelow -:

    1) Faster System2) Accuracy3) Reliability4) Informative5) Reservations and cancellations from any where to any place

    Airlines S stem

    Updation

    CancellationReservation

    FEASIBILITY STUDY

  • 8/4/2019 Airlines Registration System Black Book

    9/86

    FEASIBILITY STUDY

    Feasibility study is to check the viability of the project underconsideration. Theoretically various types of feasibilities areconducted, but we have conducted three type of feasibilitiesexplained as under.

    ECONOMIC FEASIBILITYWith 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 withthe new system this reoccurring cost comes out to be about 20Lacks P.A. Hence the new system is economically feasible.

    TECHNICAL FEASIBILITYThe new system requires only 6 trained person to work with

    the system and in overall 10 people per office are sufficient. Sowe will identify 6 best people from existing system and train them.

  • 8/4/2019 Airlines Registration System Black Book

    10/86

    As our existing system is purely manual, so we need a one timeinvestment of Rs 4 Laks for the purchase of 7 computers, 5 Ticketprinters, a laser printer, AC and networking etc. It requires 20Lacks PA as a operating cost.

    With the above details our system is technically feasible as afterinvesting 24 Lacks in a year, the company is still saving Rs 25Lacks PA.

    OPERATIONAL FEASIBILITYThe new solution is feasible in all sence but operationally it is

    not. The new system demands the expulsion of at least 15 peoplefrom the company. It creates an environment of joblessness and

    fear among the employees. It can lead to an indefinite strike in thecompany also. So the management must take corrective actionsprior in advance in order to start the further proceedings.

    SYSTEM ANALYSIS

  • 8/4/2019 Airlines Registration System Black Book

    11/86

    SYSTEM ANALYSIS

    This was the most important phase of my project life cycle .It hadconnected my maximum time.The block diagram given bellow depict various fact which wereunderstood by one during theanalysis phase.

    BLOCKDIAGRAM

  • 8/4/2019 Airlines Registration System Black Book

    12/86

    In that phase initially I had observed the system Airport.The above block diagram is an implementation of this observation

    .In the next phase I had various quiries in my mind ,Which I tried toask from appropriate

    Q.1 Tick mark the features to be included in the new system?

    Enquiry

  • 8/4/2019 Airlines Registration System Black Book

    13/86

    Reservation

    Cancellation

    Report

    Edit

    Other specify

    Q2. Tick mark that the system should be ?

    Multi-user

    Single user

    Q3. Tick marks the total time required for the implementation ofthe project?

    3 months6 months

    9 months

    Others specify

    Q4. Tick mark the reports to be Incorporated?

    List of all passenger

    List of all flights

    List of passenger(date wise)

    List of passenger(flight wise)

    Any other

    After getting solution my queries I started studying databasestructure used in the existingsystem . In this connection I had come to know about variousmaster files as

    In passenger list : Passenger name,Address , tel_no , d_o_b,profession father name,

    Move of payment: Passenger code ,Date of paid ,Current date,cash, Debit,cheque,credit.

  • 8/4/2019 Airlines Registration System Black Book

    14/86

    Fare: route , destination place ,source place ,Departure time,Arrival time,Flight code,class,Fare.

    Reservation: Ticket report, flight code, destination place, sourceplace, departure timearrival time , Class, Age, sex, Fare,

    Enquiry: Ticket no, seat number , pnr.

    Cases for building project:

    For windows application:

    B.1: The employee login to the flight system: the employee loginto the system by entering his username and password.

  • 8/4/2019 Airlines Registration System Black Book

    15/86

    B.2: Costumers request for flight: the Costumers asks for a flightto be booked.

    B.3: The employee looks for the Costumers request: the

    employee takes information from the Costumers to find theavailable flight.

    B.4: Costumers confirm reservation to flight: the Costumersreserve the flight that available and which he see that its suitable.

    B.5: The employee reserve flight: the employee reserve flightwhich the Costumers needs.

    B.6: Costumers wants to cancel a flight: the Costumers asks for aflight to be canceled.

    B.7: The employee cancel the Costumers reservation: theemployee takes information from the Costumers to cancel theflight.

    B.8: The Costumers request data: the Costumers want to knowsome information about flights.

    B.9: The employee search for data: the employee search forinformation needed.

    B.10: The employee logout from the flight system: the employeelogout from the flight system by press logout button.

  • 8/4/2019 Airlines Registration System Black Book

    16/86

    DATA FLOW DIAGRAM:

    DATA FLOW DIAGRAM

  • 8/4/2019 Airlines Registration System Black Book

    17/86

    1.Basic

    2.Reservation

    3.Flight Schdules

    USER AirlinereservationSystem

    Reservation

    Display

    User ReservationAccept the

    Data in the

    file

    Passenger Databa

    USER

  • 8/4/2019 Airlines Registration System Black Book

    18/86

    FLIGHT SCHEDULE

    UPDATE NEW

    FLIGHT ID

    Destination

    SOURCE

    Date and Time

    Input Flight ID

    Save In Database

  • 8/4/2019 Airlines Registration System Black Book

    19/86

    SOFTWARE PRODUCT FEATURES

    FEATURE 1

    The Software can creat more than one user accounts ,,These accounts are of two

    types,,normal user or Administrator ,

    Difference between both is Administrator have access to control user window,,

    So he can managa all the users and can create or delete some!

    SOFTWARE PRODUCT FEATURES

  • 8/4/2019 Airlines Registration System Black Book

    20/86

    FEATURE 2

    The ability of the software is to provide the details of the flights available and

    allow the customers to choose a particular destination and make a reservation

    Where ticket id gets generated automatically!

    PURPOSE

    The purpose of this is to enable the users to view the different flights

    available so as to make it convenient for him to make a reservation.

    ASSOCIATED FUNCTIONAL REQUIREMENTS

    The user must enter the destination with date and timings and must make

    reservation by giving his personal details like name, address, age, gender.

    The software allows the user to modify an already existing reservation made

    by the customer if in case there are any changes that are to be modified in

    the reservations of the ticket.

    PURPOSE

    The purpose is to allow the customer to make any changes in his personal

    details or flight booking details.

    FEATURE 3

    User can create Flight schedule tables so by reference of that database

    User can input values in Customer reservation forms.

    SOFTWARE SYSTEM ATTRIBUTES

  • 8/4/2019 Airlines Registration System Black Book

    21/86

  • 8/4/2019 Airlines Registration System Black Book

    22/86

    SOFTWARE SYSTEM ATTRIBUTES

    Reliability

    The factors needed to establish the software expected reliability are

    The user inputs should be valid and within the given range. Normal termination of the program.

    Availability

    The factors guarantee the softwares availability includes proper termination and

    correct input details. Also the resources used for the project development are

    Microsoft Certified which speaks of its high quality standards.

    Security

    It must be ensured that access will be provided to the authorized persons

    through user ID and password. Checks can be performed at regular internals to ensure data integrity.

    Maintainability

    The software will be developed by implementing the concept of modularity which

    in turn reduces the complexity involved in maintaining it. The administrator shouldhave a sound technical knowledge about maintaining the software and further

    enhancements will be undertaken by the developer.

    Portability

    The application is portable which ensures its adaptability for use on different

    computer terminals with different operating systems and standards.

    LOGICAL DATABASE REQUIREMENTS

    The system requires the use of text files to maintain the customers personal detailsand his booking details. An entity must be used to specify the various departments

    and the seats available in them. This information will be used frequently by the

    authorities for verification.

  • 8/4/2019 Airlines Registration System Black Book

    23/86

  • 8/4/2019 Airlines Registration System Black Book

    24/86

    Login Form

    CODING

  • 8/4/2019 Airlines Registration System Black Book

    25/86

    Imports System.Data.SqlClientPublicClass frmLogin

    Dim u_pass, u_name, Status AsStringDim count AsInteger = 0Dim con AsNew SqlConnection("Data

    Source=localhost\SQLExpress;Initial

    Catalog=AirLine;Integrated Security=True")Dim com AsNew SqlCommandDim r As SqlDataReaderPrivateSub frmLogin_Load(ByVal sender As

    System.Object, ByVal e As System.EventArgs)HandlesMyBase.Load

    'TODO: This line of code loads data intothe 'AirLineDataSet.tbluser' table. You canmove, or remove it, as needed.

    Me.TblUserTableAdapter.Fill(Me.AirLineDataSet.tblUser)

    frmLoad.Hide()EndSub

  • 8/4/2019 Airlines Registration System Black Book

    26/86

    PrivateSub btnLogin_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles btnLogin.Click

    u_pass = Trim(txtPassword.Text)

    u_name = Trim(cmbUserName.Text)count = count + 1

    If cmbUserName.Text = ""ThenMsgBox("Please select a Username",

    MsgBoxStyle.Information, "Password Check")ElseIf txtPassword.Text = ""Then

    MsgBox("Please Enter Your Password",

    MsgBoxStyle.Information, "Password Check")ElseIf u_pass = passcheck(u_name) ThenfrmMain.Show()frmMain.StatusLabel.Text = "User Log

    In : " & u_namefrmMain.StatusTime1.Text = " Time :

    " & NowIf Status "Administrator"Then

    frmMain.mnuControlUsers.Enabled

    = FalseEndIfMe.Hide()

    ElseMsgBox("Wrong Password" & vbCrLf &

    "Please Check Your Password",MsgBoxStyle.Information, "Password Check")

    EndIf

    If count >= 3 ThenMsgBox("Maximum Attempts Reached" &

    vbCrLf & "The Program will Terminate now",MsgBoxStyle.Information, "Password Check")

    Me.Close()EndIf

  • 8/4/2019 Airlines Registration System Black Book

    27/86

    EndSub

    PrivateSub btnLogout_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)

    Handles btnLogout.ClickIf MsgBox("Do you want to Logout",

    MsgBoxStyle.Information +MessageBoxButtons.YesNo, "AirLine TicketManagement System") = DialogResult.Yes Then

    Me.Close()EndIf

    EndSub

    Function passcheck(ByVal name AsString) AsString

    Dim a AsString = "null"Dim b AsString = "null"com.Connection = concom.CommandText = ("Select Password,

    Status from tblUser where UserName='" & name &"'")

    con.Open()Try

    r = com.ExecuteReaderr.Read()a = r(0)b = r(1)r.Close()

    Catch ex As Exception

    MsgBox(ex.Message)EndTryStatus = bReturn (a)con.Close()

    EndFunction

  • 8/4/2019 Airlines Registration System Black Book

    28/86

    EndClass

    Main Form

  • 8/4/2019 Airlines Registration System Black Book

    29/86

    Imports System.Windows.FormsImports System.Data.SqlClientPublicClass frmMain

    Dim blnActive AsBooleanPrivate m_ChildFormNumber AsIntegerDim con AsNew SqlConnection("Data

    Source=localhost\SQLExpress;Initial

    Catalog=AirLine;Integrated Security=True")Dim com AsNew SqlCommandDim r As SqlDataReader

    PrivateSubExitToolsStripMenuItem_Click(ByVal sender As

  • 8/4/2019 Airlines Registration System Black Book

    30/86

    Object, ByVal e As EventArgs) HandlesmnuExit.Click

    Application.Exit()EndSub

    PrivateSubStatusBarToolStripMenuItem_Click(ByVal sender AsObject, ByVal e As EventArgs) HandlesmnuStatusBar.Click

    Me.Statustime.Visible =Me.mnuStatusBar.Checked

    EndSub

    PrivateSubCascadeToolStripMenuItem_Click(ByVal sender AsObject, ByVal e As EventArgs) HandlesCascadeToolStripMenuItem.Click

    Me.LayoutMdi(MdiLayout.Cascade)EndSub

    PrivateSub

    TileVerticalToolStripMenuItem_Click(ByVal senderAsObject, ByVal e As EventArgs) HandlesTileVerticalToolStripMenuItem.Click

    Me.LayoutMdi(MdiLayout.TileVertical)EndSub

    PrivateSubTileHorizontalToolStripMenuItem_Click(ByVal

    sender AsObject, ByVal e As EventArgs) HandlesTileHorizontalToolStripMenuItem.Click

    Me.LayoutMdi(MdiLayout.TileHorizontal)EndSub

  • 8/4/2019 Airlines Registration System Black Book

    31/86

    PrivateSubArrangeIconsToolStripMenuItem_Click(ByVal senderAsObject, ByVal e As EventArgs)

    Me.LayoutMdi(MdiLayout.ArrangeIcons)

    EndSub

    PrivateSubCloseAllToolStripMenuItem_Click(ByVal sender AsObject, ByVal e As EventArgs) HandlesCloseAllToolStripMenuItem.Click

    ForEach ChildForm As Form InMe.MdiChildren

    ChildForm.Close()NextEndSub

    PublicFunction IsOpen(ByVal nameForm AsString) AsBoolean

    Dim childfrm As FormDim strName AsStringDim intLastIndex AsInteger

    ForEach childfrm InMe.MdiChildrenstrName = childfrm.GetType.ToStringintLastIndex =

    strName.LastIndexOf(".")strName = Mid(strName, intLastIndex

    + 2, Len(strName) - intLastIndex)If LCase(strName) = LCase(nameForm)

    Thenchildfrm.BringToFront()ReturnTrue

    EndIfNextReturnFalse

  • 8/4/2019 Airlines Registration System Black Book

    32/86

    EndFunction

    PrivateSub MainForm_Load(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)

    HandlesMyBase.LoadIf blnActive = IsOpen("TicketList") Then

    Dim TicList AsNew frmCustomerListTicList.MdiParent = MeTicList.StartPosition =

    FormStartPosition.CenterScreenTicList.WindowState =

    FormWindowState.Maximized

    TicList.Show()EndIfEndSub

    PrivateSub mnuTicketsList_Click(ByValsender As System.Object, ByVal e AsSystem.EventArgs) Handles mnuTicketsList.Click

    MainForm_Load(sender, e)EndSub

    PrivateSub MnAddNew_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)

    If blnActive = IsOpen("UpdateTicket")Then

    Dim frmCustomerRegisterDetails AsNew frmCustomerRegisterDetails

    frmCustomerRegisterDetails.MdiParent

    = Me

    frmCustomerRegisterDetails.StartPosition =FormStartPosition.CenterScreen

  • 8/4/2019 Airlines Registration System Black Book

    33/86

    frmCustomerRegisterDetails.WindowState =FormWindowState.Maximized

    frmCustomerRegisterDetails.Show()

    EndIfEndSub

    PrivateSub mnuSchedulesList_Click(ByValsender As System.Object, ByVal e AsSystem.EventArgs) Handles mnuSchedulesList.Click

    If blnActive = IsOpen("Schedule") ThenDim frmSchedule AsNew frmSchedule

    frmSchedule.MdiParent = MefrmSchedule.StartPosition =FormStartPosition.CenterScreen

    frmSchedule.WindowState =FormWindowState.Maximized

    frmSchedule.Show()EndIf

    EndSub

    PrivateSub mnuLogOut_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles mnuLogOut.Click

    If MsgBox("Do you want to Logout",MsgBoxStyle.Information +MessageBoxButtons.YesNo, "AirLine TicketManagement System") = DialogResult.Yes Then

    Me.Hide()

    frmLogin.Show()frmLogin.cmbUserName.Text = NothingfrmLogin.txtPassword.Text = ""

    EndIfEndSub

  • 8/4/2019 Airlines Registration System Black Book

    34/86

    PrivateSubControlUsersToolStripMenuItem_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)Handles mnuControlUsers.Click

    If blnActive = IsOpen("ControlUserForm")Then

    Dim frmControlUserForm AsNewfrmControlUserForm

    frmControlUserForm.MdiParent = MefrmControlUserForm.StartPosition =

    FormStartPosition.CenterScreenfrmControlUserForm.WindowState =

    FormWindowState.MaximizedfrmControlUserForm.Show()EndIf

    EndSub

    PrivateSubPrintReceiptToolStripMenuItem_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)Handles PrintReceiptToolStripMenuItem.Click

    showPR()EndSub

    PrivateSubTicketDetailsToolStripMenuItem_Click(ByValsender As System.Object, ByVal e AsSystem.EventArgs) HandlesTicketDetailsToolStripMenuItem.Click

    If blnActive = IsOpen("TicketDetails")Then

    Dim frmTicketDetails AsNewfrmTicketDetails

    frmTicketDetails.MdiParent = Me

  • 8/4/2019 Airlines Registration System Black Book

    35/86

    frmTicketDetails.StartPosition =FormStartPosition.CenterScreen

    frmTicketDetails.WindowState =FormWindowState.Maximized

    frmTicketDetails.Show()EndIf

    EndSubPublicSub showPR()

    If blnActive = IsOpen("PrintReceipt")Then

    Dim frmPrintReceipt AsNewfrmPrintReceipt

    frmPrintReceipt.MdiParent = MefrmPrintReceipt.StartPosition =FormStartPosition.CenterScreen

    frmPrintReceipt.WindowState =FormWindowState.Maximized

    frmPrintReceipt.Show()EndIf

    EndSubEndClass

  • 8/4/2019 Airlines Registration System Black Book

    36/86

    Flight Schedule

    Imports System.Data.SqlClientPublicClass frmSchedule

    'Dim connection As SqlConnectionDim adapter AsNew SqlDataAdapter

    Dim sql, tbl AsStringDim ds AsNew DataSetDim cmdBuilder As SqlCommandBuilderDim fname AsStringDim com AsNew SqlCommand

  • 8/4/2019 Airlines Registration System Black Book

    37/86

    Dim con AsNew SqlConnection("DataSource=localhost\SQLExpress;InitialCatalog=AirLine;Integrated Security=True")

    Dim bs AsNew BindingSource

    PrivateSubcmbFlight_SelectedIndexChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles cmbFlight.SelectedIndexChanged

    If cmbFlight.Text = ""ThenMsgBox("Please Enter Proper

    Selection", MsgBoxStyle.Information, "InputCheck")

    ElseIf dgvFlight.DataSource = ""Thentbl = Trim(cmbFlight.Text)'connection = New

    SqlConnection(con)sql = "select * from " & tbl &

    ""Try

    con.Open()

    adapter = NewSqlDataAdapter(sql, con)

    adapter.Fill(ds)con.Close()dgvFlight.DataSource =

    ds.Tables(0)Catch ex As Exception

    MsgBox(ex.ToString)

    EndTrybs.DataSource = ds.Tables(0)BindingNavigator1.BindingSource

    = bsdgvFlight.DataSource = bs

    EndIf

  • 8/4/2019 Airlines Registration System Black Book

    38/86

    EndIfEndSub

    PrivateSub tsbEditRecord_Click(ByVal sender

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

    frmAddFlightSchedule.Show()EndSub

    PrivateSub frmSchedule_Load(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)HandlesMyBase.Load

    EndSub

    PrivateSub tsbAddNewFlight_Click(ByValsender As System.Object, ByVal e AsSystem.EventArgs) Handles tsbAddNewFlight.Click

    fname = Trim(InputBox("Enter the name ofFlight", "Input Check"))

    If fname = ""Or IsNumeric(fname) = True

    ThenMsgBox("Process Failed due to Wrong

    Input", MsgBoxStyle.Critical)ExitSub

    EndIfcom.Connection = concom.CommandText = ("CREATE TABLE '" &

    fname & "'(Time varchar2(50), Sunday

    varchar2(50), Monday varchar2(50), Tuesdayvarchar2(50), Wednesday varchar2(50), Thursdayvarchar2(50), Friday varchar2(50), Saturdayvarchar2(50))")

    con.Open()Try

  • 8/4/2019 Airlines Registration System Black Book

    39/86

    com.Connection = concom.ExecuteNonQuery()

    Catch ex As ExceptionMsgBox(ex.Message)

    EndTrycon.Close()MsgBox("Values Added Successfully",

    MsgBoxStyle.Information)EndSub

    PrivateSub tsbRemoveFlight_Click(ByValsender As System.Object, ByVal e As

    System.EventArgs) Handles tsbRemoveFlight.Click

    EndSubEndClass

  • 8/4/2019 Airlines Registration System Black Book

    40/86

    Ticket Details

    PublicClass frmTicketDetails

    PrivateSub frmTicketDetails_Load(ByValsender As System.Object, ByVal e AsSystem.EventArgs) HandlesMyBase.Load

    'TODO: This line of code loads data intothe 'AirLineDataSet.tblTicketDetails' table. Youcan move, or remove it, as needed.

    Me.TblTicketDetailsTableAdapter.Fill(Me.AirLineDataSet.tblTicketDetails)

  • 8/4/2019 Airlines Registration System Black Book

    41/86

    EndSub

    PrivateSub tsbAddNew_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)

    Handles tsbAddNew.ClickfrmAddTicketDetails.Show()

    EndSub

    PrivateSub tsbRefresh_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles tsbRefresh.Click

    If AirLineDataSet.HasChanges Then

    Dim dtc AsAirLineDataSet.tblTicketDetailsDataTabledtc =

    AirLineDataSet.tblTicketDetails.GetChanges()If dtc IsNotNothingThen

    Try

    TblTicketDetailsTableAdapter.Update(dtc)Catch ex As Exception

    MsgBox(ex.Message)ExitSub

    EndTryMsgBox(dtc.Rows.Count.ToString &

    " row(s) updated successfully")EndIf

    EndIf

    Me.TblTicketDetailsTableAdapter.Fill(Me.AirLineDataSet.tblTicketDetails)

    EndSub

  • 8/4/2019 Airlines Registration System Black Book

    42/86

    PrivateSub tsbDelete_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles tsbDelete.Click

    If MsgBox("Are you sure you want to

    Delete the Record?", MsgBoxStyle.Information,"AirLine Ticket Management System") =DialogResult.Yes Then

    Try

    dgvTicketDetails.Rows.Remove(dgvTicketDetails.SelectedRows(0))

    Catch ex As Exception

    MsgBox("Select the Record ToDelete", MsgBoxStyle.Information, "Input Check")EndTry

    EndIfIf AirLineDataSet.HasChanges Then

    Dim dtc AsAirLineDataSet.tblTicketDetailsDataTable

    dtc =AirLineDataSet.tblTicketDetails.GetChanges()

    If dtc IsNotNothingThenTry

    TblTicketDetailsTableAdapter.Update(dtc)Catch ex As Exception

    MsgBox(ex.Message)ExitSub

    EndTry

    MsgBox(dtc.Rows.Count.ToString &" row(s) updated successfully")

    EndIfEndIf

  • 8/4/2019 Airlines Registration System Black Book

    43/86

    Me.TblTicketDetailsTableAdapter.Fill(Me.AirLineDataSet.tblTicketDetails)

    EndSub

    EndClass

  • 8/4/2019 Airlines Registration System Black Book

    44/86

    Customer Register Details

    Imports System.Data.SqlClient

    PublicClass frmCustomerRegisterDetailsDim adapter AsNew SqlDataAdapterDim connection As SqlConnectionPublic cid, ncid, values AsString'Private IsInitializing As Boolean

  • 8/4/2019 Airlines Registration System Black Book

    45/86

    'Private blnSaved As BooleanDim con AsNew SqlConnection("Data

    Source=localhost\SQLExpress;InitialCatalog=AirLine;Integrated Security=True")

    Dim com AsNew SqlCommandDim r As SqlDataReader

    PrivateSub frmUpdateTicket_Load(ByValsender As System.Object, ByVal e AsSystem.EventArgs) HandlesMyBase.Load

    autogencid()autogenFrom()

    autogenTo()EndSub

    PrivateSub btnSave_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles btnSave.Click

    If txtName.Text = ""OrIsNumeric(txtName.Text) = TrueThen

    MsgBox("Please Enter ur Name" &

    vbCrLf & "Data entered Should be Alphabets",MsgBoxStyle.Information, "Input Check")

    ElseIf cmbGender.Text = ""ThenMsgBox("Please Enter Valid Selection

    for Gender Option", MsgBoxStyle.Information,"Input Check")

    ElseIf txtAddress.Text = ""ThenMsgBox("Please Enter the Address

    Option", MsgBoxStyle.Information, "Input Check")ElseIf txtphone.Text = ""Then

    MsgBox("Please Enter Proper PhoneNumber Option", MsgBoxStyle.Information, "InputCheck")

    ElseIf txtAge.Text = ""Then

  • 8/4/2019 Airlines Registration System Black Book

    46/86

    MsgBox("Please Enter Proper AgeOption", MsgBoxStyle.Information, "Input Check")

    ElseIf cmbFlight.Text = ""ThenMsgBox("Please Enter Valid Selection

    for 'Flight' Option", MsgBoxStyle.Information,"Input Check")

    ElseIf cmbFrom.Text = ""ThenMsgBox("Please Enter Valid Selection

    for 'From' Option", MsgBoxStyle.Information,"Input Check")

    ElseIf cmbTo.Text = ""ThenMsgBox("Please Enter Valid Selection

    for 'To' Option", MsgBoxStyle.Information,"Input Check")ElseIf cmbClass.Text = ""Then

    MsgBox("Please Enter Valid Selectionfor 'Class' Option", MsgBoxStyle.Information,"Input Check")

    ElseIf txtTicketIdNo.Text = ""OrIsNumeric(txtTicketIdNo.Text) = FalseThen

    MsgBox("Please Enter Ticket Id no.",

    MsgBoxStyle.Information, "Input Check")ElseIf (Val(txtAge.Text) < 1) Then

    MsgBox("Please Enter Proper Age" &vbCrLf & "Age should be between 1 - 100 yrs ",MsgBoxStyle.Information, "Input Check")

    ElseIf (Val(txtAge.Text) > 100) ThenMsgBox("Please Enter Proper Age" &

    vbCrLf & "Age should be between 1 - 100 yrs ",

    MsgBoxStyle.Information, "Input Check")Else

    com.Connection = concom.CommandText = ("INSERT INTO

    tblCustomerDetails VALUES ('" & txtID.Text &"','" & txtName.Text & "','" & cmbGender.Text &

  • 8/4/2019 Airlines Registration System Black Book

    47/86

    "','" & txtAddress.Text & "','" & txtphone.Text& "','" & txtAge.Text & "','" & cmbFlight.Text &"','" & cmbFrom.Text & "','" & cmbTo.Text &"','" & cmbClass.Text & "','" & txtAmount.Text &

    "','" & dtpFlightDate.Text & "','" &txtTicketIdNo.Text & "')")

    con.Open()Try

    com.Connection = concom.ExecuteNonQuery()

    Catch ex As ExceptionMsgBox(ex.Message)

    EndTrycon.Close()MsgBox("Values Added Successfully",

    MsgBoxStyle.Information)cleardetails()autogencid()

    EndIfEndSub

    PrivateSub txtName_Leave(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles txtName.Leave

    txtName.Text = StrConv(txtName.Text,VbStrConv.ProperCase)

    EndSub

    PrivateSub txtphone_KeyPress(ByVal sender

    As System.Object, ByVal e AsSystem.Windows.Forms.KeyPressEventArgs) Handlestxtphone.KeyPress, txtAmount.KeyPress,txtAge.KeyPress

    If e.KeyChar = ChrW(8) ThenReturn

  • 8/4/2019 Airlines Registration System Black Book

    48/86

    EndIfIfChar.IsNumber(e.KeyChar) = FalseThen

    e.KeyChar = Char.MinValueEndIf

    EndSub

    PrivateSub btnBack_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles btnBack.Click

    Me.Close()EndSub

    Sub autogencid()com.Connection = concom.CommandText = ("SELECT MAX(Id) FROM

    tblCustomerDetails")con.Open()Try

    r = com.ExecuteReaderr.Read()cid = (r(0))

    r.Close()Catch ex As Exception

    MsgBox(ex.Message)EndTrycon.Close()ncid = cid + 1txtID.Text = ncid

    EndSub

    Sub autogenFrom()com.Connection = concom.CommandText = ("SELECT DISTINCT

    [FROM] FROM tblTicketDetails")con.Open()

  • 8/4/2019 Airlines Registration System Black Book

    49/86

    Tryr = com.ExecuteReaderDoWhile r.Read()

    cmbFrom.Items.Add(r(0))

    Loopr.Close()

    Catch ex As ExceptionMsgBox(ex.Message)

    EndTrycon.Close()

    EndSub

    Sub autogenTo()com.Connection = concom.CommandText = ("SELECT DISTINCT [TO]

    FROM tblTicketDetails")con.Open()Try

    r = com.ExecuteReaderDoWhile r.Read()

    cmbTo.Items.Add(r(0))

    Loopr.Close()

    Catch ex As ExceptionMsgBox(ex.Message)

    EndTrycon.Close()

    EndSub

    Sub cleardetails()txtID.Text = ""txtName.Text = ""cmbGender.Text = NothingtxtAddress.Text = ""txtphone.Text = ""

  • 8/4/2019 Airlines Registration System Black Book

    50/86

    txtAge.Text = ""cmbFlight.Text = NothingcmbFrom.Text = NothingcmbTo.Text = Nothing

    cmbClass.Text = NothingtxtAmount.Text = ""dtpFlightDate.Text = Date.NowtxtTicketIdNo.Text = ""txtID.Focus()

    EndSub

    PrivateSub cmbClass_LostFocus(ByVal sender

    AsObject, ByVal e As System.EventArgs) HandlescmbClass.LostFocusIf cmbFlight.Text = ""Then

    MsgBox("Please Enter Valid Selectionfor 'Flight' Option", MsgBoxStyle.Information,"Input Check")

    ElseIf cmbFrom.Text = ""ThenMsgBox("Please Enter Valid Selection

    for 'From' Option", MsgBoxStyle.Information,

    "Input Check")ElseIf cmbTo.Text = ""Then

    MsgBox("Please Enter Valid Selectionfor 'To' Option", MsgBoxStyle.Information,"Input Check")

    ElseIf cmbClass.Text = ""ThenMsgBox("Please Enter Valid Selection

    for 'Class' Option", MsgBoxStyle.Information,

    "Input Check")Else

    com.Connection = concom.CommandText = ("SELECT Amount

    FROM tblTicketDetails WHERE (Flight='" &cmbFlight.Text & "'and [From]='" & cmbFrom.Text

  • 8/4/2019 Airlines Registration System Black Book

    51/86

    & "'and [To]='" & cmbTo.Text & "'and Class='" &cmbClass.Text & "')")

    con.Open()Try

    r = com.ExecuteReaderr.Read()txtAmount.Text = (r(0))r.Close()

    Catch ex As ExceptionMsgBox(ex.Message)

    EndTrycon.Close()

    EndIfEndSubEndClass

  • 8/4/2019 Airlines Registration System Black Book

    52/86

    Customer List

    Imports System.Data.SqlClient

    PublicClass frmCustomerListDim blnActive AsBooleanPrivateSub frmCustomerList_Load(ByVal

    sender As System.Object, ByVal e AsSystem.EventArgs) HandlesMyBase.Load

    'TODO: This line of code loads data intothe 'AirLineDataSet.tblCustomerDetails' table.You can move, or remove it, as needed.

  • 8/4/2019 Airlines Registration System Black Book

    53/86

    Me.TblCustomerDetailsTableAdapter.Fill(Me.AirLineDataSet.tblCustomerDetails)

    EndSub

    PrivateSub btnAddNew_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles btnAddNew.Click

    frmCustomerRegisterDetails.Show()EndSub

    PrivateSub btnPrintReceipt_Click(ByVal

    sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnPrintReceipt.ClickfrmMain.showPR()

    EndSub

    PrivateSub btnRefresh_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles btnRefresh.Click

    If AirLineDataSet.HasChanges Then

    Dim dtc AsAirLineDataSet.tblCustomerDetailsDataTable

    dtc =AirLineDataSet.tblCustomerDetails.GetChanges()

    If dtc IsNotNothingThenTry

    TblCustomerDetailsTableAdapter.Update(dtc)

    Catch ex As ExceptionMsgBox(ex.Message)ExitSub

    EndTryMsgBox(dtc.Rows.Count.ToString &

    " row(s) updated successfully")

  • 8/4/2019 Airlines Registration System Black Book

    54/86

    EndIfEndIf

    Me.TblCustomerDetailsTableAdapter.Fill(Me.AirLin

    eDataSet.tblCustomerDetails)EndSub

    PrivateSub btnDelete_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles btnDelete.Click

    If MsgBox("Are you sure you want toDelete the Record?", MsgBoxStyle.Information,

    "AirLine Ticket Management System") =DialogResult.Yes ThenTry

    dgvCustomerList.Rows.Remove(dgvCustomerList.SelectedRows(0))

    Catch ex As ExceptionMsgBox("Select the Record To

    Delete", MsgBoxStyle.Information, "Input Check")

    EndTryEndIfIf AirLineDataSet.HasChanges Then

    Dim dtc AsAirLineDataSet.tblCustomerDetailsDataTable

    dtc =AirLineDataSet.tblCustomerDetails.GetChanges

    If dtc IsNotNothingThen

    Try

    TblCustomerDetailsTableAdapter.Update(dtc)Catch ex As Exception

    MsgBox(ex.Message)ExitSub

  • 8/4/2019 Airlines Registration System Black Book

    55/86

    EndTryMsgBox(dtc.Rows.Count.ToString &

    " row(s) updated successfully")EndIf

    EndIf

    Me.TblCustomerDetailsTableAdapter.Fill(Me.AirLineDataSet.tblCustomerDetails)

    EndSub

    PrivateSub btnClose_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)

    Handles btnClose.ClickMe.Close()EndSub

    EndClass

  • 8/4/2019 Airlines Registration System Black Book

    56/86

    Create User

    Imports System.Data.SqlClient

    PublicClass frmCreateUserDim adapter AsNew SqlDataAdapterDim connection As SqlConnection

    Dim ds AsNew DataSetDim con AsNew SqlConnection("Data

    Source=localhost\SQLExpress;InitialCatalog=AirLine;Integrated Security=True")

    Dim com AsNew SqlCommandDim r As SqlDataReader

  • 8/4/2019 Airlines Registration System Black Book

    57/86

    Dim u_o_pass, u_n_pass, u_name, u_status AsString

    PrivateSub frmCreateUser_Load(ByVal sender

    As System.Object, ByVal e As System.EventArgs)HandlesMyBase.Load

    'TODO: This line of code loads data intothe 'AirLineDataSet.tbluser' table. You canmove, or remove it, as needed.

    Me.TbluserTableAdapter.Fill(Me.AirLineDataSet.tbluser)

    EndSub

    PrivateSub btnCreateAccount_Click(ByValsender As System.Object, ByVal e AsSystem.EventArgs) Handles btnCreateAccount.Click

    u_n_pass = Trim(txtNewPassword.Text)u_name = Trim(txtUserName.Text)u_status = Trim(cmbUserStatus.Text)

    If txtUserName.Text = ""ThenMsgBox("Please Enter UserName",

    MsgBoxStyle.Information, "Input Check")ElseIf txtNewPassword.Text = ""Then

    MsgBox("Please Enter New Password",MsgBoxStyle.Information, "Input Check")

    ElseIf txtConfirmPassword.Text = ""ThenMsgBox("Please Enter Confirm

    Password", MsgBoxStyle.Information, "InputCheck")

    ElseIf Trim(txtNewPassword.Text) Trim(txtConfirmPassword.Text) Then

    MsgBox("Please Enter New Password",MsgBoxStyle.Information, "Input Check")

  • 8/4/2019 Airlines Registration System Black Book

    58/86

    ElseIf cmbUserStatus.Text = ""ThenMsgBox("Please Enter User Status",

    MsgBoxStyle.Information, "Input Check")Else

    com.Connection = concom.CommandText = ("INSERT INTO

    tbluser VALUES ('" & u_name & "','" & u_n_pass &"','" & u_status & "')")

    con.Open()Try

    com.Connection = concom.ExecuteNonQuery()

    Catch ex As ExceptionMsgBox(ex.Message)EndTrycon.Close()MsgBox("New Account Successfully

    Created.", MessageBoxIcon.Information, "CreateNew Account")

    cleartextbox()EndIf

    frmControlUserForm.TbluserTableAdapter.Fill(Me.AirLineDataSet.tbluser)

    EndSub

    PrivateSub btnSave_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles btnSave.Click

    u_o_pass = Trim(txtUserName.Text)u_n_pass = Trim(txtNewPassword.Text)u_name = Trim(cmbUserName.Text)u_status = Trim(cmbUserStatus.Text)

    If cmbUserName.Text = ""Then

  • 8/4/2019 Airlines Registration System Black Book

    59/86

    MsgBox("Please Enter UserName",MsgBoxStyle.Information, "Input Check")

    ElseIf txtUserName.Text = ""ThenMsgBox("Please Enter Old Password",

    MsgBoxStyle.Information, "Input Check")ElseIf Trim(txtUserName.Text)

    frmLogin.passcheck(u_name) ThenMsgBox("Wrong Old Password",

    MsgBoxStyle.Information, "Input Check")ElseIf txtNewPassword.Text = ""Then

    MsgBox("Please Enter New Password",MsgBoxStyle.Information, "Input Check")

    ElseIf txtConfirmPassword.Text = ""And(txtNewPassword.Text txtConfirmPassword.Text)Then

    MsgBox("Please Enter ConfirmPassword", MsgBoxStyle.Information, "InputCheck")

    ElseIf cmbUserStatus.Text = ""ThenMsgBox("Please Enter User Status",

    MsgBoxStyle.Information, "Input Check")

    Elsecom.CommandText = ("UPDATE

    login_details SET Password='" & u_n_pass &"',Status='" & u_status & "' WHERE UserName='" &u_name & "'")

    con.Open()Try

    com.Connection = con

    com.ExecuteNonQuery()Catch ex As Exception

    MsgBox(ex.Message)EndTrycon.Close()

  • 8/4/2019 Airlines Registration System Black Book

    60/86

    MsgBox("Password UpdatedSuccessfully", MsgBoxStyle.Information, "ChangePassword")

    cleartextbox()

    EndIf

    frmControlUserForm.TbluserTableAdapter.Fill(Me.AirLineDataSet.tbluser)

    EndSub

    PrivateSub btnBack_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)

    Handles btnBack.ClickMe.Close()EndSub

    PrivateSub frmCreateUser_FormClosing(ByValsender As System.Object, ByVal e AsSystem.Windows.Forms.FormClosingEventArgs)HandlesMyBase.FormClosing

    If MsgBox("Are you sure to Exit?",

    MsgBoxStyle.Information + MsgBoxStyle.YesNo,"AirLine Management System") = MsgBoxResult.NoThen

    e.Cancel = TrueEndIf

    EndSub

    Sub cleartextbox()

    cmbUserName.Text = NothingtxtUserName.Text = ""txtNewPassword.Text = ""txtConfirmPassword.Text = ""cmbUserStatus.Text = NothingtxtUserName.Focus()

  • 8/4/2019 Airlines Registration System Black Book

    61/86

    EndSub

    EndClass

  • 8/4/2019 Airlines Registration System Black Book

    62/86

    Control User Form

    Imports System.Data.SqlClient

    PublicClass frmControlUserFormPrivateSub frmControlUserForm_Load(ByVal

    sender As System.Object, ByVal e AsSystem.EventArgs) HandlesMyBase.Load

    'TODO: This line of code loads data intothe 'AirLineDataSet.tbluser' table. You canmove, or remove it, as needed.

    Me.TbluserTableAdapter.Fill(Me.AirLineDataSet.tbluser)

  • 8/4/2019 Airlines Registration System Black Book

    63/86

    EndSub

    PrivateSub btnAddNewAccount_Click(ByValsender As System.Object, ByVal e As

    System.EventArgs) Handles btnAddNewAccount.ClickfrmCreateUser.Text = "Create User

    Account"frmCreateUser.lblDisplay.Text = "Create

    User Account"frmCreateUser.Label5.Visible = FalsefrmCreateUser.txtUserName.Visible = TruefrmCreateUser.txtUserName.PasswordChar =

    "" frmCreateUser.cmbUserName.Visible =False

    frmCreateUser.btnCreateAccount.Visible =True

    frmCreateUser.btnSave.Visible = FalsefrmCreateUser.Show()

    EndSub

    PrivateSub btnChangePassword_Click(ByValsender As System.Object, ByVal e AsSystem.EventArgs) HandlesbtnChangePassword.Click

    frmCreateUser.Text = "Change Password"frmCreateUser.lblDisplay.Text = "Change

    Password"frmCreateUser.Label1.Visible = True

    frmCreateUser.Label5.Visible = TruefrmCreateUser.Label1.Text = "Old

    Password"frmCreateUser.cmbUserName.Visible = TruefrmCreateUser.btnSave.Visible = True

  • 8/4/2019 Airlines Registration System Black Book

    64/86

    frmCreateUser.btnCreateAccount.Visible =False

    frmCreateUser.Show()EndSub

    PrivateSub btnClose_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles btnClose.Click

    Me.Close()EndSub

    PrivateSub

    frmControlUserForm_FormClosing(ByVal sender AsSystem.Object, ByVal e AsSystem.Windows.Forms.FormClosingEventArgs)HandlesMyBase.FormClosing

    If MsgBox("Do you want to Exit",MsgBoxStyle.Information, "AirLine TicketManagement System") = DialogResult.Yes Then

    Me.Close()EndIf

    EndSub

    PrivateSub btnDeleteAccount_Click(ByValsender As System.Object, ByVal e AsSystem.EventArgs) Handles btnDeleteAccount.Click

    TryIf MsgBox("Are you sure to Exit?",

    MsgBoxStyle.Information + MsgBoxStyle.YesNo,"AirLine Management System") = MsgBoxResult.NoThen

    dgvAccountdetails.Rows.Remove(dgvAccountdetails.SelectedRows(0))

  • 8/4/2019 Airlines Registration System Black Book

    65/86

    EndIfCatch ex As Exception

    MsgBox("Select the Record ToDelete", MsgBoxStyle.Information, "Input Check")

    EndTry

    If AirLineDataSet.HasChanges ThenDim dtc As

    AirLineDataSet.tbluserDataTabledtc =

    AirLineDataSet.tbluser.GetChangesIf dtc IsNotNothingThen

    Try

    TbluserTableAdapter.Update(dtc)Catch ex As Exception

    MsgBox(ex.Message)ExitSub

    EndTryMsgBox(dtc.Rows.Count.ToString &

    " row(s) updated successfully")

    EndIfEndIf

    Me.TbluserTableAdapter.Fill(Me.AirLineDataSet.tbluser)

    EndSubEndClass

  • 8/4/2019 Airlines Registration System Black Book

    66/86

    Add Ticket Details

    Imports System.Data.SqlClientPublicClass frmAddTicketDetails

    Dim adapter AsNew SqlDataAdapterDim connection As SqlConnection

    Dim ds AsNew DataSetDim con AsNew SqlConnection("Data

    Source=localhost\SQLExpress;InitialCatalog=AirLine;Integrated Security=True")

    Dim com AsNew SqlCommandDim r As SqlDataReader

  • 8/4/2019 Airlines Registration System Black Book

    67/86

    Dim id, nid, dflight, dfrom, dto, dclass AsString

    PrivateSub frmAddTicketDetails_Load(ByVal

    sender As System.Object, ByVal e AsSystem.EventArgs) HandlesMyBase.Load

    autogentid()EndSubPrivateSub btnSave_Click(ByVal sender As

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

    If txtFlight.Text = ""Then

    MsgBox("Please Enter Flight Name",MsgBoxStyle.Information, "Input Check")ElseIf txtFrom.Text = ""Then

    MsgBox("Please Enter From Option ",MsgBoxStyle.Information, "Input Check")

    ElseIf txtTo.Text = ""ThenMsgBox("Please Enter To Option",

    MsgBoxStyle.Information, "Input Check")ElseIf txtClass.Text = ""Then

    MsgBox("Please Enter Class Option",MsgBoxStyle.Information, "Input Check")

    ElseIf txtAmount.Text = ""OrIsNumeric(txtAmount.Text) = FalseThen

    MsgBox("Please Enter Amount" &vbCrLf & "Data entered should be numeric",MsgBoxStyle.Information, "Input Check")

    ElseIf (retrivdata() = 0) = TrueThen

    cleartextbox()Else

    com.Connection = concom.CommandText = ("INSERT INTO

    tblTicketDetails VALUES ('" & txtId.Text & "','"& txtFlight.Text & "','" & txtFrom.Text & "','"

  • 8/4/2019 Airlines Registration System Black Book

    68/86

    & txtTo.Text & "','" & txtClass.Text & "','" &txtAmount.Text & "')")

    con.Open()Try

    com.ExecuteNonQuery()Catch ex As Exception

    MsgBox(ex.Message)EndTrycon.Close()MsgBox("Details Successfully

    Added.", MessageBoxIcon.Information, "Create NewAccount")

    cleartextbox()autogentid()EndIf

    EndSub

    PrivateSub btnClose_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles btnClose.Click

    Me.Close()EndSub

    Sub cleartextbox()txtFlight.Text = ""txtFrom.Text = ""txtTo.Text = ""txtClass.Text = ""

    txtAmount.Text = ""txtFlight.Focus()

    EndSub

    Sub autogentid()com.Connection = con

  • 8/4/2019 Airlines Registration System Black Book

    69/86

    com.CommandText = ("SELECT MAX(Id) FROMtblTicketDetails")

    con.Open()Try

    r = com.ExecuteReaderr.Read()id = (r(0))r.Close()

    Catch ex As ExceptionMsgBox(ex.Message)

    EndTrycon.Close()

    nid = id + 1txtId.Text = nidEndSub

    Function retrivdata() AsStringDim value AsString = 1com.Connection = concom.CommandText = ("SELECT

    (Flight,From,To,Class) FROM tblTicketDetails")

    con.Open()Try

    r = com.ExecuteReaderDoWhile r.Read()

    dflight = (r(1))dfrom = (r(2))dto = (r(3))dclass = (r(4))

    If txtFlight.Text = dflight AndtxtFrom.Text = dfrom And txtTo.Text = dto AndtxtClass.Text = dclass Then

    MsgBox("Data Alreadyexists", MessageBoxIcon.Information,"InputCheck")

  • 8/4/2019 Airlines Registration System Black Book

    70/86

    value = "0"EndIf

    Loopr.Close()

    Catch ex As ExceptionMsgBox(ex.Message)

    EndTrycon.Close()Return value

    EndFunctionEndClass

  • 8/4/2019 Airlines Registration System Black Book

    71/86

    Add Flight Schedule

    Imports System.Data.SqlClientPublicClass frmAddFlightSchedule

    Dim adapter AsNew SqlDataAdapterDim connection As SqlConnectionDim con AsNew SqlConnection("Data

    Source=localhost\SQLExpress;InitialCatalog=AirLine;Integrated Security=True")

    Dim com AsNew SqlCommandDim r As SqlDataReaderDim data, tbl, row, time AsString

  • 8/4/2019 Airlines Registration System Black Book

    72/86

    PrivateSub frmAddFlightSchedule_Load(ByValsender As System.Object, ByVal e AsSystem.EventArgs) HandlesMyBase.Load

    autogenFrom()

    autogenTo()EndSub

    PrivateSub btnschedule_save_Click(ByValsender As System.Object, ByVal e AsSystem.EventArgs) Handles btnSave.Click

    data = (cmbFrom.Text & " To " &cmbTo.Text)

    tbl = Trim(cmbFlight.Text)row = Trim(cmbDay.Text)time = Trim(cmbTime.Text)If cmbFlight.Text = ""Then

    MsgBox("Please Enter Valid Selectionfor 'Flight' Option", MsgBoxStyle.Information,"Input Check")

    ElseIf cmbFrom.Text = ""ThenMsgBox("Please Enter Valid Selection

    for 'From' Option", MsgBoxStyle.Information,"Input Check")

    ElseIf cmbTo.Text = ""ThenMsgBox("Please Enter Valid Selection

    for 'To' Option", MsgBoxStyle.Information,"Input Check")

    ElseIf cmbTime.Text = ""ThenMsgBox("Please Enter Valid Selection

    for 'Time' Option", MsgBoxStyle.Information,"Input Check")

    Elsecom.Connection = con

  • 8/4/2019 Airlines Registration System Black Book

    73/86

    com.CommandText = ("UPDATE '" & tbl& "' SET '" & row & "'='" & data & "' WHERETime='" & time & "'")

    con.Open()

    Trycom.Connection = concom.ExecuteNonQuery()

    Catch ex As ExceptionMsgBox(ex.Message)

    EndTrycon.Close()MsgBox("Values Updated

    Successfully", MsgBoxStyle.Information)cleer()EndIf

    EndSub

    Sub autogenFrom()com.Connection = concom.CommandText = ("SELECT DISTINCT

    [FROM] FROM tblTicketDetails")

    con.Open()Try

    r = com.ExecuteReaderDoWhile r.Read()

    cmbFrom.Items.Add(r(0))Loopr.Close()

    Catch ex As Exception

    MsgBox(ex.Message)EndTrycon.Close()

    EndSub

    Sub autogenTo()

  • 8/4/2019 Airlines Registration System Black Book

    74/86

    com.Connection = concom.CommandText = ("SELECT DISTINCT [TO]

    FROM tblTicketDetails")con.Open()

    Tryr = com.ExecuteReaderDoWhile r.Read()

    cmbTo.Items.Add(r(0))Loopr.Close()

    Catch ex As ExceptionMsgBox(ex.Message)

    EndTrycon.Close()EndSub

    Sub cleer()cmbFlight.Text = NothingcmbFrom.Text = NothingcmbTo.Text = NothingcmbTime.Text = Nothing

    cmbFlight.Focus()EndSub

    EndClass

  • 8/4/2019 Airlines Registration System Black Book

    75/86

    Print Receipt

    Imports System.Data.SqlClientPublicClass frmPrintReceipt

    Dim con AsNew SqlConnection("DataSource=localhost\SQLExpress;InitialCatalog=Airline;Integrated Security=True")

    Dim com AsNew SqlCommandDim r As SqlDataReader

    PrivateSub frmPrintReceipt_Load(ByValsender As System.Object, ByVal e AsSystem.EventArgs) HandlesMyBase.Load

  • 8/4/2019 Airlines Registration System Black Book

    76/86

    'TODO: This line of code loads data intothe 'AirLineDataSet.tblCustomerDetails' table.You can move, or remove it, as needed.

    Me.TblCustomerDetailsTableAdapter.Fill(Me.AirLineDataSet.tblCustomerDetails)

    EndSub

    PrivateSub btnPRList_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles btnPRList.Click

    Dim PrintReceiptrpt AsNew PrintReceiptDim ds AsNew DataSetDim sql AsStringDim num AsInteger

    num = Val(cboPRLNo2.Text)

    If cboPRLNo2.Text = ""OrIsNumeric(cboPRLNo2.Text) = FalseThen

    MsgBox("Please select a propervalue", MsgBoxStyle.Critical, "Input Check")

    Elsecon.Open()Try

    sql = "SELECT * FROMtblCustomerDetails where ID='" & num & "' "

    Dim dscmd AsNew

    SqlDataAdapter(sql, con)dscmd.Fill(ds,

    "tblCustomerDetails")Catch ex As ExceptionEndTrycon.Close()

  • 8/4/2019 Airlines Registration System Black Book

    77/86

    PrintReceiptrpt.SetDataSource(ds.Tables(0))crvPrintReceipt.ReportSource =

    PrintReceiptrptcrvPrintReceipt.Refresh()

    EndIfEndSub

    EndClass

  • 8/4/2019 Airlines Registration System Black Book

    78/86

    DATABASE DESIGN

  • 8/4/2019 Airlines Registration System Black Book

    79/86

    DATABASE DESIGN

    For this project we used SQL Database ,We created four tables for four types..1)Customer Details2)Flight Schedule3)Ticker Details4)User

    Here are snapshots of tables,,

    1)Customer Details

  • 8/4/2019 Airlines Registration System Black Book

    80/86

    2)Flight Schedule

    3)Ticker Details

  • 8/4/2019 Airlines Registration System Black Book

    81/86

    4)User

  • 8/4/2019 Airlines Registration System Black Book

    82/86

    Testing

  • 8/4/2019 Airlines Registration System Black Book

    83/86

    Testing

    Testing involves different conditions that software could face,,

    So to handle those conditions ,,we need to make certail validation

    processes..

    Starting from login form,,

    If user entered wrong Username or Password,,so there will be an error

    message..

  • 8/4/2019 Airlines Registration System Black Book

    84/86

    In customer registration form customer feeds some personal details if

    he filled some fields wrong then there should be a system who will tell

    user that wat is going wrong!

    in that validations play main roll..

  • 8/4/2019 Airlines Registration System Black Book

    85/86

    In Ticket Details also we must use conditions,,

  • 8/4/2019 Airlines Registration System Black Book

    86/86

    Bibliography-

    Internet

    Books