Visual basic project of the booking system

Authors Avatar

        HNC SOFTWARE ENGINEERING

VISUAL BASIC PROJECT

OF THE BOOKING SYSTEM

CARLOS ALBERTO MONTOYA

HNC SOFTWARE ENGINEERING (FAST TRACK).

LECTURER:  IAN EMMS
TABLE OF CONTEST

TABLE OF CONTEST        

ASSIGNMENT        

SYSTEM REQUIREMENTS        

DESIGN LAYOUT        

STAGE 1        

STAGE 2        

PROBLEMS WITH MY DESIGN AND CODE        

SOLUTIONS TO THE PROBLEMS I FOUND ON MY DESIGN        

FINAL CODES        

        CODES OR PROCESS FOR THE coursecode COMBO BOX        

        CODE  IN ROOMS 1 LIST BOX        

        CODES IN THE roomnumber TEXT BOX        

        CODES IN THE cmdsave COMMAND BUTTON        

        CODES IN THE cmdload COMMAND BUTTON        

        CODES IN THE cmdprint COMMAND BUTTON        

        CODES IN THE cmdreset COMMAND BUTTON        

        CODES IN THE cmdabout COMMAND BUTTON        

        CODES IN THE cmdexit COMMAND BUTTON        

        CODES FOR cmdok  BUTTON ON THE FRMABOUT FORM.        

        CODES FOR timer1 on booking system form.        

ASSUMPTIONS        

EVALUATION        

REFERENCES        


ASSIGNMENT

A College requires a booking application for the Computer rooms in the college.

The application needs to record the Tutor who wants to book the room, the course code for the class, the date of the booking, the start and finish times of the booking, the room number, the number of computers in the booked room that are required (this is dependent on the number of students in the class) and any specialist software required for a particular class i.e. Visual Basic, Select CASE Tool, Flash etc.

Available Information:

  • Rooms T100, T229, T201, T232 each have 25 computers
  • Rooms T217, T212, T211, T221 each have 20 computers
  • Rooms T227, T223, T152 each have 15 computers

  • Course Code HCCISX0A – 21 Students
  • Course Code ZHMMMX1A – 23 Students
  • Course Code HCCISE1A – 18 Students
  • Course Code HCCISE2A – 13 Students

  • Course Code HCCISX0A – needs Visual Basic, Select and Flash
  • Course Code ZHMMMX1A – needs Visual Basic and Flash
  • Course Code HCCISE1A – needs Visual Basic
  • Course Code HCCISE2A – needs Visual Basic, Select and Flash

The application needs to record this information onto disc for audit purposes and to provide a printout of the individual bookings for the tutor.

Validation needs to be included in the application.

SYSTEM REQUIREMENTS

  • Show the tutor the number of computer available and software available on the room they want to book.

  • Show the date on the text file and on the print out for the tutor.

  • Stop the user from booking on days that have already passed and time that has already passed.

  • Create a text file with the information enter on the system.

  • Produce a print out for the tutor.


DESIGN LAYOUT

  • Here we can identify the picture box, labels and list boxes.

  • Here we can identify the combo boxes on the layout.

  • Here we can identify the text boxes and the command buttons.

  • Here we can identified  the user interface base on the visual basic project

STAGE 1

INPUT, PROCESS, OUTPUT

INPUT = Course code, room number, name, surname, day, month, year, start time and finish and time.

PROCESS: If course code = valid/correct and

Room number = valid/correct and

Name = valid/correct and

Surname = valid/correct and

Day = valid/correct and

Month = valid/correct and

Year = valid/correct and

Start time = valid/correct and

Finish time = valid/correct Then

Continue and save the booking to a text file and print out a copy of the booking for the user as a Friendly layout, else show a message box asking the user

to enter correctly all the information needed to process the application.

OUTPUT: Show the information on the user interface could be as a text box or a list box to the user and print out a copy of the booking.

STAGE 2

PROCESS

If course code = valid/correct and

Room number = valid/correct and

Name = valid/correct and

Surname = valid/correct and

Day = valid/correct and

Month = valid/correct and

Year = valid/correct and

Start time = valid/correct and

Finish time = valid/correct Then

Continue and save the booking to a text file and print out a copy of the booking for the user as Friendly layout Else show a message box asking the user

to correctly enter the information needed to process the application.

PROBLEMS WITH MY DESIGN AND CODE

I have been working through my design and the code behind the design and I have found a few problems:

  1. If the user does not enter information in more that two different places the messages box comes up one after the other.  I want to write a code that will stop this happening for example; if the user does not enter his or her name, I do not want the user to continue until that text box has been fill.

  1. The user can book a room in a time that has already passed. For example, start time 10:00 am and finish time 9:00 am.

  1. The user can book a room with the start time and finish time being the same.  Example start time 10:00 am and finish time 10:00 am.

  1. The user can still book a room on a date that has already passed.  Example on January 5th 2003.

  1. The user can write anything on the combo boxes,  day, month, year, start time , finish time and course code where all the information has been enter on the properties.

  1. The print out is not easy to read, the layout is all wrong and the user will not understand it.

  1. I want the user to be able to see the date.

  1. I wan the user to be able to see the time.

  1. The information the user is entering into the system is not appearing on the

bookinfo list box.

  1. There is not message box that ask the user if the information they enter is correct.

  1. I do not think I need the information command button to find out what rooms are available with a course code.

  1. I found a problem if the user wants to make a new booking.

  1. There should be a  drop down menu on the form.


SOLUTIONS TO THE PROBLEMS I FOUND ON MY DESIGN

  1. If the user does not enter information in more that two different places the messages box comes up one after the other.  I want to write a code that will stop this happening for example; if the user does not enter his or her name, I do not want the user to continue until that text box has been fill.

  • The way I found to stop the messages boxes appearing one after the other in to write exit sub  on the code after the message box and before the end if.

If coursecode.text = “” then

Msgbox “please select a course code”

Exit sub

End if

  1. The user can book a room in a time that has already passed. For example, start time 10:00 am and finish time 9:00 am.

  • The way I solve this by creating an if statement where the programs ask itself if start time is greater than finish time,

If Combohour.Text > Combohours.Text Then

MsgBox ("THIS ROOM CAN NOT BE BOOK,  THIS TIME HAS ALREADY PASS OR YOU ENTERED AN INCORRECT TIME PLEASE CHECK AGAIN "), (vbCritical)

Exit Sub

End If

  1. The user can book a room with the start time and finish time being the same.  Example start time 10:00 am and finish time 10:00 am.

  • The way I solve this problem was by written a code as and if…then….end if statement where the programs ask itself if the start time is the same as the finish time if the answer is yes a message box will be display asking the user to check the start/finish time.
  • The code for this is the following:

If Combohour.Text = Combohours.Text Then

MsgBox ("ANY ROOM MUST BE BOOK FOR MORE THAN 15 MINUTES"), (vbCritical)

Exit Sub

End If

  1. The user can still book a room on a date that has already passed.  Example on January 5th 2003.

  • I am sure that there is an easier way to do this but personally, I found this one very helpful.

The way I resolved this was by creating a five different labels but on this

case I’m only going to use three;

For the day, a label call lblday.

For the month, a label call lblmonth.

For the year, a label call lblyear.

  • In addition, the code for the labels is in a timer. The code for the timer is the following:

Private Sub Timer1_Timer()

lblday.Caption = Format$(Date, "d")

lblmonth.Caption = Format$(Date, "mm")

lblyear.Caption = Format$(Date, "yyyy")

End Sub

  • And the code to stop the user using a days that has already pass for a booking is the following:

If comboday.Text < lblday.Caption And combomonth.Text = lblmonth.Caption And _

comboyear.Text = lblyear.Caption Or comboday.Text = lblday.Caption And _

comboyear.Text = lblyear.Caption And combomonth.Text < lblmonth.Caption _

Or comboyear.Text = lblyear.Caption And combomonth.Text < lblmonth.Caption

And comboday.Text < lblday.Caption Or comboday.Text > lblday.Caption And combomonth.Text _

< lblmonth.Caption And comboyear.Text = lblyear.Caption Then

MsgBox "WRONG DATE ENTERED OR WRONG TIME, PLEASE TRY AGAIN"

Exit Sub

End If

  • After I wrote that code the validation for the date still does not work.

I’m going to try a different set of code to compare each  label:

If Val(comboday.Text) < Val(lblday.Caption) And Val(combomonth.Text) _

<= Val(lblmonth.Caption) _

Or Val(comboday.Text) = Val(lblday.Caption) And _

 Val(combomonth.Text) < Val(lblmonth.Caption) _

Or Val(combomonth.Text) < Val(lblmonth.Caption) _

And Val(comboday.Text) < Val(lblday.Caption) Then

MsgBox "WRONG DATE ENTERED, PLEASE TRY AGAIN"

Exit Sub

End If

This code must be on the command buttons that the user is more likely to use.

  1. The user can write anything on the combo boxes,  day, month, year, start time , finish time and course code where all the information has been enter on the properties.
Join now!

  • The way I found to stop this from happening was telling the program what is suppose to be on each combo box and if  the programs finds something that has not been specified on the code a message box will be display to the user telling them that the information he/she just enter is incorrect.

  • The code for the course code combo box is the following;

If coursecode.Text = "ZHMMMX1A" Or coursecode.Text = "HCCISX0A" _

Or coursecode.Text = "HCCISE1A" Or coursecode.Text = "HCCISE2A" Or _

coursecode.Text = "select course code" Then

Else

coursecode.Text = ...

This is a preview of the whole essay