(Affiliated to M.D.
S University, Ajmer)
Session 2019-2020
Project Report
On
HOTEL MANAGEMENT SYSTEM
In partial fulfillment of the requirements of
qualifying in
[Link] (IT) IV- SEM
Project Guide: Submitted by:
Shabnam Kureshi ADITI PAREEK
1
PROJECT WORK EVALUATION
NAME - ADITI PAREEK
PROJECT TITLE - HOTEL MANAGEMENT SYSTEM
SOFTWARE BASE - FRONT END - [Link] 5.0
BACK END - MS ACCESS
NAME OF COLLEGE
VIDYA PROFESSIONAL & TECHNICAL COLLEGE, BHILWARA (RAJ.)
311001
SUBMITTED FOR COURSE & YEAR: - [Link](IT) IV-SEM
2019-2020
* Total internal assessment and exam work
Evaluation............... Marks out of......................
* Details of evolution along with name and sign of
Teacher:
Student name MAXIMUM MARKS
MARKS AWARDED
ADITI PAREEK 100
* Forwarding by head of college
(SIGNATURE, NAME & COLLEGE SEAL)
...................................................................
2
CERTIFICATE
This is to certify that the project entitled “HOTEL MANAGEMENT SYSTEM”
is a bona fide record of the project work done by Ms. ADITI PAREEK [Link]
(IT) Final Year at VPTC, Bhilwara, Rajasthan under my supervision and
guidance. This report is being submitted in partial fulfillment of the requirement
for the award of the degree of PG in INFORMATION TECHNOLOGY from
M.D.S University, Ajmer.
Director Project Guide
Er. Geeta Choudhary Ms. Shabnam Kureshi
3
ACKNOWLEDGEMENT
I express my deep sense and gratitude and sincere thanks to our Teacher and
Guide Ms. Shabnam Kureshi under whose guidance I have successfully
completed my project on Library Management.
The harmonious climate in our institution provides proper academic setting. It
was a privilege to have been to guide by Ms. Shabnam Kureshi
Our honest thanks to Principal Mrs. GEETA CHOUDHARY or providing all
possible facilities during the courses of this project and arranging suitable time
schedules while the whole project.
We would like to add a sincere lot of thanks to the entire member of computer
lab in our institute for being so co-operative and encourage all thought of the
project.
Last but not the least, we also pay our sincere thanks to our parents, to our all
and to those person mentioned above or not who have directly or indirectly
helped us in preparing this project.
We acknowledgement here out debt to those who contributed significantly to
one or more steps we take full responsibility for any remaining sins of omission
and commission.
(ADITI PAREEK)
4
TABLE OF CONTENTS
1. Introduction to project
2. Objectives of project
3. Feasibility Study
4. Project Planning & Development
5. System specification
a. Hardware
b. Software
6. System Analysis
7. VB- The Front
8. SQL Database –The Back End
9. Database Structure(Tables)
10. Forms Layouts & Coding
11. Testing
12. System Implementation & Evaluation
13. Conclusion
14. Future Aspects of Our Project
15. Bibliography
5
Feasibility Study
After the problem is clearly understood & solutions are proposed,
then the next step is to conduct the feasibility study, which is a part of
system analysis as well as design process. The main objective of this
study is to determine whether the proposed system is feasible or not.
Mainly there are three types of feasibility study.
1. TECHNICAL FEASIBILITY
It deals with the hardware as well as
software requirements If the necessary requirements are made available with
the system then the proposed system is said to be technically feasible.
2. ECONOMIC FEASIBILITY
Even though an initial investment has to
be made on software hardware aspects , the proposed system aim at
processing of transactions effectively, thus saving money & time. Since the
existing system takes a lot of time and money the proposed system is efficient
economically. Even though the initial investment for proposed system is high,
this can be overcome by gradually using system.
3. OPERATIONAL FEASIBILITY
The Proposed system offers greater level
of user friendliness with greater processing speed. Since the workload is
reduced, the management convenience the project is operational feasible.
6
OBJECTIVE OF PROJECT
The result of change is development and thus new things come into existence.
Now a days computer spreads its aim in almost all field early the attention was
given on hardware development.
The app HOTEL MANAGEMENT SYSTEM action software is one of the parts
of this change. The objective of the project “HOTEL MANAGEMENT
SYSTEM” is to determine atomize the study.
The project is based on the [Link] the features, commands and functions of the
project “HOTEL MANAGEMENT SYSTEM” are completed very simple and
clearly.
I also added a Help file of COLLEGE for clients for his/her help that show how
he/ she can use HOTEL MANAGEMENT SYSTEM software.
The figures used in this report are the actual screen image or monitor
and actual printer.
The word Project consists of 7 alphabets, each of them has a Meaning:
P - Planning
R - Reliable Sources
O - Overall expenses
J - Joint efforts
E - Economic time feasibility
C - Construction
T - Testing
7
Software & Hardware Specification
Hardware Requirements:
1. Intel I3 Processor or higher
2. 4 GB RAM or higher
3. Hard disk 500 GB or higher
Software Requirements:
1. Operating System-Windows 7 or higher
2. [Link] 5.0(As Front End)
3. MS ACCESS (As Back End)
8
System Analysis
After analyzing the current system, many problems where located and
found that the current system of keeping record in any transaction was not
working efficiently. The current system was not utilizing the computer
resources in computer age.
The following problems were the reasons that the author decided to
change the current manual system into the new improved one.
1. The 1st major problem with the manual system was that it was
using book type register of a database to maintain the transaction.
2. The next problem was to find the particular transaction in
particular registers. It is found the register is often misplaced in daily worked
and whenever it was required cannot be easily traced out. It will adversely affect
the performance of store.
Calculation of daily transactions is also a very tedious job.
3. Maintaining of lab expenses/operational expenses details were also
a very tedious job and more tedious job was to update it.
4. Mistakes occurred in the calculations.
5. No security was provided in the current system. Any one can steel
then with less effort.
SOFTWARE DESCRIPTION
9
Microsoft Visual Basic .Net
Visual Basic .Net (VB. Net ) is a multi-paradigm, object-oriented programming
language, implemented on the .Net Framework. Microsoft launched VB. Net in
2002 as the successor to its original Visual Basic .Net language. Although the ".
Net " portion of the name was dropped in 2005, this article uses "Visual
Basic .Net” to refer to all Visual Basic .Net languages releases since 2002, in
order to distinguish between them and the classic Visual Basic. Along
with Visual C#, it is one of the two main languages targeting the . Net
framework.
Microsoft's integrated development environment (IDE) for developing in Visual
Basic .Ne language is Visual Studio. Most Visual Studio editions
are commercial; the only exceptions are Visual Studio Express and Visual
Studio Community, which are freeware. In addition, the . Net Framework
SDK includes a freeware command-line compiler called [Link].
Starting Visual Basic .[Link]
To start Visual Basic .[Link]:
Click on the Start button on the Windows task bar.
Select Programs, then Microsoft Visual Studio 2005
Click on Microsoft Visual Studio 2005 (where you find visual basic’s icon).
At the top of the screen is the Visual Basic .[Link] Main Window. At the top of the main
window is the Title Bar. The title bar gives us information about what program
we’re using and what Visual Basic .Net program we are working with. Under
the main menu is the Toolbar. Here little buttons with pictures also allow us to
10
control Visual Basic, much like the main menu. If you put the mouse cursor
over one of these buttons for a second or so, a little ‘tool tip’ will pop up and
tell you what that particular button does.
Parts of a Visual Basic .Net Project
There are three major components in a Visual Basic .Net project: the project
itself, the form, and the controls. Project is the word used to encompass
everything in a Visual Basic .Net project. Other words used to describe a
project are application or program. The Form is the window where you create
the interface between the user and the computer. Controls are graphical features
or tools that are placed on forms to allow user interaction (text boxes, labels,
scroll bars, command buttons). Recall the form itself is a control. Controls are
also referred to as objects. Pictorially, a project is:
Form on a new project :
11
Coding Window
Project consists of a form containing several controls. In looking around your
computer’s file directory, you may find some files associated with a Visual
Basic .Net project. Two primary files are used to save a Visual Basic .Net
project. The project file will have an extension of vbp (in addition, there is
sometimes a file with a vbw extension). The form file has an extension of frm
(in addition, there is sometimes a form file with an frx extension).
An important concept concerning a Visual Basic .Net project is that of a
property. Every characteristic of a control (including the form itself) is
specified by a property. Example properties include names, captions, sizes,
colors, position on the form, and contents.
Visual Basic .Net is an event-driven language. Visual Basic .Net is governed by
an event processor. That means that nothing happens in a Visual Basic .Net
project until some event occurs. Once an event is detected, the project finds a
series of instructions related to that event, called an event procedure. That
procedure is executed, and then program control is returned to the event:
EVENT
Event processor
12
Event Event Event
Event procedures are where we do the actual computer programming and are
saved with the form in the file with the frm extension. These procedures are
where we write BASIC language statements. You will learn a lot of
programming and BASIC language in this course. The BASIC you will learn is
very similar to the original BASIC used by Bill Gates and Paul Allen when
starting Microsoft.
Parts of the Visual Basic .Net Program
Visual Basic .Net is more than just a computer language. It is a project building
environment. Within this one environment, we can begin and build our project,
run and test our project, eliminate errors (if any) in our project, and save our
project for future use. With other computer languages, many times you need a
separate text editor to write your program, something called a compiler to create
the program, and then a different area to test your program. Visual Basic .Net
integrates each step of the project building process into one environment. Let’s
look at the parts of the Visual Basic .Net environment.
Main Window
Start Visual Basic .Net using the procedure learned in Class 1. Notice that
several windows appear. The Main Window is used to control most aspects of
the Visual Basic .Net project building and running process.
The main window consists of the title bar, menu bar, and toolbar. The title bar
indicates the project name and the current Visual Basic .Net operating mode
(design, break, run). The menu bar has drop-down menus from which you
control the operation of the Visual Basic .Net environment.
Form Window
The Form Window is central to developing Visual Basic .Net applications. It is
where you develop your application.
13
Properties
Like all controls, the form has many (over 40) properties. Fortunately, we only
have to know about some of them. The properties we will be concerned with
are:
Property Description
Name Name used to identify form.
Caption Text that appears in the title bar of form .
Icon Reference to icon that appears in title bar of form.
Left Distance from left side of computer screen to left side form.
Top Distance from top side of computer screen to top side form.
Width Width of the form in twips .
Height Height of form in twips .
Back Color Background color of form.
Border Style Form can either be sizable (can resize using the mouse).
Form Events
The form primarily acts as a ‘container’ for other controls, but it does support
events. That is, it can respond to some user interactions. We will only be
concerned with two form events in this course:
Toolbox Window
The Toolbox Window is the selection menu for controls used in your
application.
14
DATABASE TABLES
USER TABLE
ROOM TABLE
15
PRICE TABLE
EXPIRE TABLE
16
CUSTOMER TABLE
CUSTOMER EXPIRE TABLE
CHECK OUT TABLE
17
CHECK IN TABLE
CHANGE ROOM TABLE
BOOKING TABLE
18
Forms Layouts & Coding
LOGIN FORM
19
Public Class fLogIn
Private Sub btnLogIn_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
If [Link] = "" Then
Message("Enter User Name.")
[Link]()
ElseIf [Link] = "" Then
Message("Enter Password.")
[Link]()
Else
[Link] = "Select UserName,Pass,Permission from tblUser where
UserName='" & Encrypt([Link]) & "' And Pass='" &
Encrypt([Link]) & "'"
Dr = [Link]
If [Link] = True Then
[Link]()
[Link] = [Link]
If Dr(2) = "Admin" Then
[Link] = True
[Link] = True
[Link] = True
[Link] = True
[Link] = True
Else
[Link] = False
[Link] = False
[Link] = False
[Link] = False
[Link] = False
20
End If
Dim L As Boolean = False
Dim L1 As Boolean = False
[Link]()
[Link]()
[Link] = "Select * from QCheckIn where CheckOutDate<=#" &
DateAdd([Link], 1, Today) & "#"
Dr = [Link]
Do While [Link] = True
AddDataToLvw([Link], Dr(0), Dr(1), Dr(2), Dr(3), Dr(4),
Dr(5), Format(Dr(6), "dddd, MMMM dd," & _
"yyyy"), Dr(8), Format(Dr(7), "dddd, MMMM dd,yyyy"), Dr(9), Dr(10),
Dr(11), Format(Dr(12), "Curren" & _
"cy"), Format(Dr(13), "Currency"), Format(Dr(14), "Currency"),
Format(Dr(15), "currency"))
L = True
Loop
[Link]()
'Load Data For Booking Expire
[Link]()
[Link] = "Select * from QBooking where CheckInDate<=#" &
DateAdd([Link], 1, Today) & "#"
Dr = [Link]
Do While [Link] = True
AddDataToLvw([Link], Dr(0), Dr(1), Dr(2), Dr(3), Dr(4),
Dr(5), Format(Dr(6), "dddd, MMMM dd,yyy" & _
"y"), Dr(7), Format(Dr(8), "dddd, MMMM dd,yyyy"), Dr(9), Dr(10), Dr(11),
Format(Dr(12), "Currenc" & _
"y"), Format(Dr(13), "Currency"), Format(Dr(14), "Currency"), Format(Dr(15),
"currency"))
L1 = True
Loop
[Link]()
If L = True Or L1 = True Then
ShowForm(fExpire, Main)
End If
Else
Message("User Name Or Password are invalid.")
[Link]()
[Link]()
End If
21
[Link]()
End If
End Sub
Private Sub fLogIn_Activated(ByVal sender As Object, ByVal e As
[Link]) Handles [Link]
[Link]()
End Sub
Private Sub fLogIn_FormClosed(ByVal sender As Object, ByVal e As
[Link]) Handles [Link]
End
End Sub
Private Sub txtPassword_KeyPress(ByVal sender As [Link], ByVal e
As [Link]) Handles
[Link]
If Asc([Link]) = 13 Then
btnLogIn_Click(sender, e)
End If
End Sub
Private Sub txtUserName_KeyPress(ByVal sender As [Link], ByVal e
As [Link]) Handles
[Link]
If Asc([Link]) = 13 Then
btnLogIn_Click(sender, e)
End If
End Sub
Private Sub fLogIn_Load(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
End Sub
Private Sub txtUserName_TextChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
End Sub
End Class
22
MDI FORM
Public Class Main
Private Sub ViewAllRoomToolStripMenuItem1_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
ShowForm(fViewRoom, Me)
End Sub
Private Sub Main_FormClosed(ByVal sender As Object, ByVal e As
[Link]) Handles [Link]
[Link]()
[Link]()
End Sub
Private Sub Main_Load(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link] = [Link]
OpenConnect()
[Link] = "User Name"
[Link] = Format(Now, "dd-MMM-yyyy HH:MM:ss")
[Link] = True
[Link] = 1000
[Link]()
End Sub
Private Sub CheckInToolStripMenuItem3_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
CheckInMenu()
23
End Sub
Private Sub BookingToolStripMenuItem3_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
BookingMenu()
End Sub
Private Sub CheckOutToolStripMenuItem2_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
ShowForm(fCheckOut, Me)
End Sub
Private Sub CheckInToolStripMenuItem4_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
ShowForm(fSearchCheckIn, Me)
End Sub
Private Sub BookingToolStripMenuItem4_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
ShowForm(fSearchBooking, Me)
End Sub
Private Sub CustomerInformationToolStripMenuItem1_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
ShowForm(Form1, Me)
End Sub
Private Sub SetRoomPriceToolStripMenuItem_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
ShowForm(Form3, Me)
End Sub
Private Sub RoomInformationToolStripMenuItem2_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
ShowForm(frmRoom, Me)
End Sub
24
Private Sub SetUpUserToolStripMenuItem1_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
ShowForm(fUser, Me)
End Sub
Private Sub ChangeUserNamePasswordToolStripMenuItem1_Click(ByVal
sender As [Link], ByVal e As [Link]) Handles
[Link]
ShowForm(fChangeUser, Me)
End Sub
Private Sub CheckInToolStripMenuItem5_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
[Link]()
[Link]()
ShowForm(fRptCheckIn, Me)
End Sub
Private Sub BookingToolStripMenuItem5_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
[Link]()
[Link]()
ShowForm(fRptBooking, Me)
End Sub
Private Sub CheckOutToolStripMenuItem3_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
[Link]()
[Link]()
ShowForm(fRptCheckOut, Me)
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
CheckInToolStripMenuItem3_Click(sender, e)
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
BookingToolStripMenuItem3_Click(sender, e)
End Sub
25
Private Sub ToolStripButton3_Click(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
CheckOutToolStripMenuItem2_Click(sender, e)
End Sub
Private Sub ToolStripButton4_Click(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
ViewAllRoomToolStripMenuItem1_Click(sender, e)
End Sub
Private Sub ToolStripButton5_Click(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
SetUpUserToolStripMenuItem1_Click(sender, e)
End Sub
Private Sub ToolStripButton6_Click(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
[Link]()
[Link]()
[Link]()
End Sub
Private Sub ToolStripButton7_Click(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
ExitToolStripMenuItem1_Click(sender, e)
End Sub
Private Sub ExitToolStripMenuItem1_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
Dim Mess As String
Mess = MsgBox("Do you want to Exit?", [Link] +
[Link], "Hotel Management System")
If Mess = vbOK Then
End
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link] = Format(Now, "dd-MMM-yyyy HH:MM:ss")
End Sub
26
Private Sub LogOutToolStripMenuItem1_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
ToolStripButton6_Click(sender, e)
End Sub
End Class
CUSTOMER INFORMATION FORM
Imports [Link]
Public Class Form1
Dim Ind As Integer
Dim Li As ListViewItem
Private Sub Form1_Load(ByVal sender As [Link], ByVal e As [Link])
Handles [Link]
[Link] = "Cust-" & Format(AutoID("tblCustomer", "CusID"), "0000")
If CusSearch <> "" Then
Dim Dr1 As OleDbDataReader
[Link] = CusSearch
Dr1 = [Link]
If [Link] = True Then
AddDataToLvw(LstCustomer, Dr1(0), Dr1(1), Dr1(2), Dr1(3), Dr1(4), Dr1(5), Dr1(6),
Dr1(7), Dr1(8), Dr1(9), Dr1(10))
End If
[Link]()
CusSearch = ""
End If
27
' Store Data from FrmCheckIn
If CName <> "" Then
[Link] = CName
[Link] = CGender
[Link] = CAddress
[Link] = CPNo
[Link] = CCNo
CuID = [Link]
End If
End Sub
Private Sub btnClose_Click(ByVal sender As [Link], ByVal e As [Link])
Handles [Link]
If CName <> "" Then
[Link]()
CheckInMenu()
Else
[Link]()
End If
End Sub
Private Sub btnSave_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
If [Link] = "" Then
Message("Complete Customer ID.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Customer Name.")
[Link]()
ElseIf [Link] = "" Then
Message("Choose one Gender.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Address.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete City.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete State.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Country.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Nationality.")
28
[Link]()
ElseIf [Link] = "" Then
Message("Complete Card No.")
[Link]()
Else
[Link] = "Insert into tblCustomer Values(?,?,?,?,?,?,?,?,?,?,?)"
With [Link]
.Add("@CID", [Link]).Value = [Link]
.Add("@CName", [Link]).Value = [Link]
.Add("@Gender", [Link]).Value = [Link]
.Add("@DOB", [Link]).Value = [Link]
.Add("@Address", [Link]).Value = [Link]
.Add("@City", [Link]).Value = [Link]
.Add("@State", [Link]).Value = [Link]
.Add("@Country", [Link]).Value = [Link]
.Add("@Nationality", [Link]).Value = [Link]
.Add("@PassNo", [Link]).Value = [Link]
.Add("@CardNo", [Link]).Value = [Link]
End With
[Link]()
[Link]()
AddDataToLvw(LstCustomer, [Link], [Link],
[Link], [Link], [Link], [Link], [Link],
[Link], [Link], [Link], [Link])
ClearAll(Me)
[Link] = -1
[Link]()
[Link] = "Cust-" & Format(AutoID("tblCustomer", "CusID"), "0000")
Message("Sucess.")
End If
End Sub
Private Sub btnShow_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim li As ListViewItem
If [Link] = "Show All" Then
[Link]()
[Link] = "Select * from tblCustomer"
Dr = [Link]
Do While [Link] = True
li = [Link](Dr(0), 0)
With [Link]
.Add(1).Text = Dr(1)
29
.Add(2).Text = Dr(2)
.Add(3).Text = Dr(3)
'.Add(3).Text = Dr(3)
.Add(4).Text = Dr(4)
.Add(5).Text = Dr(5)
.Add(6).Text = Dr(6)
.Add(7).Text = Dr(7)
.Add(8).Text = Dr(8)
.Add(9).Text = Dr(9)
.Add(10).Text = Dr(10)
'MsgBox(IsDBNull(Dr(9)))
End With
Loop
[Link]()
[Link] = "Unshow"
Else
[Link]()
[Link] = "Show All"
End If
End Sub
Private Sub btnEdit_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim Sl As [Link] =
[Link]
If [Link] = "Edit" Then
For Each Li In Sl
Exit For
Next
[Link] = [Link]
[Link] = [Link](1).Text
[Link] = [Link](2).Text
[Link] = IIf(([Link](3).Text) = " ", [Link],
[Link](3).Text)
[Link] = [Link](4).Text
[Link] = [Link](5).Text
[Link] = [Link](6).Text
[Link] = [Link](7).Text
[Link] = [Link](8).Text
[Link] = [Link](9).Text
[Link] = [Link](10).Text
Ind = [Link]
[Link] = "Update"
Else
Li = [Link](Ind)
30
[Link] = [Link]
[Link](1).Text = [Link]
[Link](2).Text = [Link]
[Link](3).Text = [Link]
[Link](4).Text = [Link]
[Link](5).Text = [Link]
[Link](6).Text = [Link]
[Link](7).Text = [Link]
[Link](8).Text = [Link]
[Link](9).Text = [Link]
[Link](10).Text = [Link]
[Link] = "Update tblCustomer set
CusName=?,Gender=?,DOB=?,Address=?,City=?" & _
",State=?,Country=?,Nationality=?,PassportNo=?,CardNo=? where CusID=?"
With [Link]
.Add("@CName", [Link]).Value = [Link]
.Add("@Gender", [Link]).Value = [Link]
.Add("@DOB", [Link]).Value = [Link]
.Add("@Address", [Link]).Value = [Link]
.Add("@City", [Link]).Value = [Link]
.Add("@State", [Link]).Value = [Link]
.Add("@Country", [Link]).Value = [Link]
.Add("@Nationality", [Link]).Value = [Link]
.Add("@PassNo", [Link]).Value = [Link]
.Add("@CardNo", [Link]).Value = [Link]
.Add("@CID", [Link]).Value = [Link]
End With
[Link]()
[Link]()
ClearAll(Me)
[Link] = -1
[Link]()
[Link] = "Cust-" & Format(AutoID("tblCustomer", "CusID"), "0000")
Message("Success.")
[Link] = "Edit"
End If
End Sub
Private Sub btnDelete_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim Sl As [Link] =
[Link]
For Each Li In Sl
Exit For
Next
31
Dim Str As String
Str = [Link]("Do you want to Delete this Record?", "Hotel
Management System", [Link],
[Link])
If Str = vbOK Then
[Link] = "Delete from tblCustomer where CusID=?"
[Link]("@CID", [Link]).Value = [Link]
[Link]()
[Link]()
[Link](Li)
Message("Sucess.")
End If
End Sub
Private Sub DeleteToolStripMenuItem_Click(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
btnDelete_Click(sender, e)
End Sub
Private Sub EditToolStripMenuItem_Click(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
Dim Sl As [Link] =
[Link]
For Each Li In Sl
Exit For
Next
[Link] = [Link]
[Link] = [Link](1).Text
[Link] = [Link](2).Text
[Link] = IIf(([Link](3).Text) = " ", [Link],
[Link](3).Text)
[Link] = [Link](4).Text
[Link] = [Link](5).Text
[Link] = [Link](6).Text
[Link] = [Link](7).Text
[Link] = [Link](8).Text
[Link] = [Link](9).Text
[Link] = [Link](10).Text
Ind = [Link]
[Link] = "Update"
End Sub
Private Sub btnCancel_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
ClearAll(Me)
32
[Link]()
[Link] = -1
[Link] = "Edit"
[Link] = "Cust-" & Format(AutoID("tblCustomer", "CusID"), "0000")
End Sub
Private Sub btnSearch_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
'[Link]()
ShowForm(Form2, Main)
End Sub
Private Sub CheckInToolStripMenuItem1_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
Dim Sl As [Link] =
[Link]
For Each Li In Sl
Exit For
Next
[Link]()
CheckInMenu()
With frmCheckIn
.[Link] = [Link]
.[Link] = [Link](1).Text
.[Link] = [Link](2).Text
.[Link] = [Link](4).Text
.[Link] = [Link](9).Text
.[Link] = [Link](10).Text
.[Link]()
End With
End Sub
Private Sub CheckInToolStripMenuItem_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
Dim Sl As [Link] =
[Link]
For Each Li In Sl
Exit For
Next
[Link]()
BookingMenu()
With frmCheckIn
33
.[Link] = [Link]
.[Link] = [Link](1).Text
.[Link] = [Link](2).Text
.[Link] = [Link](4).Text
.[Link] = [Link](9).Text
.[Link] = [Link](10).Text
.[Link]()
End With
End Sub
End Class
SEARCH CUSTOMER FORM
34
Public Class Form2
Dim Li As ListViewItem
Private Sub Form2_Load(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link] = True
SetTextBoxEnabled(True, False, False, False)
[Link]()
'OpenConnect()
End Sub
Sub SetTextBoxEnabled(ByVal CID As Boolean, ByVal CName As Boolean,
ByVal CCount As Boolean, ByVal CPass As Boolean)
[Link] = CID
[Link] = CName
[Link] = CCount
[Link] = CPass
End Sub
Private Sub ChkCustID_CheckedChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
If [Link] = True Then
[Link] = True
[Link]()
Else
[Link]()
[Link] = False
End If
End Sub
Private Sub ChkCustName_CheckedChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
If [Link] = True Then
35
[Link] = True
[Link]()
Else
[Link]()
[Link] = False
End If
End Sub
Private Sub ChkCountry_CheckedChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
If [Link] = True Then
[Link] = True
[Link]()
Else
[Link]()
[Link] = False
End If
End Sub
Private Sub ChkPassNo_CheckedChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
If [Link] = True Then
[Link] = True
[Link]()
Else
[Link]()
[Link] = False
End If
End Sub
Private Sub btnSearch_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
If [Link] = True And [Link] = True And
[Link] = True And [Link] = True Then
ElseIf [Link] = True And [Link] = True And
[Link] = True Then
SQLSearch("CusID='" & [Link] & "' And CusName='" &
[Link] & "' And Country='" & [Link] & "' and
PassportNo='" & [Link] & "'")
ElseIf [Link] = True And [Link] = True And
[Link] = True Then
SQLSearch("CusName='" & [Link] & "' And Country='" &
[Link] & "' and PassportNo='" & [Link] & "'")
36
ElseIf [Link] = True And [Link] = True And
[Link] = True Then
SQLSearch("CusID='" & [Link] & "' and CusName='" &
[Link] & "' And PassportNo='" & [Link] & "'")
ElseIf [Link] = True And [Link] = True And
[Link] = True Then
SQLSearch("CusID='" & [Link] & "' and CusName='" &
[Link] & "' And Country='" & [Link] & "'")
ElseIf [Link] = True And [Link] = True Then
SQLSearch("Country='" & [Link] & "' and PassportNo='" &
[Link] & "'")
ElseIf [Link] = True And [Link] = True Then
SQLSearch("CusName='" & [Link] & "'and PassportNo='" &
[Link] & "'")
ElseIf [Link] = True And [Link] = True Then
SQLSearch("CusName='" & [Link] & "' and Country='" &
[Link] & "'")
ElseIf [Link] = True And [Link] = True Then
SQLSearch("CusID='" & [Link] & "' And PassportNo='" &
[Link] & "'")
ElseIf [Link] = True And [Link] = True Then
SQLSearch("CusID='" & [Link] & "' And Country='" &
[Link] & "'")
ElseIf [Link] = True And [Link] = True Then
SQLSearch("CusID='" & [Link] & "' And CusName='" &
[Link] & "'")
ElseIf [Link] = True Then
SQLSearch("PassportNo='" & [Link] & "'")
ElseIf [Link] = True Then
SQLSearch("Country='" & [Link] & "'")
ElseIf [Link] = True Then
SQLSearch("CusName='" & [Link] & "'")
ElseIf [Link] = True Then
SQLSearch("CusID='" & [Link] & "'")
End If
End Sub
Sub SQLSearch(ByVal Str As String)
Dim L As Boolean = False
[Link] = "Select * from tblCustomer where " & Str
Dr = [Link]
Do While [Link] = True
AddDataToLvw(LstCustomer, Dr(0), Dr(1), Dr(2), Dr(3), Dr(4), Dr(5), Dr(6),
Dr(7), Dr(8), Dr(9), Dr(10))
L = True
37
Loop
If L = False Then
Message("Record Was Not Found.")
End If
[Link]()
End Sub
Private Sub btnSelect_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim Sl As [Link] =
[Link]
For Each Li In Sl
Exit For
Next
CusSearch = "Select * from TblCustomer where CusID='" & [Link] & "'"
[Link]()
ShowForm(Form1, Main)
End Sub
End Class
SET ROOM PRICE FORM
Public Class Form3
Dim Ind As Int32
Dim ID As Int16
Dim Li As ListViewItem
Private Sub btnSave_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
If [Link] = "" Then
38
Message("Complete Room Type.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Unit Price.")
[Link]()
Else
Dim i As Int16
Dim CID As Int16
i = Getid("tblPrice", "ID", "RoomType='" & [Link] & "'") - 1
If i = 0 Then
CID = Getid("tblPrice", "ID")
[Link] = "Insert into tblPrice values(?,?,?)"
[Link]("@RID", [Link]).Value = CID
[Link]("@RType", [Link]).Value =
[Link]
[Link]("@UnitPrice", [Link]).Value =
[Link]
[Link]()
[Link]()
AddDataToLvw(LstPrice, [Link], [Link])
ClearAll(Me)
[Link]()
Message("Success.")
Else
Message("Room Type already Exists.")
[Link]()
End If
End If
End Sub
Private Sub btnClose_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
End Sub
Private Sub btnShow_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
[Link] = "Select * from tblPrice"
Dr = [Link]
Do While [Link] = True
AddDataToLvw(LstPrice, Dr(1), Dr(2), Dr(0))
Loop
[Link]()
End Sub
39
Private Sub btnEdit_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim Sl As [Link] = [Link]
If [Link] = "Edit" Then
For Each Li In Sl
Exit For
Next
[Link] = [Link]
[Link] = [Link](1).Text
ID = [Link](2).Text
Ind = [Link]
[Link] = "Update"
Else
Li = [Link](Ind)
[Link] = [Link]
[Link](1).Text = [Link]
[Link] = "Update tblPrice set RoomType=?,UnitPrice=? where
ID=?"
[Link]("@RType", [Link]).Value =
[Link]
[Link]("@UnitPrice", [Link]).Value =
[Link]
[Link]("@ID", [Link]).Value = ID
[Link]()
[Link]()
Message("Sucess.")
ClearAll(Me)
[Link] = "Edit"
End If
End Sub
Private Sub btnDelete_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim Sl As [Link] = [Link]
Dim Str As String
Str = MsgBox("Do you want to Delete this Record?", [Link]
+ [Link], "Hotel Management System")
If Str = vbOK Then
For Each Li In Sl
Exit For
Next
[Link] = "Delete from tblPrice Where RoomType='" & [Link] &
"'"
[Link]()
40
Message("Sucess.")
[Link](Li)
[Link]()
End If
End Sub
Private Sub btnCancel_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
ClearAll(Me)
[Link]()
[Link] = "Edit"
End Sub
Private Sub EditToolStripMenuItem_Click(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
Dim Sl As [Link] = [Link]
For Each Li In Sl
Exit For
Next
[Link] = [Link]
[Link] = [Link](1).Text
ID = [Link](2).Text
Ind = [Link]
[Link] = "Update"
End Sub
Private Sub DeleteToolStripMenuItem_Click(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
btnDelete_Click(sender, e)
End Sub
End Class
CUSTOMER CHECK IN FORM
41
Imports [Link]
Public Class frmCheckIn
Dim Da As New OleDbDataAdapter
Dim Dt, Dt1, Dt2 As New DataTable
Dim CID, CRoom As Int16 'Check Condition from tblCheckIn
Dim BkID, BkRoom As Int16 'Check Conditon from tblBooking
Private Sub frmCheckIn_Load(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
'OpenConnect()
[Link]()
[Link] = Format(Now, "dddd, MMMM dd, yyyy")
' Load Data into cboRoomType
LoadRoomType(cboRType)
If CName <> "" Then
[Link] = CName
[Link] = CuID
[Link] = CAddress
[Link] = CGender
[Link] = CPNo
[Link] = CCNo
End If
PIconButton(4)
End Sub
Private Sub cboRType_SelectedIndexChanged(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
LoadRoomNum(cboRNum, cboRType, txtAmount, txtFloor, txtStaying,
txtTotal)
End Sub
42
Private Sub cboRNum_SelectedIndexChanged(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
LoadFloor(cboRNum, txtFloor)
End Sub
Sub Clearcus()
[Link] = ""
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
End Sub
Private Sub cboCusName_KeyPress(ByVal sender As Object, ByVal e As
[Link]) Handles [Link]
If Asc([Link]) = 13 Then
btnSCustomer_Click(sender, e)
End If
End Sub
Private Sub btnClose_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
CuID = ""
CName = ""
CGender = ""
CAddress = ""
CPNo = ""
CCNo = ""
End Sub
Private Sub txtStaying_TextChanged(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
[Link] = Format(DateAdd([Link], Val([Link]),
CDate([Link])), "dddd, MMMM dd, yyyy")
[Link] = Val([Link]) * Format([Link], "currency")
[Link] = Format([Link], "Currency")
End Sub
Private Sub txtPrepaid_GotFocus(ByVal sender As Object, ByVal e As
[Link]) Handles [Link]
[Link]()
End Sub
43
Private Sub txtPrepaid_LostFocus(ByVal sender As Object, ByVal e As
[Link]) Handles [Link]
PrepaidLostFocus(txtPrepaid, txtTotal)
End Sub
Private Sub txtPrepaid_TextChanged(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
If [Link] <> "" Then
[Link] = Format([Link], "Currency") - Format([Link],
"Currency")
[Link] = Format([Link], "Currency")
End If
End Sub
Private Sub btnCheckIn_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
If [Link] = "" Then
Message("Choose one Customer to Check In.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Number of Staying.")
[Link]()
ElseIf [Link] = "" Then
Message("Choose One Room Number.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Prepaid.")
[Link]()
Else
CID = Getid("tblCheckIn", "CheckInNo", "CusID='" & [Link] & "'") - 1
If CID = 0 Then
CRoom = Getid("tblCheckIn", "CheckInNo", "RoomNo=" & [Link] &
"") - 1
If CRoom = 0 Then
If i = 1 Then
[Link] = "Delete from tblBooking where CusID='" &
[Link] & "'"
[Link]()
CheckIn()
Else
BkID = Getid("tblBooking", "ID", "CusID='" & [Link] & "'") - 1
If BkID = 0 Then
BkRoom = Getid("tblBooking", "ID", "RoomNo=" & [Link] & "") - 1
If BkRoom = 0 Then
CheckIn()
44
i=0
Else
Message("Room " & [Link] & " was Booked already.")
End If
Else
Message("This Customer was Booked already.")
[Link]()
[Link]()
End If
End If
Else
Message("Room " & [Link] & " was not free.")
[Link]()
End If
Else
Message("This Customers are Staying.")
[Link]()
[Link]()
End If
End If
End Sub
Sub CheckIn()
Dim CheckID As Integer
CheckID = Getid("tblCheckIn", "CheckInNo")
[Link] = "Insert into tblCheckIn Values(?,?,?,?,?,?)"
With [Link]
.Add("@ChID", [Link]).Value = CheckID
.Add("@DIn", [Link]).Value = [Link]
.Add("@DOut", [Link]).Value = [Link]
.Add("@CID", [Link]).Value = [Link]
.Add("@RNo", [Link]).Value = [Link]
.Add("@Prepaid", [Link]).Value = [Link]
End With
[Link]()
[Link]()
Message("Success.")
Clearcus()
[Link]()
[Link]()
'[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
45
End Sub
Sub PIconButton(ByVal Icon As Int16)
[Link] = ImageList1
[Link] = Icon
End Sub
Private Sub btnNew_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
If [Link] = " New" Then
Clearcus()
[Link] = False
[Link] = False
[Link]()
[Link] = False
[Link]()
[Link] = "Cust-" & Format(AutoID("tblCustomer", "CusID"), "0000")
[Link] = " Save"
PIconButton(0)
Else
If [Link] = "" Then
Message("Complete Customer Name.")
[Link]()
ElseIf [Link] = "" Then
Message("Choose One Gender.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Address.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Card No.")
[Link]()
Else
Dim Mess As String
Mess = MsgBox("Do you want to Quick Save?", [Link] +
[Link], "Hotel Management System")
If Mess = vbCancel Then
CName = [Link]
CGender = [Link]
CAddress = [Link]
CPNo = [Link]
CCNo = [Link]
[Link]()
[Link]()
Else
46
[Link] = "Insert into tblCustomer Values(?,?,?,?,?,?,?,?,?,?,?)"
With [Link]
.Add("@CID", [Link]).Value = [Link]
.Add("@CName", [Link]).Value = [Link]
.Add("@Gender", [Link]).Value = [Link]
.Add("@DOB", [Link]).Value = " "
.Add("@Address", [Link]).Value = [Link]
.Add("@City", [Link]).Value = " "
.Add("@State", [Link]).Value = " "
.Add("@Country", [Link]).Value = " "
.Add("@Nationality", [Link]).Value = " "
.Add("@PassNo", [Link]).Value = [Link]
.Add("@CardNo", [Link]).Value = [Link]
End With
[Link]()
[Link]()
Message("Success.")
[Link]()
[Link] = True
[Link] = True
[Link] = True
[Link] = [Link]
[Link]()
End If
[Link] = " New"
PIconButton(4)
End If
End If
End Sub
Private Sub Button1_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Clearcus()
[Link] = True
[Link] = True
[Link]()
[Link] = True
[Link]()
[Link] = " New"
PIconButton(4)
End Sub
Private Sub btnSCustomer_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
If [Link] = "" Then
47
Message("Complete Customer Name to Search.")
[Link]()
Else
[Link] = "Select CusID,Gender,Address,PassportNo,CardNo from
tblCustomer where " & _
"CusName='" & [Link] & "'"
Dr = [Link]
If [Link] = True Then
[Link] = Dr(0)
[Link] = Dr(1)
[Link] = Dr(2)
[Link] = Dr(3)
[Link] = Dr(4)
'Lock Text Box Read Only
[Link] = True
[Link] = True
[Link]()
[Link] = True
[Link]()
[Link] = " New"
PIconButton(4)
Else
Message("Record was Not Found. Please Insert New Customer.")
[Link]()
End If
[Link]()
End If
End Sub
Private Sub btnBooking_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
If [Link] = "" Then
Message("Choose one Customer to Booking.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Number of Staying.")
[Link]()
ElseIf [Link] = "" Then
Message("Choose One Room Number.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Prepaid.")
[Link]()
Else
48
Dim CCus, CusRoom As Int32
CCus = Getid("tblBooking", "ID", "CusID='" & [Link] & "'") - 1
If CCus = 0 Then
CusRoom = Getid("tblBooking", "ID", "RoomNo=" & [Link] & "") - 1
If CRoom = 0 Then
CID = Getid("tblCheckIn", "CheckInNo", "CusID='" & [Link] & "'") - 1
If CID = 0 Then
CRoom = Getid("tblCheckIn", "CheckInNo", "RoomNo=" & [Link] &
"") - 1
If CRoom = 0 Then
Dim CheckID As Integer
CheckID = Getid("tblBooking", "ID")
[Link] = "Insert into tblBooking Values(?,?,?,?,?,?,?)"
With [Link]
.Add("@ChID", [Link]).Value = CheckID
.Add("@DIn", [Link]).Value = [Link]
.Add("@Staying", [Link]).Value = [Link]
.Add("@DOut", [Link]).Value = [Link]
.Add("@CID", [Link]).Value = [Link]
.Add("@RNo", [Link]).Value = [Link]
.Add("@Prepaid", [Link]).Value = [Link]
End With
[Link]()
[Link]()
Message("Success.")
Clearcus()
[Link]()
[Link]()
'[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
Else
Message("Room " & [Link] & " was not free.")
End If
Else
Message("This Customer was staying.")
[Link]()
[Link]()
End If
Else
Message("Room " & [Link] & " was Booked already.")
[Link]()
End If
49
Else
Message("This Customer's Name was Booking already.")
[Link]()
[Link]()
End If
End If
End Sub
Private Sub cboCusName_TextChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
If [Link] = "" Then
Clearcus()
End If
End Sub
End Class
ROOM INFORMATION FORM
Imports [Link]
Public Class frmRoom
Dim Da As New OleDbDataAdapter
Dim Dt As New DataTable
Dim Li As ListViewItem
Dim Ind As Int32
Dim RID As Int32
Private Sub frmRoom_Load(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
'OpenConnect()
50
[Link] = "Select ID,RoomType from tblPrice"
[Link] = Com
[Link] = "Price"
[Link](Dt)
[Link] = Dt
[Link] = [Link](0).ToString
[Link] = [Link](1).ToString
End Sub
Private Sub btnSave_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
If [Link] = "" Then
Message("Complete Room No.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Floor.")
[Link]()
Else
Dim i As Int32
Dim ID As Int32
i = Getid("tblRooms", "ID", "RoomNo=" & [Link] & "") - 1
If i = 0 Then
ID = Getid("tblRooms", "ID")
[Link] = "Insert into tblRooms Values(?,?,?,?)"
With [Link]
.Add("@ID", [Link]).Value = ID
.Add("@RNo", [Link]).Value = [Link]
.Add("@PID", [Link]).Value = [Link]
.Add("@Floor", [Link]).Value = [Link]
End With
[Link]()
[Link]()
Message("Success.")
AddDataToLvw(LstRoom, [Link], [Link],
[Link])
ClearAll(Me)
[Link]()
Else
Message("Room No Already Exists.")
[Link]()
[Link]()
End If
End If
End Sub
51
Private Sub btnShow_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
[Link] = "Select * from QRoom Order by RoomNo"
Dr = [Link]
Do While [Link] = True
AddDataToLvw(LstRoom, Dr(1), Dr(2), Dr(3))
Loop
[Link]()
End Sub
Private Sub btnClose_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
End Sub
Private Sub btnEdit_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim Sl As [Link] = [Link]
If [Link] = "Edit" Then
For Each Li In Sl
Exit For
Next
[Link] = [Link]
[Link] = [Link](1).Text
[Link] = [Link](2).Text
Ind = [Link]
[Link] = "Select ID from tblRooms where RoomNo=" & [Link]
& ""
Dr = [Link]
If [Link] = True Then
RID = Dr(0)
End If
[Link]()
[Link] = "Update"
Else
Li = [Link](Ind)
[Link] = [Link]
[Link](1).Text = [Link]
[Link](2).Text = [Link]
[Link] = "Update tblRooms set RoomNo=?,PID=?,Floor=? where
ID=?"
With [Link]
.Add("@RNo", [Link]).Value = [Link]
.Add("@PID", [Link]).Value = [Link]
52
.Add("@Floor", [Link]).Value = [Link]
.Add("@ID", [Link]).Value = RID
End With
[Link]()
[Link]()
Message("Success.")
ClearAll(Me)
[Link] = -1
[Link]()
[Link] = "Edit"
End If
End Sub
Private Sub btnDelete_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim Sl As [Link] = [Link]
Dim Str As String
Str = MsgBox("Do you want to Delete this Record?", [Link]
+ [Link], "Hotel Management System")
If Str = vbOK Then
For Each Li In Sl
Exit For
Next
[Link] = "Delete from tblRooms where RoomNo=" & [Link] &
""
[Link]()
[Link](Li)
Message("Success.")
End If
End Sub
Private Sub btnCancel_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
ClearAll(Me)
[Link] = -1
[Link]()
[Link] = "Edit"
End Sub
Private Sub EditToolStripMenuItem_Click(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
Dim Sl As [Link] = [Link]
For Each Li In Sl
Exit For
Next
53
[Link] = [Link]
[Link] = [Link](1).Text
[Link] = [Link](2).Text
Ind = [Link]
[Link] = "Select ID from tblRooms where RoomNo=" & [Link]
& ""
Dr = [Link]
If [Link] = True Then
RID = Dr(0)
End If
[Link]()
[Link] = "Update"
End Sub
Private Sub DeleteToolStripMenuItem_Click(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
btnDelete_Click(sender, e)
End Sub
End Class
SEARCH CHECK IN FORM
Public Class fOption
Private Sub fOption_Load(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link] = True
'OpenConnect()
End Sub
Private Sub OptRNum_CheckedChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
If [Link] = True Then
[Link] = True
[Link]()
[Link]()
54
[Link] = False
Else
[Link] = False
[Link] = True
End If
End Sub
Private Sub OptCusName_CheckedChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
If [Link] = True Then
[Link] = False
[Link] = True
[Link]()
[Link]()
Else
[Link] = True
[Link]()
[Link] = False
End If
End Sub
Private Sub btnOK_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
If [Link] = True Then
If [Link] = "" Then
Message("Input Room No to Check Out.")
[Link]()
Else
ExcSQL(" RoomNo = " & [Link] & "", "This Room has not
Customer.")
[Link]()
[Link]()
End If
Else
If [Link] = "" Then
Message("Input Customer Name to Check Out.")
[Link]()
Else
ExcSQL("CusName='" & [Link] & "'", "This Customer Name was
not Found.")
[Link]()
[Link]()
End If
End If
End Sub
55
Sub ExcSQL(ByVal Cond As String, ByVal Mess As String)
[Link] = "Select * from QCheckIn where " & Cond
Dr = [Link]
If [Link] = True Then
With fCheckOut
.[Link] = Dr(0)
.[Link] = Dr(1)
.[Link] = Dr(2)
.[Link] = Dr(3)
.[Link] = Dr(4)
.[Link] = Dr(5)
.[Link] = Format(Dr(6), "dddd, MMMM dd,yyyy")
.[Link] = Format(Now, "dddd, MMMM dd,yyyy")
.[Link] = Dr(8)
.[Link] = Dr(9)
.[Link] = Dr(10)
.[Link] = Dr(11)
.[Link] = Format(Dr(12), "Currency")
.[Link] = Format(Dr(13), "Currency")
.[Link] = Format(Dr(14), "Currency")
End With
Else
Message(Mess)
End If
[Link]()
End Sub
Private Sub txtRNum_KeyPress(ByVal sender As Object, ByVal e As
[Link]) Handles [Link]
If Asc([Link]) = 13 Then
btnOK_Click(sender, e)
End If
End Sub
Private Sub txtCusName_KeyPress(ByVal sender As Object, ByVal e As
[Link]) Handles [Link]
If Asc([Link]) = 13 Then
btnOK_Click(sender, e)
End If
End Sub
End Class
56
CHANGE USERNAME/PASSWORD FORM
Public Class fChangeUser
Dim Li As ListViewItem
Dim ind As Int32
Private Sub fChangeUser_Load(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link] = "Select UserName from tblUser"
Dr = [Link]
Do While [Link] = True
[Link](Decrypt(Dr(0)), 2)
Loop
[Link]()
[Link] = True
End Sub
Private Sub LstUser_DoubleClick(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim Sl As [Link] = [Link]
For Each Li In Sl
Exit For
Next
[Link] = "Select * from tblUser where UserName='" &
Encrypt([Link]) & "'"
Dr = [Link]
If [Link] = True Then
[Link] = True
UserID = Dr(0)
[Link] = Dr(1)
[Link] = Dr(2)
If [Link] = "Admin" Then
[Link] = False
57
Else
[Link] = True
End If
[Link] = Decrypt(Dr(3))
[Link] = Decrypt(Dr(4))
[Link] = [Link]
[Link] = Dr(5)
ind = [Link]
End If
[Link]()
End Sub
Private Sub btnChange_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
If [Link] = "" Then
Message("Complete First Name.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Last Name.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete User Name.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Password.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Confirm Password.")
[Link]()
ElseIf [Link] = "" Then
Message("Choose One Permission.")
[Link]()
Else
If [Link] <> [Link] Then
Message("User Password and Confirm Password are not the same." & vbCrLf
& "Please, Check Again.")
[Link]()
[Link]()
Else
[Link] = "Update tblUser Set
FName=?,LName=?,UserName=?,Pass=?,Permission=? where ID=?"
[Link]("@FN", [Link]).Value =
[Link]
[Link]("@LN", [Link]).Value =
[Link]
58
[Link]("@UN", [Link]).Value =
Encrypt([Link])
[Link]("@Pass", [Link]).Value =
Encrypt([Link])
[Link]("@Per", [Link]).Value =
[Link]
[Link]("@ID", [Link]).Value = UserID
[Link]()
[Link]()
Message("Success.")
Li = [Link](ind)
[Link] = [Link]
ClearEnable()
End If
End If
End Sub
Private Sub btnDelete_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim Mess As String
Mess = MsgBox("Do you to delete this User.", [Link] +
[Link], "Hotel Management System")
If Mess = vbOK Then
Dim Sl As [Link] = [Link]
For Each Li In Sl
Exit For
Next
If [Link] <> "Admin" Then
[Link] = "Delete from tblUser where ID=" & UserID & ""
[Link]()
Message("Success.")
[Link](Li)
ClearEnable()
Else
Message("Cannot Delete System User.")
End If
End If
End Sub
Sub ClearEnable()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
59
[Link] = False
[Link] = -1
End Sub
Private Sub btnClose_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
End Sub
End Class
CUSTOMER CHECK OUT FORM
Imports [Link]
Public Class fCheckOut
Private Sub btnClose_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
End Sub
Private Sub txtPrepaid_LostFocus(ByVal sender As Object, ByVal e As
[Link]) Handles [Link]
PrepaidLostFocus(txtPrepaid, txtTotal)
End Sub
Private Sub txtPrepaid_TextChanged(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
If [Link] <> "" Then
[Link] = Format([Link], "Currency") - Format([Link],
"Currency")
[Link] = Format([Link], "Currency")
End If
60
End Sub
Private Sub btnSearch_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
End Sub
Private Sub btnCheckOut_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
If [Link] <> "" Then
If CInt([Link]) = CInt([Link]) Then
Dim CheckID As Integer
CheckID = Getid("tblCheckOut", "CheckOutNo")
[Link] = "Insert into tblCheckOut Values(?,?,?,?,?,?,?)"
With [Link]
.Add("@ChID", [Link]).Value = CheckID
.Add("@DIn", [Link]).Value = [Link]
.Add("@DOut", [Link]).Value = [Link]
.Add("@CID", [Link]).Value = [Link]
.Add("@RNo", [Link]).Value = [Link]
.Add("@Prepaid", [Link]).Value = [Link]
.Add("@Staying", [Link]).Value = [Link]
End With
[Link]()
[Link]()
Message("Success.")
[Link] = "Delete from tblCheckIn where CusID='" &
[Link] & "'"
[Link]()
ClearAll()
[Link]()
Else
Message("Customer's Payment is not in Balance." & vbCrLf & "Customer's
Check Out Not Success." & vbCrLf & "Please Check Prepaid Again.")
[Link]()
[Link]()
End If
Else
Message("Complete All Information to Check Out Customer.")
[Link]()
End If
End Sub
Sub ClearAll()
61
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
End Sub
End Class
CHANGE BOOKING FORM
Imports [Link]
Public Class fEditBooking
Private Sub fEditBooking_Load(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
'OpenConnect()
LoadRoomType(cboRType)
End Sub
62
Private Sub cboRType_SelectedIndexChanged(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
LoadRoomNum(cboRNum, cboRType, txtAmount, txtFloor, txtStaying,
txtTotal)
End Sub
Private Sub btnClose_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
End Sub
Private Sub txtStaying_TextChanged(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
[Link] = Val([Link]) * Format([Link], "currency")
[Link] = Format([Link], "Currency")
End Sub
Private Sub txtPrepaid_LostFocus(ByVal sender As Object, ByVal e As
[Link]) Handles [Link]
PrepaidLostFocus(txtPrepaid, txtTotal)
End Sub
Private Sub txtPrepaid_TextChanged(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
If [Link] <> "" Then
[Link] = Format([Link], "Currency") - Format([Link],
"Currency")
[Link] = Format([Link], "Currency")
End If
End Sub
Private Sub btnSCustomer_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
SCustomer(cboCusName, txtCusID, txtGender, txtAddress, txtPassNo,
txtCardNo)
End Sub
Private Sub cboRNum_SelectedIndexChanged(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
LoadFloor(cboRNum, txtFloor)
End Sub
63
Private Sub cboCusName_KeyPress(ByVal sender As Object, ByVal e As
[Link]) Handles [Link]
If Asc([Link]) = 13 Then
btnSCustomer_Click(sender, e)
End If
End Sub
Private Sub btnUpdate_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
If [Link] = "" Then
Message("Choose one Customer to Booking.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Number of Staying.")
[Link]()
ElseIf [Link] = "" Then
Message("Choose One Room Number.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Prepaid.")
[Link]()
Else
[Link] = "Update TblBooking set
BookingDate=?,Staying=?,CheckInDate=?,CusID=?," & _
"RoomNo=?,Prepaid=? where ID=?"
With [Link]
.Add("@DIn", [Link]).Value = [Link]
.Add("@Staying", [Link]).Value = [Link]
.Add("@DOut", [Link]).Value = [Link]
.Add("@CID", [Link]).Value = [Link]
.Add("@RNo", [Link]).Value = [Link]
.Add("@Prepaid", [Link]).Value = [Link]
.Add("@ID", [Link]).Value = BID
End With
[Link]()
[Link]()
Message("Success.")
Clearcus()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
End If
64
End Sub
Sub Clearcus()
[Link] = ""
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
End Sub
Private Sub cboCusName_TextChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
If [Link] = "" Then
Clearcus()
End If
End Sub
End Class
CHANGE CHECK IN FORM
Imports [Link]
Public Class fEditCheckIn
Sub Clearcus()
[Link] = ""
[Link]()
[Link]()
[Link]()
[Link]()
65
[Link]()
End Sub
Private Sub fEditCheckIn_Load(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
LoadRoomType(cboRType)
End Sub
Private Sub btnSCustomer_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
SCustomer(cboCusName, txtCusID, txtGender, txtAddress, txtPassNo,
txtCardNo)
End Sub
Private Sub cboCusName_KeyPress(ByVal sender As [Link], ByVal e
As [Link]) Handles
[Link]
If Asc([Link]) = 13 Then
btnSCustomer_Click(sender, e)
End If
End Sub
Private Sub txtStaying_TextChanged(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
[Link] = Format(DateAdd([Link], Val([Link]),
CDate([Link])), "dddd, MMMM dd, yyyy")
[Link] = Val([Link]) * Format([Link], "currency")
[Link] = Format([Link], "Currency")
End Sub
Private Sub cboRType_SelectedIndexChanged(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
LoadRoomNum(cboRNum, cboRType, txtAmount, txtFloor, txtStaying,
txtTotal)
End Sub
Private Sub cboRNum_SelectedIndexChanged(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
LoadFloor(cboRNum, txtFloor)
End Sub
66
Private Sub btnClose_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
End Sub
Private Sub txtPrepaid_LostFocus(ByVal sender As Object, ByVal e As
[Link]) Handles [Link]
PrepaidLostFocus(txtPrepaid, txtTotal)
End Sub
Private Sub txtPrepaid_TextChanged(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
If [Link] <> "" Then
[Link] = Format([Link], "Currency") - Format([Link],
"Currency")
[Link] = Format([Link], "Currency")
End If
End Sub
Private Sub btnUpdate_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
If [Link] = "" Then
Message("Choose one Customer to Booking.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Number of Staying.")
[Link]()
ElseIf [Link] = "" Then
Message("Choose One Room Number.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Prepaid.")
[Link]()
Else
[Link] = "Update TblCheckIn set
CheckInDate=?,CheckOutDate=?,CusID=?," & _
"RoomNo=?,Prepaid=? where CheckInNo=?"
With [Link]
.Add("@DIn", [Link]).Value = [Link]
.Add("@DOut", [Link]).Value = [Link]
.Add("@CID", [Link]).Value = [Link]
.Add("@RNo", [Link]).Value = [Link]
.Add("@Prepaid", [Link]).Value = [Link]
.Add("@ID", [Link]).Value = BID
End With
67
[Link]()
[Link]()
Message("Success.")
Clearcus()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
End If
End Sub
Private Sub DTCheckIn_ValueChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
txtStaying_TextChanged(sender, e)
End Sub
Private Sub cboCusName_TextChanged(ByVal sender As Object, ByVal e As
[Link]) Handles [Link]
If [Link] = "" Then
Clearcus()
End If
End Sub
End Class
68
CUSTOMER EXPIRE FORM
Public Class fExpire
Dim Li As ListViewItem
Private Sub Timer1_Tick(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link] = Not [Link]
End Sub
Private Sub Timer2_Tick(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim L As Boolean = False
Dim L1 As Boolean = False
[Link]()
[Link]()
[Link] = "Select * from QCheckIn where CheckOutDate<=#" &
DateAdd([Link], 1, Today) & "#"
Dr = [Link]
Do While [Link] = True
AddDataToLvw(lstCheckInExpire, Dr(0), Dr(1), Dr(2), Dr(3), Dr(4), Dr(5),
Format(Dr(6), "dddd, MMMM dd," & _
"yyyy"), Dr(8), Format(Dr(7), "dddd, MMMM dd,yyyy"), Dr(9), Dr(10),
Dr(11), Format(Dr(12), "Curren" & _
"cy"), Format(Dr(13), "Currency"), Format(Dr(14), "Currency"),
Format(Dr(15), "currency"))
L = True
Loop
69
[Link]()
'Load Data For Booking Expire
[Link]()
[Link] = "Select * from QBooking where CheckInDate<=#" &
DateAdd([Link], 1, Today) & "#"
Dr = [Link]
Do While [Link] = True
AddDataToLvw(lstBookingExpire, Dr(0), Dr(1), Dr(2), Dr(3), Dr(4), Dr(5),
Format(Dr(6), "dddd, MMMM dd,yyy" & _
"y"), Dr(7), Format(Dr(8), "dddd, MMMM dd,yyyy"), Dr(9), Dr(10), Dr(11),
Format(Dr(12), "Currenc" & _
"y"), Format(Dr(13), "Currency"), Format(Dr(14), "Currency"), Format(Dr(15),
"currency"))
L1 = True
Loop
[Link]()
If L = True Or L1 = True Then
ShowForm(Me, Main)
End If
End Sub
Private Sub btnHide_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link] = True
[Link] = 100000
[Link]()
End Sub
Private Sub fExpire_Load(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link] = False
End Sub
Private Sub CheckInToolStripMenuItem1_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
Dim Sl As [Link] =
[Link]
For Each Li In Sl
Exit For
Next
[Link]()
[Link] = True
70
[Link] = 100000
ShowForm(fCheckOut, Main)
With fCheckOut
.[Link] = [Link]
.[Link] = [Link](1).Text
.[Link] = [Link](2).Text
.[Link] = [Link](3).Text
.[Link] = [Link](4).Text
.[Link] = [Link](5).Text
.[Link] = [Link](6).Text
.[Link] = Format(Now, "dddd, MMMM dd,yyyy")
.[Link] = [Link](7).Text
.[Link] = [Link](9).Text
.[Link] = [Link](10).Text
.[Link] = [Link](11).Text
.[Link] = [Link](12).Text
.[Link] = [Link](13).Text
.[Link] = [Link](14).Text
End With
End Sub
Private Sub ToolStripMenuItem1_Click(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
Dim Sl As [Link] =
[Link]
For Each Li In Sl
Exit For
Next
[Link] = "Select ID from tblBooking where CusID='" & [Link]
& "'"
Dr = [Link]
If [Link] = True Then
BID = Dr(0)
End If
[Link]()
i=1
[Link]()
[Link] = True
[Link] = 100000
'[Link]()
ShowForm(frmCheckIn, Main)
[Link] = False
[Link]()
With frmCheckIn
.[Link] = [Link]
71
.[Link] = [Link](1).Text
.[Link] = [Link](2).Text
.[Link] = [Link](3).Text
.[Link] = [Link](4).Text
.[Link] = [Link](5).Text
.[Link] = [Link](8).Text
.[Link] = [Link](7).Text
.[Link] = [Link](9).Text
.[Link] = [Link](10).Text
.[Link] = [Link](11).Text
.[Link] = [Link](12).Text
.[Link] = [Link](14).Text
End With
End Sub
End Class
BOOKING PREVIEW FORM
Public Class fRptBooking
Private Sub btnPreview_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
End Sub
Private Sub OptFrom_CheckedChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
If [Link] = True Then
[Link] = True
[Link] = True
Else
[Link] = False
[Link] = False
End If
72
End Sub
Private Sub fRptBooking_Load(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link] = True
[Link] = Format(Now, "dd-MMM-yyyy")
End Sub
End Class
CHECK IN PREVIEW FORM
Public Class fRptCheckIn
Private Sub fRptCheckIn_Load(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link] = True
[Link] = Format(Now, "dd-MMM-yyyy")
End Sub
Private Sub btnPreview_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
End Sub
Private Sub OptFrom_CheckedChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
If [Link] = True Then
[Link] = True
[Link] = True
Else
[Link] = False
[Link] = False
End If
End Sub
73
End Class
CHECK OUT PREVIEW FORM
Public Class fRptCheckOut
Private Sub fRptCheckOut_Load(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link] = True
[Link] = Format(Now, "dd-MMM-yyyy")
End Sub
Private Sub btnPreview_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
End Sub
Private Sub OptFrom_CheckedChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
If [Link] = True Then
[Link] = True
[Link] = True
Else
[Link] = False
[Link] = False
End If
End Sub
End Class
74
BOOK SEARCHING FORM
Public Class fSearchBooking
Dim Li As ListViewItem
'Public i As Int16
Private Sub fSearchBooking_Load(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
'OpenConnect()
[Link] = True
[Link] = False
End Sub
Private Sub btnShowAll_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
[Link] = "Select * from QBooking"
Dr = [Link]
75
Do While [Link] = True
AddDataToLvw(lstBooking, Dr(0), Dr(1), Dr(2), Dr(3), Dr(4), Dr(5),
Format(Dr(6), "dddd, MMMM dd,yyy" & _
"y"), Dr(7), Format(Dr(8), "dddd, MMMM dd,yyyy"), Dr(9), Dr(10), Dr(11),
Format(Dr(12), "Currenc" & _
"y"), Format(Dr(13), "Currency"), Format(Dr(14), "Currency"), Format(Dr(15),
"currency"))
Loop
[Link]()
End Sub
Private Sub btnSearch_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
If [Link] = True And [Link] = True Then
SQLSearch("CusName='" & [Link] & "' and BookingDate=#" &
CDate([Link]) & "#")
ElseIf [Link] = True Then
SQLSearch("CusName='" & [Link] & "'")
ElseIf [Link] = True Then
SQLSearch("BookingDate=#" & CDate([Link]) & "#")
Else
Message("Choose One Option.")
End If
End Sub
Sub SQLSearch(ByVal Str As String)
Dim L As Boolean = False
[Link] = "Select * from QBooking where " & Str
Dr = [Link]
Do While [Link] = True
AddDataToLvw(lstBooking, Dr(0), Dr(1), Dr(2), Dr(3), Dr(4), Dr(5),
Format(Dr(6), "dddd, MMMM dd, yyyy"), Dr(7), Format(Dr(8), "dddd,
MMMM dd, yyyy"), Dr(9), Dr(10), Dr(11), Format(Dr(12), "Currency"),
Format(Dr(13), "Currency"), Format(Dr(14), "Currency"), Format(Dr(15),
"Currency"))
L = True
Loop
If L = False Then
Message("Record Was Not Found.")
End If
[Link]()
End Sub
76
Private Sub ChkCustID_CheckedChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
If [Link] = True Then
[Link] = True
[Link]()
Else
[Link] = False
End If
End Sub
Private Sub ChkBooking_CheckedChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
If [Link] = True Then
[Link] = True
Else
[Link] = False
End If
End Sub
Private Sub MCheckIn_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim Sl As [Link] =
[Link]
For Each Li In Sl
Exit For
Next
[Link] = "Select ID from tblBooking where CusID='" & [Link]
& "'"
Dr = [Link]
If [Link] = True Then
BID = Dr(0)
End If
[Link]()
i=1
[Link]()
'[Link]()
ShowForm(frmCheckIn, Main)
[Link] = False
[Link]()
With frmCheckIn
.[Link] = [Link]
.[Link] = [Link](1).Text
.[Link] = [Link](2).Text
.[Link] = [Link](3).Text
77
.[Link] = [Link](4).Text
.[Link] = [Link](5).Text
.[Link] = [Link](8).Text
.[Link] = [Link](7).Text
.[Link] = [Link](9).Text
.[Link] = [Link](10).Text
.[Link] = [Link](11).Text
.[Link] = [Link](12).Text
.[Link] = [Link](14).Text
End With
End Sub
Private Sub MEdit_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim Sl As [Link] =
[Link]
.[Link] = [Link](10).Text
.[Link] = [Link](11).Text
.[Link] = [Link](12).Text
.[Link] = [Link](14).Text
End With
End Sub
Private Sub MDelete_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim Sl As [Link] =
[Link]
For Each Li In Sl
Exit For
Next
Dim Mess As String
Mess = MsgBox("Do you want to Delete this Record.",
[Link] + [Link], "Hotel Management
System")
If Mess = vbOK Then
[Link] = "Delete from tblBooking where CusID='" & [Link] &
"'"
[Link]()
Message("Success.")
[Link](Li)
End If
End Sub
End Class
78
CHECK IN SEARCHING FORM
Public Class fSearchCheckIn
Dim Li As ListViewItem
Private Sub fSearchCheckIn_Load(ByVal sender As [Link], ByVal e
As [Link]) Handles [Link]
'OpenConnect()
[Link] = False
[Link] = True
[Link]()
[Link] = False
End Sub
Private Sub ChkCustName_CheckedChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
If [Link] = True Then
[Link] = True
[Link]()
Else
[Link] = False
End If
End Sub
Private Sub ChkCheckIn_CheckedChanged(ByVal sender As [Link],
ByVal e As [Link]) Handles [Link]
If [Link] = True Then
[Link] = True
Else
[Link] = False
79
End If
End Sub
Private Sub btnShowAll_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
[Link] = "Select * from QCheckIn"
Dr = [Link]
Do While [Link] = True
AddDataToLvw(lstCheckIn, Dr(0), Dr(1), Dr(2), Dr(3), Dr(4), Dr(5),
Format(Dr(6), "dddd, MMMM dd," & _
"yyyy"), Dr(8), Format(Dr(7), "dddd, MMMM dd,yyyy"), Dr(9), Dr(10),
Dr(11), Format(Dr(12), "Curren" & _
"cy"), Format(Dr(13), "Currency"), Format(Dr(14), "Currency"),
Format(Dr(15), "currency"))
Loop
[Link]()
End Sub
Private Sub btnSearch_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
[Link]()
If [Link] = True And [Link] = True Then
SQLSearch("CusName='" & [Link] & "' and CheckInDate=#" &
CDate([Link]) & "#")
ElseIf [Link] = True Then
SQLSearch("CusName='" & [Link] & "'")
ElseIf [Link] = True Then
SQLSearch("CheckInDate=#" & CDate([Link]) & "#")
Else
Message("Choose One Option.")
End If
End Sub
Sub SQLSearch(ByVal Str As String)
Dim L As Boolean = False
[Link] = "Select * from QCheckIn where " & Str
Dr = [Link]
Do While [Link] = True
AddDataToLvw(lstCheckIn, Dr(0), Dr(1), Dr(2), Dr(3), Dr(4), Dr(5),
Format(Dr(6), "dddd, MMMM dd, yyyy"), Dr(8), Format(Dr(7), "dddd,
MMMM dd, yyyy"), Dr(9), Dr(10), Dr(11), Format(Dr(12), "Currency"),
Format(Dr(13), "Currency"), Format(Dr(14), "Currency"), Format(Dr(15),
"Currency"))
80
L = True
Loop
If L = False Then
Message("Record Was Not Found.")
End If
[Link]()
End Sub
Private Sub MEdit_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
Dim Sl As [Link] =
[Link]
For Each Li In Sl
Exit For
Next
[Link] = "Select CheckInNo from tblCheckIn where CusID='" &
[Link] & "'"
Dr = [Link]
If [Link] = True Then
BID = Dr(0)
End If
[Link]()
[Link]()
ShowForm(fEditCheckIn, Main)
With fEditCheckIn
.[Link] = [Link]
.[Link] = [Link](1).Text
.[Link] = [Link](2).Text
.[Link] = [Link](3).Text
.[Link] = [Link](4).Text
.[Link] = [Link](5).Text
.[Link] = [Link](6).Text
'.[Link] = [Link](6).Text
.[Link] = [Link](7).Text
.[Link] = [Link](9).Text
.[Link] = [Link](10).Text
.[Link] = [Link](11).Text
.[Link] = [Link](12).Text
.[Link] = [Link](14).Text
End With
End Sub
Private Sub MDelete_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
81
Dim Sl As [Link] =
[Link]
For Each Li In Sl
Exit For
Next
Dim Mess As String
Mess = MsgBox("Do you want to Delete this Record.",
[Link] + [Link], "Hotel Management
System")
If Mess = vbOK Then
[Link] = "Delete from tblCheckIn where CusID='" & [Link] &
"'"
[Link]()
Message("Success.")
[Link](Li)
End If
End Sub
Private Sub CheckOutToolStripMenuItem_Click(ByVal sender As
[Link], ByVal e As [Link]) Handles
[Link]
Dim Sl As [Link] =
[Link]
For Each Li In Sl
Exit For
Next
[Link]()
ShowForm(fCheckOut, Main)
With fCheckOut
.[Link] = [Link]
.[Link] = [Link](1).Text
.[Link] = [Link](2).Text
.[Link] = [Link](3).Text
.[Link] = [Link](4).Text
.[Link] = [Link](5).Text
.[Link] = [Link](6).Text
.[Link] = Format(Now, "dddd, MMMM dd,yyyy")
.[Link] = [Link](7).Text
.[Link] = [Link](9).Text
.[Link] = [Link](10).Text
.[Link] = [Link](11).Text
.[Link] = [Link](12).Text
.[Link] = [Link](13).Text
.[Link] = [Link](14).Text
End With
82
End Sub
End Class
SET UP USER FORM
Public Class fUser
Private Sub btnSet_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
If [Link] = "" Then
Message("Complete First Name.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Last Name.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete User Name.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Password.")
[Link]()
ElseIf [Link] = "" Then
Message("Complete Confirm Password.")
[Link]()
ElseIf [Link] = "" Then
Message("Choose One Permission.")
[Link]()
Else
If [Link] <> [Link] Then
Message("User Password and Confirm Password are not the same." & vbCrLf
& "Please, Check Again.")
[Link]()
[Link]()
83
Else
Dim Check As Int32
Check = Getid("tblUser", "ID", "UserName='" & Encrypt([Link]) &
"'") - 1
If Check = 0 Then
Dim ID As Int32
ID = Getid("tblUser", "ID")
[Link] = "Insert into tblUser Values(?,?,?,?,?,?)"
[Link]("@ID", [Link]).Value = ID
[Link]("@FName", [Link]).Value =
[Link]
[Link]("@LName", [Link]).Value =
[Link]
[Link]("@UName", [Link]).Value =
Encrypt([Link])
[Link]("@Pass", [Link]).Value =
Encrypt([Link])
[Link]("@Pess", [Link]).Value =
[Link]
[Link]()
[Link]()
Message("Success.")
ClearAll(Me)
[Link] = -1
[Link]()
Else
Message("User Name has already.")
[Link]()
[Link]()
End If
End If
End If
End Sub
End Class
MODULE CONNECTIVITY 1
Imports [Link]
Module Module1
Public Cnn As New OleDbConnection
Public Com As New OleDbCommand
Public Dr As OleDbDataReader
Public CusSearch As String 'Search Customer
Public Sub OpenConnect()
84
Try
[Link] = "Provider=[Link].4.0;" & _
"Data Source=" & [Link] & "\[Link]"
[Link]()
[Link] = Cnn
[Link] = [Link]
Catch ex As Exception
MsgBox([Link])
End Try
End Sub
Public Sub Message(ByVal Mess As String)
MsgBox(Mess, [Link], "Hotel Management System")
End Sub
Public Function Getid(ByVal tablename As String, ByVal fieldname As String,
Optional ByVal cond As String = "") As Double
Try
Dim com1 As New OleDbCommand
Dim dr1 As OleDbDataReader
[Link] = Cnn
[Link] = "select top 1 " & fieldname & " from " & tablename &
IIf(cond <> "", " where " & cond, "") & " order by 1 desc"
dr1 = [Link]
If [Link] = True Then
Getid = dr1(0) + 1
Else
Getid = 1
End If
[Link]()
Catch ex As Exception
MsgBox([Link])
End Try
End Function
Public Sub ClearAll(ByVal frm As Form)
Dim Crt As Control
For Each Crt In [Link]
If TypeOf Crt Is TextBox Then
[Link] = ""
End If
Next
End Sub
85
Public Sub AddDataToLvw(ByVal Lvw As ListView, ByVal ParamArray
Data() As Object)
Dim LItem As ListViewItem
LItem = [Link](Data(0), 0)
Dim i As Int16
For i = 1 To UBound(Data)
[Link](i).Text = Data(i)
Next
End Sub
Public Sub ShowForm(ByVal frm As Form, ByVal frm1 As Form)
Dim L, M As Int32
L = ([Link] - [Link]) / 2
M = ([Link] - [Link]) / 2
[Link] = frm1
If [Link] = True Then
[Link]()
Else
[Link]()
[Link](L, M, [Link], [Link])
End If
End Sub
Function AutoID(ByVal Tablename As String, ByVal Fieldname As String) As
Int32
Dim cmd As New OleDbCommand
Dim dr1 As OleDbDataReader
[Link] = Cnn
[Link] = [Link]
[Link] = "select top 1 " & Fieldname & " from " & Tablename & "
Order by 1 Desc "
dr1 = [Link]
If [Link] = True Then
AutoID = [Link](dr1(0), 4) + 1
Else
AutoID = 1
End If
[Link]()
End Function
End Module
MODULE CONNECTIVITY 2
Module Module2
Public CuID, CName, CGender, CAddress, CPNo, CCNo As String
86
Public UserID As Int32 'Get ID from tblUser
Public BID As Int32
Public i As Int16
Public M As Byte
Function Encrypt(ByVal SText As String) As String
Dim S As String = ""
Dim S1 As String = ""
Dim i As Integer
For i = 1 To Len(SText)
S = S & Chr(Asc(Mid(SText, i, 1)) + 10)
Next
S = StrReverse(S)
For i = 1 To Len(S)
S1 = S1 & Mid(S, i, 1) & "@"
Next
Encrypt = S1
End Function
Function Decrypt(ByVal SText As String) As String
Dim S As String = ""
Dim S1 As String = ""
Dim i As Integer
For i = 1 To Len(SText)
If Mid(SText, i, 1) <> "@" Then
S1 = S1 & Mid(SText, i, 1)
End If
Next
S1 = StrReverse(S1)
For i = 1 To Len(S1)
S = S & Chr(Asc(Mid(S1, i, 1)) - 10)
Next
Decrypt = S
End Function
Public Sub CheckInMenu()
ShowForm(frmCheckIn, Main)
[Link] = False
[Link] = True
[Link] = "CheckIn Date:"
[Link] = "CheckOut Date:"
[Link]()
End Sub
87
Public Sub BookingMenu()
ShowForm(frmCheckIn, Main)
[Link] = False
[Link] = True
[Link] = "Booking Date:"
[Link] = " CheckIn Date:"
[Link]()
End Sub
End Module
MODULE CONNECTIVITY 3
Imports [Link]
Module Module3
Dim Da As New OleDbDataAdapter
Dim Dt, Dt1, Dt2 As New DataTable
Public Sub LoadRoomType(ByVal cbo As ComboBox)
[Link]()
' Load Data into cboRoomType
[Link] = "Select ID,RoomType from tblPrice"
[Link] = Com
[Link](Dt1)
[Link] = "Price"
[Link] = Dt1
[Link] = [Link](0).ToString
[Link] = [Link](1).ToString
End Sub
Public Sub LoadRoomNum(ByVal cbo As ComboBox, ByVal cbo1 As
ComboBox, ByVal txt As TextBox, ByVal txt1 As TextBox, ByVal txt2 As
TextBox, ByVal txt3 As TextBox)
[Link]()
[Link] = "Select RoomNo,UnitPrice from QRoom where
RoomType='" & [Link] & "'"
Dr = [Link]
Do While [Link] = True
[Link](Dr(0))
[Link] = Format(Dr(1), "Currency")
Loop
[Link]()
[Link]()
'Calculate Total
If [Link] <> "" Then
[Link] = Val([Link]) * Format([Link], "currency")
88
[Link] = Format([Link], "Currency")
End If
End Sub
Public Sub SCustomer(ByVal cbo As ComboBox, ByVal txt As TextBox,
ByVal txt1 As TextBox, ByVal txt2 As TextBox, ByVal txt3 As TextBox,
ByVal txt4 As TextBox)
If [Link] = "" Then
Message("Complete Customer Name to Search.")
[Link]()
Else
[Link] = "Select CusID,Gender,Address,PassportNo,CardNo from
tblCustomer where " & _
"CusName='" & [Link] & "'"
Dr = [Link]
If [Link] = True Then
[Link] = Dr(0)
[Link] = Dr(1)
[Link] = Dr(2)
[Link] = Dr(3)
[Link] = Dr(4)
'Lock Text Box Read Only
[Link] = True
[Link] = True
[Link] = True
[Link]()
Else
Message("Record was Not Found.")
[Link]()
End If
[Link]()
End If
End Sub
Public Sub PrepaidLostFocus(ByVal txt As TextBox, ByVal txt1 As TextBox)
[Link] = Format([Link], "Currency")
If [Link] <> "" Then
If CInt([Link]) > CInt([Link]) Then
Message("Prepaid bigger than Total.")
[Link]()
[Link]()
End If
End If
89
End Sub
Public Sub LoadFloor(ByVal cbo As ComboBox, ByVal txt As TextBox)
[Link] = "Select Floor from QRoom where RoomNo=" &
[Link] & ""
Dr = [Link]
If [Link] = True Then
[Link] = Dr(0)
End If
[Link]()
End Sub
End Module
TESTING
Software testing is the process of executing software and comparing the observed
behavior to the desired behavior. Software testing is a critical element of software
quality assurance and represents the ultimate review of specification, design and code
generation. The increasing visibility of software as a system element and the attendant
‘costs’ associated with a software failure are motivating forces for well planned
through testing. The software must be tested to uncover as many errors as possible
before delivery to the customer.
The software testing techniques provide systematic guidance for designing tests that:
1) Exercise the internal logic of the software components
2) Exercise the input and output domain of the program to uncover errors In the
Program function, behavior and performance.
90
Testing is the phase where the errors remaining from all the pervious phases must be
detected. It is a critical element of the software assurances and represents the ultimate
review of specification, design and coding.
Testing Objective
Certain rules that we take as testing objectives are:
1) Testing is a process of executing a program with the intent of finding an error.
2) A good test case is one that has a high probability of finding an as-yet-
undiscovered error.
3) A successful test is one that uncovers as-yet-undiscovered error.
Software testing is of two types-
1) White Box Testing – knowledge of the internal working of the item being
tested are used to select the test data. Concerned with the internal operations of the
software system.
Various criteria of white box testing are-
a) Statement Coverage criteria
b) Edge Coverage Criteria
c) Path Coverage Criteria
d) Control structure Testing Criteria
2) Black Box testing- complementary approach to white box testing
technique which is performed at later stages in the testing. Focuses on the functional
requirements of the software, for which a set of inputs are provided to fully exercise
these functional requirements and to achieve the desired results.
Various techniques of black box testing are –
a) graph based testing method
b) Equivalence Partitioning and Boundary value Analysis
c) Cause – Effect Graphing
d) Comparison Testing
91
UNIT TESTING-
In this project two kinds of testing were performed: Unit testing and integration
testing. Unit testing begins at the base of the software as implemented in the spiral,
and concentrates on each unit of the software as implemented in the source. It forces
verification effort on the smallest unit of software component or module. Using the
component level design description as a guide important control paths are tested to
uncover errors within the boundary of the module.
INTEGRATION TESTING-
Testing progresses by moving outward along the spiral to integration testing where the
focus is on design and the consideration of software architecture to be tested. It
involves building the system and resultant system for problems that arise from
component interactions. This integration is planned and coordinated so that when a
failure occurs, we have some idea of what caused it. It is a systematic technique for
constructing the program structure while at the same time conducting tests to uncover
errors associated with interfacing.
System Implementation&Evaluation
System Implementation:-
This phase encompasses all the organizational technical aspects of successful
implementation form the end user acceptance to data access system implementation is
primary concern with user training. These following activities are undertaken in the
implementation phase:
1. Training to the user.
2. System changes over.
3. Test data supplied to the user for hands on exposure to the system.
4. Helping and guiding user until the implementation is satisfactory and the
user develop confidence in the system.
System Evaluation:-
Evaluation of the system is performed to identify its strength & weaknesses. The
actual evaluation can occur along any of the following dimensions.
92
Operational evaluation:
Identifications & measurement of benefits to the organization in such areas as
financial concerns, operational efficiency & competitive impact.
User management assessment:
Evaluation of the attitude of senior & user managers within the organization as well as
end users.
Development Performance:
Overall development time, efforts, conformance to benefits & standards & project
management criteria.
93
Conclusion
Silent Feature of the HOSPITAK MNAGEMENT SYSTEM :
Attractive forms are designed.
Various validation and error check are done at no. of places.
Validation messages are given at every step.
System is Fast and reliable.
We are worked hard to get the best result even in time constraints. The Work may
not be perfect but the step. Towards perfection has been started while working on the
project.
It is not only our sincere efforts and hard work but also the cooperation of all the
Project engineers, faculty member, members of management and all the student who
had helped us to get a working project in a short span of time.
Once again We Thanks all of the above and hope for their guidance and
cooperation in the future.
94
Bibliography
Books:-
“Mastering Visual Basic “
“Expert’s Guide to Vb6.0”
“How to Program Visual Basic6.0”
Websites:-
[Link]
[Link]
[Link]
95