You are on page 1of 33

INTRODUCTION

My project title is Hotel Management System. I have tried my best


to make the complicated process of Hotel Management System as
simple as possible using Structured & Modular technique & Menu
oriented interface. I have tried to design the Project in such a way
that user may not have any difficulty in using this package &
further expansion is possible without much effort. Even though I
cannot claim that this work to be entirely exhaustive, the main
purpose of my exercise is perform each Employee’s activity in
computerized way rather than manually which is time consuming.

I am confident that this software package can be readily used by


non-programming personal avoiding human handled chance of
error. This project is used by two types of users

i. Online Users.
ii. Administrator (management of the Hotel).

Online users can see the required articles or news


Administrator can maintain daily updates in the hotel records.
Administrator is must be an authorized user. He can further change
the password. There is the facility for password recovery, logout
etc.

The main aim of the entire activity is to automate the process of


day to day activities of Hotel like Room activities, Admission of a
New Customer, Assign a room according to customer’s demand,
checkout of a computer and releasing the room and finally
compute the bill etc.

The limited time and resources have restricted us to incorporate, in


this project, only main activities that are performed in a Hotel
Management System, but utmost care has been taken to make the
system efficient and user friendly.

“Hotel Management System” has been designed to computerize the


following functions that are performed by the system:

Room Detail Functions


Opening a New Room
Modification to room assigned
Check-in and check-out Detail Functions
Admission of New customer
Check-out of customer
Room assigning related to customer’s need.
Statement of Customer Details
Check-in customer
Check-out customer
Room Details
Total number of Customers in the Hotel
Individual customer Report

OBJECTIVE
During the past several decades personnel function has been transformed
from a relatively obscure record keeping staff to central and top level
management function. There are many factors that have influenced this
transformation like technological advances, professionalism, and general
recognition of human beings as most important resources.

 A computer based management system is designed to handle all the


primary information required to calculate monthly statements.
Separate database is
 maintained to handle all the details required for the correct statement
calculation and generation.

 This project intends to introduce more user friendliness in the various


activities such as record updation, maintenance, and searching.

 The searching of record has been made quite simple as all the details
of the customer can be obtained by simply keying in the identification
of that customer.

 Similarly, record maintenance and updation can also be accomplished


by using the identification of the customer with all the details being
automatically generated. These details are also being promptly
automatically updated in the master file thus keeping the record
absolutely up-to-date.
 The entire information has maintained in the database or Files and
whoever wants to retrieve can’t retrieve, only authorization user can
retrieve the necessary information which can be easily be accessible
from the file.

The main objective of the entire activity is to automate the process of day to
day activities of Hotel like:

 Room activities,
 Admission of a New Customer,
 Assign a room according to customer’s demand,
 Checkout of a computer and releasing the room
 Finally compute the bill etc.
 Packages available.
 Advance online bookings.
 Online Cancellation.
 List of Regular customers.
 Email facility.
 Feedbacks

Introduction To Microsoft Access


Microsoft Access, also known as Microsoft Office
Access, is a database management system from
Microsoft that combines the relational Microsoft Jet
Database Engine with a graphical user interface and
software-development tools. It is a member of the
Microsoft Office suite of applications, included in the
Professional and higher editions or sold separately.

Microsoft Access stores data in its own format based


on the Access Jet Database Engine. It can also
import or link directly to data stored in other
applications and databases. Software developers and
data architects can use Microsoft Access to develop
application, and "power users" can use it to build
software applications. Like other Office applications,
Access is supported by Visual Basic for Applications,
an object-oriented programming language that can
reference a variety of objects including DAO (Data
Access Objects), ActiveX Data Objects, and many
other ActiveX components. Visual objects used in
forms and reports expose their methods and
properties in the VBA programming environment,
and VBA code modules may declare and call
Windows operating system functions

INTRODUCATION TO VISUAL BASIC 6.0


Visual basic 6.0 is a new addition of a visual basic family it
provides facilities. To make a window application very easy
and fast VB 6.0 is a new advanced version of V.B for having
facilities of internet In included the integrate development
environmental interface i.e. IDE of this version is very much
improved And is made even more easier .In this way V.B 6
made creation of window application and easier task
knowledge of C++ is not necessary for doing programming in
VB 6 Visual Basic programs make application on the basic of
form and control which are the two important factors of any
application.

In comparison to other languages a programmers can make


any application in VB. In a more effective way VB 6.0 is
mainly built for the use of internet. It has many controls that
Helps in making web based application this control are
referred as active x executables. These Control works as
standalone application but they can be accessed through
internet explorer.

ADVANTAGE
I have designed the given proposed system in the VB to automate the
process of Hotels. This project is useful for the authorities which keep track
of all the users registered in a particular state .The authority can add hotel
packages, room details, availability of rooms, booking etc.

The following steps that give the detailed information of the need of
proposed system are:

Performance: During past several decades, the records are supposed to be


manually handled for all activities. The manual handling of the record is
time consuming and highly prone to error.

To improve the performance of the Hotel Management System, the


computerized system is to be undertaken. This project is fully computerized
and user friendly even that any of the members can see the report and status
of the company.

Efficiency: The basic need of this website is efficiency. The website


should be efficient so that whenever a new user submits his/her details the
website is updated automatically. This record will be useful for other users
instantly.

Control: The complete control of the project is under the hands of


authorized person who has the password to access this project and illegal
access is not supposed to deal with. All the control is under the administrator
and the other members have the rights to just see the records not to change
any transaction or entry.

Security: Security is the main criteria for the proposed system. Since
illegal access may corrupt the database. So security has to be given in this
project.

HARDWARE REQUIREMENT:
 CELERON/PENTIUM COMPUTER OR ABOVE.

 128 MB RAM.

 80 GB HARDDISK.

 SVGA COLOR MONITOR.

 MOUSE & KEYBOARD.

 DVD-RW.

 PEN DRIVE.

SOFTWARE REQUIREMENT:
 WINDOWS ENVIRONMENT (95/98/XP/VISTA).

 VISUAL STUDIO 6.0.

 M.S. ACCESS 2000 OR ABOVE

CODING
1 - The Login Form 
before getting access to the main form the user need to
login first by entering his username and password and we
will check if the username/password textbox are empty and
if the user enter the wrong username or password or this
user doesn't exists at all.
The Login Button: 

Private Sub ButtonLogin_Click(sender As Object, e As EventArgs) Handles


ButtonLogin.Click

        Dim connection As New CONNECTION()


        Dim adapter As New MySqlDataAdapter()
        Dim command As New MySqlCommand()
        Dim table As New DataTable()
        Dim username As String = TextBoxUsername.Text
        Dim password As String = TextBoxPassword.Text
        Dim selectQuery As String = "SELECT * FROM `users` WHERE
`username`=@un AND `password`=@pass"

        command.CommandText = selectQuery
        command.Connection = connection.getConnection()

        command.Parameters.Add("@un", MySqlDbType.VarChar).Value =
username
        command.Parameters.Add("@pass", MySqlDbType.VarChar).Value =
password

        adapter.SelectCommand = command
        adapter.Fill(table)

        If table.Rows.Count > 0 Then

            Dim mainForm As New MainForm()


            mainForm.Show()
            Me.Hide()
        Else

            MessageBox.Show("Invalid Username Or Password", "Login Error",


MessageBoxButtons.OK, MessageBoxIcon.Error)

        End If

    End Sub

If the user enters the correct username and password we


will show him the main form.

2 - The Main Form


This is a quick and easy from with a menu created with a
panel and labels to take the user to the selected form on
label click. 
    Private Sub LabelMClients_Click(sender As Object, e As EventArgs)
Handles LabelMClients.Click

        Dim manage_Cl_Form As New ManageClientsForm()


        manage_Cl_Form.ShowDialog()

    End Sub

    Private Sub LabelMRooms_Click(sender As Object, e As EventArgs)


Handles LabelMRooms.Click

        Dim manage_Rm_Form As New ManageRoomsForm()


        manage_Rm_Form.ShowDialog()

    End Sub

    Private Sub LabelMReservastions_Click(sender As Object, e As


EventArgs) Handles LabelMReservastions.Click

        Dim manage_Rv_Form As New ManageReservationsForm()


        manage_Rv_Form.ShowDialog()

    End Sub

3 - The Manage Hotel Clients Form


This form allow the user to manage the hotel clients.
This form contains a datagridview filled with all clients
data.
This form call functions from the class "CLIENT". 
- Add New Client Button

 Private Sub ButtonAdd_Click(sender As Object, e As EventArgs) Handles


ButtonAdd.Click

        Dim fname As String = TextBoxFname.Text


        Dim lname As String = TextBoxLname.Text
        Dim phone As String = TextBoxPhone.Text
        Dim email As String = TextBoxEmail.Text

        If fname.Trim().Equals("") Or lname.Trim().Equals("") Or
phone.Trim().Equals("") Then

            MessageBox.Show("Required First & Last Name, Phone", "Missing


Information", MessageBoxButtons.OK, MessageBoxIcon.Error)

        Else

            If client.addClient(fname, lname, phone, email) Then

                MessageBox.Show("New Client Added Successfully", "Add


Client", MessageBoxButtons.OK, MessageBoxIcon.Information)
                DataGridView1.DataSource = client.getAllClients()

            Else

                MessageBox.Show("Client Not Added", "Add Client",


MessageBoxButtons.OK, MessageBoxIcon.Warning)

            End If

        End If

    End Sub

- Edit The Selected Client Button


  Private Sub ButtonEdit_Click(sender As Object, e As EventArgs) Handles
ButtonEdit.Click

        Dim fname As String = TextBoxFname.Text


        Dim lname As String = TextBoxLname.Text
        Dim phone As String = TextBoxPhone.Text
        Dim email As String = TextBoxEmail.Text

        If TextBoxId.Text.Trim().Equals("") Then

            MessageBox.Show("Select The User You Want to Edit", "Missing


ID", MessageBoxButtons.OK, MessageBoxIcon.Error)

        Else

            If fname.Trim().Equals("") Or lname.Trim().Equals("") Or
phone.Trim().Equals("") Then

                MessageBox.Show("Required First & Last Name, Phone",


"Missing Information", MessageBoxButtons.OK, MessageBoxIcon.Error)

            Else

                Dim id As Integer = Convert.ToInt32(TextBoxId.Text)

                If client.editClient(id, fname, lname, phone, email) Then

                    MessageBox.Show("Client Updated Successfully", "Edit


Client", MessageBoxButtons.OK, MessageBoxIcon.Information)
                    DataGridView1.DataSource = client.getAllClients()

                Else

                    MessageBox.Show("Client Not Updated", "Edit Client",


MessageBoxButtons.OK, MessageBoxIcon.Warning)

                End If

            End If
        End If

    End Sub

- Delete The Selected Client Button

  Private Sub ButtonRemove_Click(sender As Object, e As EventArgs)


Handles ButtonRemove.Click

        If TextBoxId.Text.Trim().Equals("") Then

            MessageBox.Show("Enter The Client Id", "Missing ID",


MessageBoxButtons.OK, MessageBoxIcon.Error)

        Else
            Dim id As Integer = Convert.ToInt32(TextBoxId.Text)

            If client.removeClient(id) Then

                MessageBox.Show("Client Deleted Successfully", "Delte Client",


MessageBoxButtons.OK, MessageBoxIcon.Information)
                DataGridView1.DataSource = client.getAllClients()

                ' clear boxes


                TextBoxId.Text = ""
                TextBoxFname.Text = ""
                TextBoxLname.Text = ""
                TextBoxPhone.Text = ""
                TextBoxEmail.Text = ""

            Else

                MessageBox.Show("Client Not Deleted", "Delete Client",


MessageBoxButtons.OK, MessageBoxIcon.Warning)

            End If

        End If
    End Sub

4 - The Manage Hotel Rooms Form


Here the user can add a new room to the hotel system.
When you add a new room you need to select the type
of room (single, double, family, suite). 
and like the client form you can view all rooms in a data
grid view + how many rooms this hotel have, and add,
edit, remove the select one + a combo box populated
with all room's categories.

- Add New Room Button

When you add a new room the "reserved" column will be


set to no by default.
           Private Sub ButtonAdd_Click(sender As Object, e As EventArgs)
Handles ButtonAdd.Click

        Try

            Dim type As Integer =


Convert.ToInt32(ComboBoxType.SelectedValue)
            Dim phone As String = TextBoxPhone.Text
            Dim reserved As String = ""

            If RadioButtonYes.Checked Then

                reserved = "Yes"

            ElseIf RadioButtonNo.Checked Then

                reserved = "No"

            End If

            If TextBoxNumber.Text.Trim().Equals("") Or
TextBoxPhone.Text.Trim().Equals("") Then

                MessageBox.Show("Make Sure to Enter The Room Number and


The Phone Number", "Empty Fields", MessageBoxButtons.OK,
MessageBoxIcon.Error)

            Else

                Dim number As Integer = Convert.ToInt32(TextBoxNumber.Text)

                If room.addRoom(number, type, phone, reserved) Then

                    MessageBox.Show("Room Added Successfully", "Add Room",


MessageBoxButtons.OK, MessageBoxIcon.Information)
                    DataGridView1.DataSource = room.getAllRooms()
                    ' display the number of rooms on the LabelRoomsCount
                    LabelRoomsCount.Text =
room.getAllRooms().Rows.Count.ToString() + " Room"
                Else

                    MessageBox.Show("Room Not Added", "Add Room",


MessageBoxButtons.OK, MessageBoxIcon.Error)

                End If

            End If

        Catch ex As Exception

            MessageBox.Show(ex.Message, "Duplicate Room Number",


MessageBoxButtons.OK, MessageBoxIcon.Warning)

        End Try
        
    End Sub

- Edit The Selected Room Button

            Private Sub ButtonEdit_Click(sender As Object, e As EventArgs) Handles


ButtonEdit.Click

        Try
            Dim type As Integer = Convert.ToInt32(ComboBoxType.SelectedValue)
            Dim phone As String = TextBoxPhone.Text
            Dim reserved As String = ""

            If RadioButtonYes.Checked Then

                reserved = "Yes"

            ElseIf RadioButtonNo.Checked Then

                reserved = "No"

            End If

            If TextBoxNumber.Text.Trim().Equals("") Or
TextBoxPhone.Text.Trim().Equals("") Then

                MessageBox.Show("Make Sure to Enter The Room Number and The Phone


Number", "Empty Fields", MessageBoxButtons.OK, MessageBoxIcon.Error)

            Else

                Dim number As Integer = Convert.ToInt32(TextBoxNumber.Text)

                If room.editRoom(number, type, phone, reserved) Then

                    MessageBox.Show("Room Updated Successfully", "Edit Room",


MessageBoxButtons.OK, MessageBoxIcon.Information)
                    DataGridView1.DataSource = room.getAllRooms()

                Else

                    MessageBox.Show("Room Not Updated", "Edit Room",


MessageBoxButtons.OK, MessageBoxIcon.Error)

                End If

            End If

        Catch ex As Exception

            MessageBox.Show(ex.Message)

        End Try

    End Sub

- Delete The Selected Room Button

            Private Sub ButtonRemove_Click(sender As Object, e As EventArgs)


Handles ButtonRemove.Click

        Try

            Dim number As Integer = Convert.ToInt32(TextBoxNumber.Text)

            If room.removeRoom(number) Then

                MessageBox.Show("Room Deleted Successfully", "Delete Room",


MessageBoxButtons.OK, MessageBoxIcon.Information)
                DataGridView1.DataSource = room.getAllRooms()

                ' reset and clear fields


                TextBoxNumber.Text = ""
                ComboBoxType.SelectedIndex = 0
                TextBoxPhone.Text = ""
                RadioButtonYes.Checked = True

                ' display the number of rooms on the LabelRoomsCount


                LabelRoomsCount.Text = room.getAllRooms().Rows.Count.ToString()
+ " Room"

            Else

                MessageBox.Show("Room Not Deleted", "Delete Room",


MessageBoxButtons.OK, MessageBoxIcon.Warning)

            End If

        Catch ex As Exception

            MessageBox.Show(ex.Message)

        End Try

    End Sub

5 - The Manage Hotel Reservations Form


This form allow the user to manage the clients room
reservations.
to create a reservation you need: 1) enter the reservation id,
2) select the client who will reserve, 3) you need to select
the room where the client will stay.

when you add a new reservation the system will check:


- if the user enter all required informations.
- if the user enter a date in that is equal or come after the
current day date.
- if the user enter a date out that is equal or come after the
date in.
- Add a New Reservation Button

Private Sub ButtonAdd_Click(sender As Object, e As EventArgs) Handles


ButtonAdd.Click

        Try

            Dim clientId As Integer = Convert.ToInt32(TextBoxClientID.Text)


            Dim roomNumber As Integer =
Convert.ToInt32(ComboBoxRoomNumber.SelectedValue.ToString())
            Dim dateIn As Date = DateTimePickerIN.Value
            Dim dateOut As Date = DateTimePickerOUT.Value

            If DateTime.Compare(dateIn.Date, DateTime.Now.Date) < 0 Then

                MessageBox.Show("The Date In Must be = Or > to Today Date",


"Invalid Date IN", MessageBoxButtons.OK, MessageBoxIcon.Error)

            ElseIf DateTime.Compare(dateOut.Date, dateIn.Date) < 0 Then

                MessageBox.Show("The Date Out Must be = Or > to The Date


In", "Invalid Date OUT", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Else

                If reservation.addReservation(roomNumber, clientId, dateIn,


dateOut) Then

                    MessageBox.Show("Reservation Added Successfully", "Add


Reservation", MessageBoxButtons.OK, MessageBoxIcon.Information)
                    DataGridView1.DataSource = reservation.getAllReservations()
                    ' we need to refresh the combobox to show only the not reserved
rooms
                    ComboBoxType.DataSource = room.getAllRoomsType()

                Else

                    MessageBox.Show("Reservation NOT Added", "Add


Reservation", MessageBoxButtons.OK, MessageBoxIcon.Error)

                End If

            End If

            
        Catch ex As Exception

            MessageBox.Show(ex.Message, "Add Reservation Error",


MessageBoxButtons.OK, MessageBoxIcon.Error)

        End Try
        
    End Sub

- Edit The Selected Reservation Button


     Private Sub ButtonEdit_Click(sender As Object, e As EventArgs) Handles
ButtonEdit.Click

        Try

            Dim reservationId As Integer = Convert.ToInt32(TextBoxReservationID.Text)


            Dim clientId As Integer = Convert.ToInt32(TextBoxClientID.Text)
            Dim roomNumber As Integer =
Convert.ToInt32(DataGridView1.CurrentRow.Cells(2).Value.ToString())
            Dim dateIn As Date = DateTimePickerIN.Value
            Dim dateOut As Date = DateTimePickerOUT.Value

            If DateTime.Compare(dateIn.Date, DateTime.Now.Date) < 0 Then

                MessageBox.Show("The Date In Must be = Or > to Today Date", "Invalid Date


IN", MessageBoxButtons.OK, MessageBoxIcon.Error)

            ElseIf DateTime.Compare(dateOut.Date, dateIn.Date) < 0 Then

                MessageBox.Show("The Date Out Must be = Or > to The Date In", "Invalid


Date OUT", MessageBoxButtons.OK, MessageBoxIcon.Error)

            Else

                If reservation.editReservation(reservationId, roomNumber, clientId, dateIn,


dateOut) Then

                    MessageBox.Show("Reservation Updated Successfully", "Edit Reservation",


MessageBoxButtons.OK, MessageBoxIcon.Information)
                    DataGridView1.DataSource = reservation.getAllReservations()

                Else

                    MessageBox.Show("Reservation NOT Updated", "Edit Reservation",


MessageBoxButtons.OK, MessageBoxIcon.Error)

                End If

            End If

        Catch ex As Exception

            MessageBox.Show(ex.Message, "Edit Reservation Error",


MessageBoxButtons.OK, MessageBoxIcon.Error)

        End Try
        
    End Sub

- Remove The Selected Reservation Button


  Private Sub ButtonRemove_Click(sender As Object, e As EventArgs) Handles
ButtonRemove.Click

        Try

            Dim reservationId As Integer =


Convert.ToInt32(TextBoxReservationID.Text)
            Dim roomNumber As Integer =
Convert.ToInt32(DataGridView1.CurrentRow.Cells(2).Value.ToString())

            If reservation.removeReservation(reservationId, roomNumber) Then

                MessageBox.Show("Reservation Deleted Successfully", "Remove


Reservation", MessageBoxButtons.OK, MessageBoxIcon.Information)
                DataGridView1.DataSource = reservation.getAllReservations()

            Else

                MessageBox.Show("Reservation NOT Deleted", "Remove Reservation",


MessageBoxButtons.OK, MessageBoxIcon.Error)

            End If

        Catch ex As Exception

            MessageBox.Show(ex.Message, "Remove Reservation Error",


MessageBoxButtons.OK, MessageBoxIcon.Error)

        End Try

    End Sub

E-R DIAGRAM
CONTEXT LEVEL DFD
HOTEL MANAGEMENT SYSTEM

DATA FLOW DIAGRAM


OPENING A NEW ROOM

DATA FLOW DIAGRAM


CHECK-IN OF A NEW CUSTOMER

DATA FLOW DIAGRAM


RECORD MODIFICATION

DATA FLOW DIAGRAM


CHECK-OUT OF CUSTOMER

Update Table
process

DATA FLOW DIAGRAM


LISTING OF CUSTOMERS

DATA FLOW DIAGRAM


GENERATING BILL OF CUSTOMER

4
Close
Processing Databas
e
3
Computer
Bills

Cash CUSTOMER
DATA FLOW DIAGRAM
LIST OF ALL RECORDS
BIBLIOGRAPHY

I have learned this language using the following sources:


1. MSDN, Microsoft.
2. Visual Basic 6 Black Book by Steven Holzner.
3. Visual Basics Course, BCA, Barkatullah University Bhopal
(M.P.).

Some other reference books for Microsoft Visual Basic:

Programming Microsoft Visual Basic 6.0


Author: Francesco Balena Publisher: Microsoft Press

Programming Microsoft Visual Basic 2005


Author: Francesco Balena Publisher: Microsoft Press

Microsoft Visual Basic .NET Deluxe Learning Edition


Author: Michael Halvorson Publisher: Microsoft Press

Beginning VB.NET (2nd Edition)


Author: Richard Blair et all Publisher: Wrox Press

Programming VB.NET
Authors: Gary Cornell, Jonathan Morrison Publisher: Apress

Professional VB.NET
Authors: Bill Evjen et all Publisher: Wrox Press

Microsoft Visual Basic .NET Step by Step


Author: Michael Halvorson Publisher: Microsoft Press

You might also like