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

RAILWAY RESERVATION SYSTEM

Abstraction:

This Railway Reservation Form consists of the following modules


• Login form
• Main Menu
• Reservation
• Cancellation
• Train Details

Login form provides security to this application program. It encloses


username and password. Main Menu form will list all operations going to perform in
this application. From Main Menu we can select Reservation Form. If any new
reservation is made, then it will be updated in the database. In this form, all the
passenger details are updated.

This module encloses several buttons. In that three buttons are mostly used.
They are adding new button, Update button and cancel button. Cancellation module
will be used to cancel the passenger details which are already reserved. In this
form, all the passenger details are cancelled, by entering the ticket number of the
passenger detail which is to be deleted Train Details module is used to display the
details of all the trains which is already updated in the database and cost details are
also displayed for the corresponding train. The train details can be added newly in
the database..
TABELS DESCRIPTION:
S.No Field Name Data Type Field Description
1. User Name Text This field contains user name for the login

2. Password Text This field contains password for the login

3. Name Text This field contains passenger name.

4. Age Number This field contains passenger age.

5. Gender Text This field contains passenger gender (either


male or female).
6. Nationality Text It contains nationality for the passenger.

7. From-To Text This field contains places from where to


where the passenger should travel.
8. Train Name Text It contains train name for the passenger.
9. Train number Text It contains train number for passenger.

10. Coach Text It contains coach (whether A/C, Normal, VIP,


etc.,) for passenger.
11. Cost Number It contains cost for the particular coach.

12. Ticket Number Number It contains ticket number for passenger.


13. Reserving Date Date/Time It contains when the tickets are received.
14. Reserved Date Date/Time It contains the Date which we Reserved for
traveling
15. Total Cost Number It contains the total amount of the passenger.
16. From-To Text This field contains places from where to
where the train should travel.
17. Departure Date Date/Time This field contains departure date for the
trains.
18. Arrival Date Date/Time This field contains arrival date for the trains.
19. Departure Time Date/Time This field contains departure time for the
trains.
20. Arrival Time Date/Time This field contains arrival Time for the trains.
21. Normal Number It contains cost for normal coach.
22. VIP Number It contains cost for VIP coach.
23. A/C Coach Number It contains cost for A/C coach.
24. Handicap Number It contains cost for Handicap coach.
25. Senior Citizen Number It contains cost for senior citizen coach.

Requirements specification:
a) HARDWARE SPECIFICATION:

Mother Board : INTEL 945G CNL


Processor : PENTIUM IV
RAM Capacity : 512 Mb
Clock Speed : 3 GHz
Port : USB
Printer : TVS Matrix

b) SOFTWARE SPECIFICATION:

Operating System : Windows XP


Front End : Microsoft Visual Basic
Back End : Microsoft Access

FUNCTIONAL POINT ANALYSIS


MAIN MENU FORM:-

Main Menu form will list all operations going to perform in this application.
This form contains link to three forms namely
 Reservation
 Cancellation
 Train Details
When the user wants to enter into Reservation Form, just a click is made on
the reservation. Cancellation will be selected, when the user wants to enter into the
Cancellation Form. When the user wants to enter into Train Details Form, just a
click is made on the train details.

RESERVATION FORM :-

Reservation module will enclose the Railway Reservation Form. In this form,
all the passenger details are updated. This form displays all the passenger details.
New ticket reservation can be updated by getting the details from the passenger.
The passenger details can be updated in the separate database. If any new
reservation is made, then it will be updated in the database.

This module encloses several buttons. In that three buttons are mostly used.
They are adding new button, Update button and cancel button. Add new button is
used to add passenger details. Update button is used to update the added
passenger details. Cancel button is used to cancel the added passenger details.

CANCELLATION FORM :-

Cancellation module will be used to cancel the passenger details which are
already reserved. In this form, all the passenger details are cancelled, by entering
the ticket number of the passenger detail which is to be deleted.
When the ticket number is entered, the corresponding passenger details to
that ticket number are displayed, and then the cancel button is clicked to delete the
passenger details which are already updated in the database. The passenger detail
which is deleted in this form, will also deleted in the database.

TRAIN DETAILS FORM:-


Train Details module is used to display the details of all the trains which is
already updated in the database and cost details are also displayed for the
corresponding train. The train details can be added newly in the database.

This module encloses several buttons same as the reservation form. They
are adding new button, update button and cancel button. Add new button is used to
add the train detail. Update button is used to update the added train detail. Cancel
button is used to cancel the added train detail.

PROCESS DIAGRAM:

Login Form Main Menu

Reservation
Cancel
Railway
Reservation

Train Report
Details

USE CASE DIAGRAM:


Reservation

Cancel

Train Details

Report

SOFTWARE TESTING TECHNIQUES

White box testing:

White box testing examines the basic program structure and it derives the test data
from the program logic; ensuring that all statements and conditions have been executed at
least once.
All the statements have been executed. The software designs in valid.

Black box testing:

Black box testing methods focus on the functional requirements of the software.
This type of testing methods attempts to fine incorrect or missing functions, error in data
structure or external database access, interface error, performance errors, initialization and
termination error.

By the black box testing the inventory system is examined with various
combinations of inputs, we get the expected result.

IMPLEMENTING
Login Form :

To open Main Form:

Private Sub ok_Click()


If Text1.Text = "dept" And Text2.Text = "dept" Then
Main_Menu.Show
Else
MsgBox "Invalid so try again !!!!"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End If
End Sub

To close Login Form:

Private Sub exit_Click()


End
End Sub

Main Form :

To Open Reservation form :

Private Sub Label2_Click()


Reserve_frm.Show
End Sub

To open Cancelling Form :

Private Sub Label3_Click()


cancelfrm.Show
End Sub

To open Train Details Form :

Private Sub Label4_Click()


train_details.Show
End Sub
To open Login Form :
Private Sub Label5_Click()
loginfrm.Show
End Sub

RESERVATION FORM:

Declaration :

Dim wsk As Workspace, db As Database, rs As Recordset, rr As Recordset, rs1 As


Recordset

To Add_New :

Private Sub add_Click()


Data1.Recordset.AddNew
Call cler
End Sub

To Clear the data :

Private Sub clr_Click()


Call cler
End Sub

To show Report Form:

Private Sub cmdrpt_Click()


DataReport1.Show
End Sub

To End the Form :

Private Sub exit_Click()


End
End Sub

Declaration in Form :
Private Sub Form_Load()
Text1.Text = Date
Set wsk = Workspaces(0)
Set db = wsk.OpenDatabase("C:\Program Files\Microsoft Visual
Studio\VB98\railway\RAILWAYTICKETS.MDB")
Set rs = db.OpenRecordset("reservedetails")
Set rr = db.OpenRecordset("traindetails")
Option1.Value = False
Option2.Value = False
End Sub

To make Modify :

Private Sub modify_Click()


rs.Edit
End Sub

To show Next Record:

Private Sub nextpage_Click()


Mainfrm.Show
End Sub

To Show the Gender Value :

Private Sub Option1_Click()


If Option1.Value = True Then
Text4.Text = "Male"
End If
End Sub

Private Sub Option2_Click()


If Option2.Value = True Then
Text4.Text = "Female"
End If
End Sub

To Make Save :

Private Sub save_Click()


rs(0) = Text2.Text
rs(1) = Text3.Text
rs(2) = Text4.Text
rs(3) = Combo1.Text
rs(4) = Text5.Text
rs(5) = Combo2.Text
rs(6) = Text6.Text
rs(7) = Text7.Text
rs(8) = Combo3.Text
rs(9) = Text8.Text
rs(10) = Text9.Text
rs(11) = Text10.Text
rs(12) = Text11.Text
rs(13) = Text12.Text
rs.Update
MsgBox "one Record is updated!!!!"
End Sub

To Make Search of the Data :

Private Sub search_Click()


rs.MoveFirst
Do While Not rs.EOF
If Text2.Text = rs(0) Then
Text3.Text = rs(1)
Text4.Text = rs(2)
Combo1.Text = rs(3)
Text5.Text = rs(4)
Combo2.Text = rs(5)
Text6.Text = rs(6)
Text7.Text = rs(7)
Combo3.Text = rs(8)
Text8.Text = rs(9)
Text9.Text = rs(10)
Text10.Text = rs(11)
Text11.Text = rs(12)
Text12.Text = rs(13)
End If
rs.MoveNext
Loop
End Sub

To Diplay the Train Name :


Private Sub Text6_LostFocus()
rr.MoveFirst
Do While Not rr.EOF
If Val(Text6.Text) = rr(0) Then
Text7.Text = rr(1)
End If
rr.MoveNext
Loop
End Sub

To check the Range of the Passengers :

Private Sub Text8_GotFocus()


rr.MoveFirst
Do While Not rr.EOF
If Text6.Text = rr(0) Then
If Combo3.Text = "Normal" Then
Text8.Text = rr(6)
ElseIf Combo3.Text = "VIP" Then
Text8.Text = rr(7)
ElseIf Combo3.Text = "Handicap" Then
Text8.Text = rr(8)
ElseIf Combo3.Text = "A/C" Then
Text8.Text = rr(9)
ElseIf Combo3.Text = "Senior Citizen" Then
Text8.Text = rr(10)
End If
End If
rr.MoveNext
Loop
End Sub

To Multiply two text :

Private Sub Text9_LostFocus()


Text10.Text = Val(Text8.Text) * Val(Text9.Text)
End Sub

To Clear all the Text :


Public Sub cler()
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Combo1.Text = ""
Text5.Text = ""
Combo2.Text = ""
Text6.Text = ""
Text7.Text = ""
Combo3.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text2.SetFocus

End Sub

CANCELLATION FORM:

Declaration:

Dim wsk As Workspace, db As Database, rs As Recordset

To Cancel the Tickets :

Private Sub cancell_Click()


rs.MoveFirst
Do While Not rs.EOF
If Text1.Text = rs(12) Then
rs.Delete
MsgBox "Deleted!!!!!"
MsgBox "Thank you"
End If
rs.MoveNext
Loop
End Sub

To show the Main Form :


Private Sub Command2_Click()
Mainfrm.Show
End Sub

To show Details of the Passenger who Reserved Tickets :

Private Sub Details_Click()


rs.MoveFirst
Do While Not rs.EOF
If Text1.Text = rs(12) Then
Text2.Text = rs(0)
Text3.Text = rs(1)
Text4.Text = rs(2)
Text5.Text = rs(3)
Text6.Text = rs(4)
Text7.Text = rs(5)
Text8.Text = rs(6)
Text9.Text = rs(7)
Text10.Text = rs(8)
Text11.Text = rs(10)
Text12.Text = rs(11)
Text13.Text = rs(13)
End If
rs.MoveNext
Loop
End Sub

To Declare in the Form :

Private Sub Form_Load()


Set wsk = Workspaces(0)
Set db = wsk.OpenDatabase("C:\Program Files\Microsoft Visual
Studio\VB98\railway\RAILWAYTICKETS.MDB")
Set rs = db.OpenRecordset("reservdetails")
End Sub

TRAIN DETAILS:
Declaration :
Dim wsk As Workspace, db As Database, rr As Recordset

To Add a another Detail of Train :

Private Sub add_Click()


Data1.Recordset.AddNew
Call clerr
End Sub

To Clear all the Text :

Private Sub clr_Click()


Call clerr
End Sub

To Show Report Form :

Private Sub Command1_Click()


DataReport2.Show
End Sub

To Delete the Detail of the Train :

Private Sub del_Click()


rr.Delete
Call clerr
End Sub

To show Main Form :

Private Sub first_Page_Click()


Mainfrm.Show
End Sub

Declaration of the Form:


Private Sub Form_Load()
Set wsk = Workspaces(0)
Set db = wsk.OpenDatabase("C:\Program Files\Microsoft Visual
Studio\VB98\railway\RAILWAYTICKETS.MDB")
Set rr = db.OpenRecordset("traindetails")
End Sub

To Modify the Data :

Private Sub mod_Click()


rr.Edit
End Sub

To Save the Record after making Changes :

Private Sub save_Click()


rr(0) = Text1.Text
rr(1) = Text2.Text
rr(2) = Text3.Text
rr(3) = Text4.Text
rr(4) = Text5.Text
rr(5) = Text6.Text
rr(6) = Text7.Text
rr(7) = Text8.Text
rr(8) = Text9.Text
rr(9) = Text10.Text
rr(10) = Text11.Text
rr.Update
MsgBox "Record is Updated!!!"
End Sub

To Search the Record :

Private Sub search_Click()


rr.MoveFirst
Do While Not rr.EOF
If Text1.Text = rr(0) Then
Text2.Text = rr(1)
Text3.Text = rr(2)
Text4.Text = rr(3)
Text5.Text = rr(4)
Text6.Text = rr(5)
Text7.Text = rr(6)
Text8.Text = rr(7)
Text9.Text = rr(8)
Text10.Text = rr(9)
Text11.Text = rr(10)
End If
rr.MoveNext
Loop
End Sub

To call the Clear Function Whenever it needed :

Public Sub clerr()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text1.SetFocus
End Sub
SCREEN SHOTS:

LOGIN FORM :

MAIN FORM:

RESERVATION FORM:
CANCELLATION FORM:

TRAIN DETAILS:
Conclusion:

Thus the above application for Railway Reservation System was


successfully implemented and executed

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