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

Introduction

Horizon Airways is a major domestic airway which based in New York, Chicago, New Orleans,
Miami, and Pittsburgh routes. It stated Airline operation on January 1996 with an Airbus 330
aircraft operating between New York and Chicago. Day by day it has since growth with a
substantial increase in customer base over the past five year.

At present, it has two Boeing 747 -400 and two Airbus 330 aircrafts and operates round trip as
well as one-way flights. It offers 10 flights per week in 5 cities in different states. It operates two
times a week. The details about the flight, such as the flight number, the operating sector, the
days of week on which flight operates, the type of aircrafts the local departure time, the local
arrival time, and fares. It has number of reservation offices in each city where the flights operate.
Each reservation office has a number of reservation counters to handle reservations and
cancellations. Each counter has a counter assistant who is responsible for making reservation or
cancellations.

Horizon Airways needs to be developing online inquiries about the flights and waiting list status
in a new system. It should be the advantage of latest technology and also accomplish the
functions are to allow the counter assistants to handle ticketing and refunds, to perform all
necessary validation for accepting reservation data, for the cancellation the system should accept
the PNR number from the user validate the PNR number and update the cancellation flag for the
passenger and the system should generate conform passenger list report, waiting list and daily
collection report.

According to this I have been developed the software system for Horizon Airways. Base on this I
created UML diagram, ER diagram and details about visual objects the using the application in
the .NET environment.

1
Visual objects for the application

1.1 Visual objects

2
Visual Objects is an object-oriented programming language that is used to create software
programs that activate primarily under Windows. Even though it can be used as a general-
purpose programming tool, it is almost exclusively used to make database programs. Visual
object is allows you too speedily and easily make sophisticated applications that run under
Microsoft Windows and Windows NT. Its power and flexibility recommend new opportunities
and tools to application developers of all levels and backgrounds.
Visual Objects recommend a just-in-time debugging feature. If an exception or a runtime error
occurs while running an application (that has the debug option turned on in the application
properties) from within the integrated development environment, the debugger will be invoked in
order to look at the error. Label, textbox, button, combo box, date time picker, layout, grid view,
menu strip are example of the visual objects.

1.2 Visual objects used for the application

In this application I used many visual objects. They are given below:

• Label
Labels are those controls that are used to show text in other parts of the application. They are
based on the Common Control class. Notable property of the label control is the text property
which is used to set the text for the label.

Label

• Text box

Windows users should be well-known with textboxes. This manages looks like a box and accepts
input from the user. The Textbox is based on the Textbox Base class which is based on the
3
Common Control class. Textboxes are used to accept input from the user or used to show text.
By default we can enter up to 2048 characters in a Textbox but if the Multiline property is set to
True we can enter up to 32KB of text. The image below displays a Textbox.

Textbox

• Combo box

ComboBox is a arrangement of a TextBox and a ListBox. The ComboBox shows an editing field
(TextBox) combined with a ListBox allowing us to choose from the list or to enter new text.
ComboBox displays data in a drop-down style format. The ComboBox class is derived from the
ListBox class. Below is the Image of a ComboBox.

Combo
box

• Buttons

One of the most popular controls in Visual Basic is the Button Control. They are the controls
which we click and release to achieve some action. Buttons are used mostly for handling events
in code, say, for sending data entered in the form to the database. The default event of the Button
is the Click event and the Button class is based on the Button Base class which is based on the
Common Control class.
Button

• Date Time Picker

DateTimePicker manage offers a suitable way for users to create a date/time selection. The
control allows you to choose dates and times and to skip the date format validity of the data since

4
the control lets you limit the input. DateTimePicker is similar to the Month View control, which
allows you to choose either a date or a range of dates but doesn't support time selection.

Date Time Picker

• Menu Strip

The MenuStrip manage offers you the familiar Windows application menu choices. The
MenuStrip manage also provides full programmatic control so you can respond to events, enable
or disable the strip, and more.

Menu Strip

• Data Grid View

We want to use the DataGridView manage in the VB.NET language targeting Windows Forms
to display and offer an interface to our data. The DataGridView control is an excellent way to
display and permit editing for our data, which can then be persisted in the database again.

5
Using interacting objects to design the forms

Using interacting objects to design the form


As I mentioned in task1 about many interacting objects like combo boxes, button, labels,
textbox, date-time picker and many other objects have been used in the system been
implemented to Horizon Airways. I used interacting objects to create the form. There are some
examples below.
6
Label

Text box

Button

This is the Login page. In this form I used the label, textbox, button interacting objects. If you
put the correct username and password you can move the next menu.

Menu strip
This is the main menu form of the Horizon Airways. In this I used the menu strip. Menu strip is
the one of the interacting object.

DateTimePicker

7
Combo box
This is the reservation form. In this form I used the DateTimePicker, labels, text boxes, buttons
and combo box. As similar to the above screen shots the other options are available in the
system.

8
Properties of the each and every control used on the
form

Properties of the each and every control used on the form

Properties are typically known as 'smart fields' in VB.NET community. We know that data
encapsulation and hiding are the two fundamental characteristics of any object oriented
programming language. Every object that you have in your program will have properties. You
can modify the properties of any object on the properties box. The Properties Window Panel,
positioned at the right side of the IDE, is used primarily for design-time changes to the form. The
changes made during design-time are always visible on the current form selected on the VS IDE.
It is also seen during runtime unless you have entered commands to change a particular control
on the Form Code.
9
Form properties
Below are the properties of a Windows form. Properties displayed below are categorized as seen
in the properties window.

Properties Description
BackColor Sets the background color for the form
BackgroundImage Sets the background image in the form
Cursor Sets the cursor to be displayed when the user
moves the mouse over the form
Font Sets the font for the form
ForeColor Sets the foreground color of the form
Enabled Sets a value indicating if the form is enabled
Name Sets name for the form
MaximumSize The maximum size the form can be resized to
MinimumSize The minimum size the form can be resized to
Size Sets size of the form in pixels
StartPosition Sets the starting position of the form at run
time
Text Sets the text associated with this form
ImeMode Sets the state of an Input Method Editor
Menu Sets the MainMenu that is displayed in the
form
AutoScale Indicates if the form adjusts its size to fit the
height of the font used on the form and scales
its controls.

This is the screen shot of the


form properties.

10
Below are the properties of a textbox, label and button. Textbox, label, button properties are
mostly same.

Properties Description
Text Sets the text associated with this
textbox/label/button
Name Sets name for the textbox/label/button
Font Sets the font for the text/button/label
ForeColor Sets the foreground color of the
button/label/textbox
location Set the location of the textbox/label/button

Border style Set the border of the textbox/label/button

MaximumSize The maximum size the label/textbox/button can


be resized to
MinimumSize The minimum size the label/textbox/button can
be resized to
Tag Sets an object that contains data about a control

Locked Sets whether the label/textbox/button is locked

Dock Determines the size of the border for docked


controls

This is the screen shot of the


textbox/label/button properties

11
Below are the properties of a datetimepicker

Properties description

Value Date expression that is the default property of


the control. Set a default date, if desired

MinDate Date expression setting lower boundary of the


calendar.
MaxDate Date expression setting upper boundary of the
calendar

Format Long Date, Short Date, Time or Custom.

Mouse Pointer The type of mouse pointer displayed when over


the DateTimePicker. Choose from 16 different
types plus a custom pointer
OLEDropMode Set to None (default) if the DateTimePicker
does not accept OLE drops and is to display the
No Drop cursor if an OLE drop is attempted.
Set to Manual, the DateTimePicker will trigger
OLE drop events, allowing programs to handle
the OLE drop operation in code.
Custom Format String setting forth custom format when
Format is set to custom.
Enabled True or False. True means the object can
12
respond to user-generated events, false
prevents it from responding.

CheckBox False (Default) - Control always returns a date.


True - A checkbox appears. If the user does not
check this box, no date is returned. Handy for
forms where requiring a date ("Due date?") is
an option

This is the screen shot of the datetimepicker properties

In this application I used the properties for another combo box, menu strip also. That properties
also little bit same like this properties.

13
Employ the different modeling technologies

14
Employ the different modeling technologies
Horizon Airways needs to be developing online inquiries about the flights and waiting list status
in a new system. It should be the advantage of latest technology and also accomplish the
functions are to allow the counter assistants to handle ticketing and refunds, to perform all
necessary validation for accepting reservation data, for the cancellation the system should accept
the PNR number from the user validate the PNR number and update the cancellation flag for the
passenger and the system should generate conform passenger list report, waiting list and daily
collection report. First I analysis this airways reservation application system in the UML and ER
diagram.

4.1 UML diagram


UML stands for Unified Modeling Language. UML is a collection of a range of diagrams for
differing purposes. Each type of diagram models a particular part of object oriented design in an
easy to understand, visual manner. The UML standard specifies accurately how the diagrams are
to be drawn and what each component in the diagram means. UML is not dependent on any
particular programming language; instead it focuses on the fundamental concepts and ideas that
model a system. Using UML enables anyone familiar with its specifications to instantly read
and understand diagrams drawn by other people.

UML diagram of the airways reservation application

15
UML diagram for ticketing system

Login/Logout
-End2
*

Give ticket

-End4 checking seat


availability
*

-End1
* confirm passeger
-End3 -End6
list
-End5
* *

*-End7 -End8
Seat reservation *
-End9 -End11
* *
-End13
*
Top Package::counter assistant -End10 Top Package::IT administrator
-End17 *
* cancelling the
-End15 tickets
*
*

-End14
daily collection
* report

*
-End12
system maintain

-End16
*
Add schedule

-End18
*
System
start/shutdown

16
4.2 Entity-Relationship Diagram
It is essential to have one of these if you want to create a good database design. The patterns help
focus on how the database actually works with all of the interactions and data flows, although
another useful tool is a Data Flow Diagram (DFD) which more directly describes this.

Employee work Department

Empno
Entity

Relationship

Attribut
e

Entity
Person, place or concept in the uses environment can be called as an entity. The entity
represented by a rectangle.
Attribute
An Attribute is a property of an entity. Attribute is represented by an ellipse.
Relationship
The relationships between entities are represented by Diamonds.
Primary key
Primary key is a candidate key that has been selected as the identifier or an entity type.
Foreign key
Foreign key is a means of interconnecting data storing series of table.

17
ER diagram of the airways reservation application.

Sector Passenge
1 rs
ne
1
ed
M
Operat
es
1
1
M inc
ScheduledFligh lud
1
1
1 Ha ts es
1 s
Flights

M
M

1
1
inclu
des
DailyCollectio
ns

1
1

Aircraft

Entity Attribute Primary key Foreign key

Sector SectorID, Description, SectorID NO


Weekday1, Weekday2,
FirstClassFare,

18
BusinessClassFare,
EconomyClassFare

Flights FlightNo, Dep Time, FlightNo SectorID,


Arr Time, AircraftTypeID
AircraftTypeID,
SectorID

Aircraft AircraftTypeID, AircraftTypeID No


description,
FirstClassSeats,
BusinessClassSeats,
EconomyClassSeats

ScheduledFlights FlightNo, FlightDate, FlightNo, NO


FirstClassSeatsAvailabl FlightDate,
e,
BusinessClassSeatsAv
ailable,
EconomyClassSeatAva
ilable

Passengers PNRNo, FlightsNo, PNRNo FlightsNo


TravelDate, FName,
LName, Age, Gender,
Class, SeatPref,
MealPref, SSR, Status

DailyCollections PNRNo, TransDate, PNRNo PNRNo


TranType, Amounts

19
Programming coding of the system

Programming coding of the system

20
The new application will be build with all the features which is mentioned in the scenario
using .NET environment. Some example coding is given below.
Try
Dim con As New SqlConnection()
con.Open()

Dim cmd As New SqlCommand("Select * from User where


username=@username and password=@password") 'Create sql using querys

cmd.Parameters.AddWithValue("@password", txtpassword.Text)
cmd.Parameters.AddWithValue("@username", txtusername.Text)
cmd.Connection = con
cmd.CommandType = CommandType.Text
Dim da As New SqlDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds, "Password")

Dim password As String ' Creating variables


Dim username As String

username = ds.Tables(0).Rows(0).Item(0)
password = ds.Tables(0).Rows(0).Item(1) 'assigning data to the
variables

If password = "" And username = "" Then


MsgBox("Invlaid Username or password")
Else
Dim frm As New Form1 'show the form

Me.Hide()

End If
Catch ex As Exception
MsgBox("Invlaid Username or password ")
End Try

21
Comments for the tasks

Comments for the tasks


Comments can be used to document what the program does and what particular blocks or lines of
code do. Since the Visual Basic compiler ignores comments, you can include them anywhere in a
program without affecting your code.
22
A comment is preceded by an apostrophe. The code of line after the apostrophe is simply ignored
by the compiler. To code a comment, type an apostrophe followed by the comment. You can use
this technique to add a comment on its own line or to add a comment after the code on a line.
Often when you code, you may want to comment out an entire block of code statements. Under
normal circumstances, to do so you must Comment out each line individually.

Uses of the comment

• Use comments only for portions of code that are hard to understand.
• Comments are used to help document what a program does and what the code with it
does. Keep the comments simple and straight.
• Make sure that your comments are correct and up-to-date. There is no point in
commenting correctly on code if the comments are not changed with the code. Both code
and comments must move in parallel, otherwise the comments will really create life
harder for developers who maintain your code.
• During testing, you can comment out lines of code by coding an apostrophe before them.
This is useful for testing new statements without deleting the old statement.

Some example is given below

Dim frmainfo As New Form9 'appear the Rerservation form


frmainfo.MdiParent = Me 'the sub form appear the inside of the main
form
frmainfo.Show()

Commen
t

23
Generation and reports of the Envisioned system

Crystal Report.

Crystal report is a one of the most features of the visual programming. Crystal Reports for Visual
Studio brings the facility to make interactive, presentation-quality content to the Windows
environment. With Crystal Reports for Visual Studio, you can make complex and professional
reports in a GUI-based program. Then you can connect your report to almost any database
source, as well as to proxy data, such as a result set. With the wizards included in the GUI
24
designer, you can easily set formatting, grouping, charting, and other criteria. We can make
Reports, Print and Print Preview of reports from Crystal Reports. The package consists of a
designer - where you can design and test the reports, Crystal Reports API calls and Crystal
Reports control.
I used the crystal report in the airways reservation system. This crystal report is helped to
develop this software system. There are some example crystal reports are given below.

Conformed/waiting passenger list.

Daily collection list

25
These are the example of crystal reports.

26
Validation checks of the system

Validation of the system

Validation is most power full thing in every software, because whenever our software is error
free for the runtime, that time validation is very helpful for us. The first thing to do when
validating any data is to make a decision exactly what input the program should accept. Data
validation is the process of ensuring that a program operates on clean, accurate and useful data. It
uses routines, often called "validation rules" or "check routines", that check for correctness,
meaningfulness, and security of data that are input to the system. The rules may be implemented

27
through the automated facilities of a data dictionary, or by the inclusion of explicit application
program validation logic.

Validations are mainly classified 2 types.


Data validation
Form validation.

Both are very similar, but one small different, that are:

Whenever we are typing inside the validated textbox, suppose typed wrong text that will give
immediate validation message that is called data validation. That messages whenever after
pressing the save button if it comes that is called form validation.

In this airways reservation application we can check these two validations. In my system we can
see this some validation date validation, Number Validation, Character Validation, Null Value
Validation and Primary Key Validation.

When you are filling the reservation menu sometimes you forgot to fill the one column. You
can’t access that reservation form. That reservation form shows the error message to you. This is
a null value validation.

We can get the more information about this validation in the task 9.

28
Validate the form controls against the users input

User Input Validation

While any application can be designed with sound logic and good technology and can bring high
performance with accuracy, some errors could still creep into it. This could be due to wrong
inputs by users. While the programmer may have taken care of all the exceptions it could cause a
loss of business goodwill if a customer is confronted with an error message after he/she has input
data into a number of fields. All of us are familiar with warnings like “Please enter a valid data”
or “Please Enter Your First Name!”

29
Therefore some client side validations ensure that accurate data is sent to the application. We can
ensure such validations using validation controls. .NET Framework provides several controls for
different types of validations.
This form control validation is very important when it comes to data insertion. The database
errors will show if the user enter non related data and also if the user neglects the data to be
entered. The user needs to be warned before the data is connected with the database. The data
that flows to the database needs to have all the aspects of the data corrected. The user input an
error needs to be validated using these form control validations.

In our airways reservation system also has this form control validation. I have given example
below.
This is the login menu. In this menu if you put the wrong username or password you can’t move
to the next menu. Here you can’t get the error message. Here you will get the username and
password data from the database.

30
In this login menu you must give the correct username and password. Here you get that
username and password from the database.
We use this coding to get the data from the database.
Try
Dim con As New SqlConnection()
con.Open()

Dim cmd As New SqlCommand("Select * from User where


username=@username and password=@password") 'Create sql using querys

cmd.Parameters.AddWithValue("@password", txtpassword.Text)
cmd.Parameters.AddWithValue("@username", txtusername.Text)
cmd.Connection = con
cmd.CommandType = CommandType.Text
Dim da As New SqlDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds, "Password")

Dim password As String ' Creating variables


Dim username As String

username = ds.Tables(0).Rows(0).Item(0)
password = ds.Tables(0).Rows(0).Item(1) 'assigning data to the
variables

If password = "" And username = "" Then


MsgBox("Invlaid Username or password")
Else
Dim frm As New Form1 'show the form

Me.Hide()
End If
Catch ex As Exception
MsgBox("Invlaid Username or password ")
End Try
End Sub

In this login menu if you put the wrong username or password you will get the error message. In
our software system you will get the error message like this.

31
Here you can create the code for this error message like this.

Catch ex As Exception
MsgBox("Invlaid Username or password ")
End Try

If you put the correct username and password you can move the next menu. There are more
validations in the system build. Check the total program of the airways reservation system where
you will find more validations.

32
Use appropriate event handling for the form

Use appropriate event handling for the form


Events in the .NET Framework are based on the delegate model. Delegates are type-safe
Function Pointers or Callbacks. A delegate can reference both static and instance methods. Event
handling is the advanced feature of the visual programming. There are three aspects to using
events: declaring the event, raising the event, and handling the event. In this airways reservation
application I used this event handling. Here we can see that example.

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


System.EventArgs) Handles btnsignin.Click

The Handles keyword is used to tell the program to look for the specific event. The sub or the
function that handles the event will be called immediately when the event occurs. This is a
simple implementation. In some cases you may have to raise an application event which will be

33
caught by the event handler. There are three aspects to using events: declaring the event, raising
the event, and handling the event. An event handler can be any procedure that is called when the
corresponding event occurs. You cannot use a function as an event handler as it would
necessitate the function to return a value to the source object. The event handler cannot be made
use of unless you first associate the procedure with the event by using the keyword Handles or
Add Handler statement.
When I click the add information icon I can get the add information table. That’s why I used this
event handling coding.
Private Sub AddInformationToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
AddInformationToolStripMenuItem.Click
Dim frmai As New Form5 'appear the Rerservation form
frmai.MdiParent = Me 'the sub form appear the inside of the main form
frmai.Show()
End Sub

This is the
button
click event coding.
Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnexit.Click
Me.Close()

If you click the exit button form will close. That’s why we use this button click event coding.

In the Horizon Airways login page has the login button. That login button handling the click
event. If you click that button that button compare the username and password with the SQL
database username and password. In this login button I used the click event handling. Here you
can see that coding. This event helped to connect the database.

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


System.EventArgs) Handles btnsignin.Click
Try
Dim con As New SqlConnection()

34
con.Open()

Dim cmd As New SqlCommand("Select * from User where This is the


username=@username and password=@password") 'Create sql using querys
button click
cmd.Parameters.AddWithValue("@password", txtpassword.Text) event
cmd.Parameters.AddWithValue("@username", txtusername.Text)
cmd.Connection = con
cmd.CommandType = CommandType.Text
Dim da As New SqlDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds, "Password")

Dim password As String ' Creating variables


Dim username As String

username = ds.Tables(0).Rows(0).Item(0)
password = ds.Tables(0).Rows(0).Item(1) 'assigning data to the
variables

If password = "" And username = "" Then


MsgBox("Invlaid Username or password")
Else
Dim frm As New Form1 'show the form

Me.Hide()

End If
Catch ex As Exception
MsgBox("Invlaid Username or password ")
End Try
End Sub
End Class

35
Gantt chart

36
Conclusion

I have been developed software system for Horizon Airways which is in the latest technology
and using visual program. While creating the software system, I suffered to get visual program
software and server connection to my pc. And also I faced lot of challenges to create this
software but it helps to create airway reservation application which is in latest technology to
facilitate passengers to make online inquiries about the flights and waiting list status a new
system for the Horizon Airways.

Earlier database of Horizon Airways has faced many drawbacks to operate reservation
operations. I hope airways reservation application will be very useful for the Horizon Airways.

After complete of this assignment I understood how to create the visual programming and also
the concept of the visual programming in airways reservation application. I complete the project
successful time management. I believe this assignment is helpful to achieve my successful
carrier.
37
Reference
Web page

Textbox Control, Updated on 23th of November 2009, startvbdotnet,


http://www.startvbdotnet.com/controls/textbox.aspx, viewed on 14th of April 2010.

Labels, Textbox, Properties, Updated on 25th of August 2009, edumax,


http://www.edumax.com/vb-net-basics-labels-textbox-properties.html, viewed on 27th of April
2010.

Forms, Updated on 23th of November 2009, statvbdotnet,


http://www.startvbdotnet.com/forms/form1.aspx, viewed on 17th of April 2010.

Tutorials, Updated on 12th of January 2010, smartdraw,


http://www.smartdraw.com/resources/tutorials/Introduction-to-UML, viewed on 29th of April
2010.

38
Visual Objects® 2.7, Updated on 29th of December 2009, cavo, http://www.cavo.com/info/,
viewed on 12th of April 2010.

Book page
Larry Long. Nancy Long, computers information technology in perspective, twelfth Edition,
personal Education International

39