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

PROJECT REPORT

on

(HOTEL MANAGMENT)

Submitted by

(HARMEET)

Registration No

21304935022

(2015-2016)

Under the Guidance of

Name of Project Guide Arya Infotech Institute


MS. Harjit kaur

Directorate of Distance Education

Lovely Professional University, Phagwara


HOTEL MANAGEMENT

CERTIFICATE

This is to certify that project report entitled HOTEL MANAGEMENT SYSTEM


submitted to lovely University, Jalandhar by Nisha Rani and Harmeet Kaur of Arya
InfoTech Institute, Phagwara in partial fulfillment for the requirement of the degree of
Bsc-IT of Computer Application session 201-11, was carried out under my supervision
and guidance.

Ms. Harjit kaur


(Project Guide)

2
HOTEL MANAGEMENT

Acknowledgement
With great pleasure, we take this opportunity to express our profound sense of gratitude
to all those who helped us to put this project on the path of progress.

First of all, we pay our immense gratitude to Manager of KAYGEE RESOT, Phagwara
for giving us the chance of showing our skills through their continued support and
cooperation during the concerned of the project.

We are thankful to our center head Mr. Bhupinderjit Singh Bambah for providing such a
healthy atmosphere and infrastructure.

We are thankful to ms. Harjit kaur for guiding us in this project.

Last but not the least, our sincere gratitude is gratitude is reserved for our parents who
have been always been a greatest source of encouragement to us.

We are greatly thankful to GOD for showing his blessing on us without which we would
not have been able to accomplish this project.

3
HOTEL MANAGEMENT

INDEX
Title Page No.

1. Organization Overview 5
2. Profile of The Problem 6
3. Existing System 8-12
Introduction
Existing Software
Whats New in the System to be developed?
4. Problem Analysis 13-21
Product Definition
Feasibility Analysis
Project Planning
5. Software Requirement Analysis 23-32
Introduction
General Description
Specific Requirements
6. Design 34-62
Flowchart
DFD
ER Diagram
Database Design
Form Design

4
HOTEL MANAGEMENT

Overview of Organization
Hotel KAY GEE Resorts situated at Hoshiarpur road, Phagwara. Hotel KAY GEE Resorts
started from May 2001. In such a short period the success it has got is highly appreciable.
Hotel KAY GEE Resorts is awarded in 2004 with best Hotel award in city.

Hotel Kay Gee Resorts for the last 10 years, the management
Has Honour of serving many Distinguished Guests who have their appreciation of high
standards of Hospitality & services A Fully Comfortable Experience.

Hotel Kay Gee Resorts is ideally situated 1.5 kilometres From the Railway Station and 1
kilometre from the bus Stand.
Hotel Kay Gee Resorts has defined the standards of Gracious Living & offers Great
Value for money at Phagwara (Punjab) and Personalize Service makes the Guest feel
like Home.

This hotel having all the facilities to fulfill the customers need. It is
having centrally air conditioned restaurants. The Hotel has well equipped luxurious
rooms which are also air conditioned. A cozy environment is provided to the customers to
make them feel relax. The facilities include a Multi-Cuisine Restaurant to satisfy your
quench as per your taste bud, a well Stored Bar, three Banquets and Conference halls
perfect for every occasion. An Ideal Marriage Hall to make your Special Moment an
unforgettable celebration. We at Hotel Kay Gee Resorts provide personalized and
innovative services and complete wedding solution to our Guests dreaming of a
Traditional Wedding of all Religions and Social Celebrations.

5
HOTEL MANAGEMENT

Despite its good looking remises, it enjoys the good behavioral


staff. All the staff members are very honest and hard working. Further it is aiming at
achieving higher sales through more customers satisfaction. The company has recruited
qualified staff having knowledge and degree in Hotel Management.

Hence, it is to say that project involves a lot of work as it is aimed


towards correcting the things that already have been done that is successfully altering the
system without those problems occurring at now along with any kind of new one.

Profile of the Problem


The existing system have some problems, following is the brief explanation of all these
limitations.

HUGE PAPERWORK
The whole working is manual, organization has to maintain the number of registers
to store information that result in voluminous paperwork.

TIME CONSUMING
Doing all work manually is very time consuming. In some cases time is a major
constraint.

SECURITY PROBLEM
Manual system doesnt provide better security. Every person in the organization can
access the data easily so to enforce security constraints in such system is difficult.

REDUCED SPEED
Due to manual system in the organization the overall speed of working reduces.

DIFFICULTY IN GENREATING REPORTS


Because information has to be picked up from different register there is a difficulty
in generating reports.
Data Redundancy
Maintaining different registers to store information leads to the problem of data
redundancy. Some information may be duplicated in serval registers. This
redundancy may lead to data inconsistency.

6
HOTEL MANAGEMENT

7
HOTEL MANAGEMENT

Introduction of existing System


Existing system is maintained a lot of paperwork is required, many registers have to be
maintained and a lot of duplication of records may be there the whole work is manually
to store information so the result is in voluminous paperwork.

Existing System: - The existing Hotel management system suffers some pitfalls because
the whole working is done manually the organization has to maintained number of
registers so to retrieve information of a particular customer at any giving time is difficult.
The manual system does not allow needed data to be retrieved in a convenient and
efficient manner.

Due to the problem of data inconsistency the various copies of same information may no
longer agree. Manual system does not provide better security. Every person can not easily
access the data easily so to in force security constraints such as system is difficult. Some
pitfalls of existing system is given below:

HUGE PAPERWORK
The whole working is manual, organization has to maintain the number of registers
to store information that result in voluminous paperwork.

TIME CONSUMING
Doing all work manually is very time consuming. In some cases time is a major
constraint.

SECURITY PROBLEM
Manual system doesnt provide better security. Every person in the organization can
access the data easily so to enforce security constraints in such system is difficult.

8
HOTEL MANAGEMENT

REDUCED SPEED
Due to manual system in the organization the overall speed of working reduces.

DIFFICULTY IN GENREATING REPORTS


Because information has to be picked up from different register there is a difficulty
in generating reports.

Data Redundancy
Maintaining different registers to store information leads to the problem of data
redundancy. Some information may be duplicated in serval registers. This
redundancy may lead to data inconsistency.

9
HOTEL MANAGEMENT

10
HOTEL MANAGEMENT

Easy data access:


Data can be easily access using the system. Delay associated with accessing data
from different paper files can be reduced using our system.

Reduces data redundancy and inconsistency:


Our system reduces the problem of data redundancy. The information is not
duplicated in several files. It saves the storage space and access cost. This removes
the problem of data inconsistency.

Consistent user interface:


This means that no cramming of commands, their purpose. We have to do what the
system is asking us for and it too through clicks only.

Easy installation:
First of all, the installation of our system is very much easier through WINDOWS
and also of any other software we need to install.

11
HOTEL MANAGEMENT

Problem Analysis

12
HOTEL MANAGEMENT

The goal of problem analysis is to obtain a clear understanding of the requirements of the
client and the end user. The people, the documents of the existing system and the current
mode of operation are the basic source of information for the analysts.

Analysis Issue

An analysis is the activity that feeds information to the specification activity; it is


essential that during analysis complete and consistent set of specification emerge for the
system.
There are three basic approaches to problem analysis
Informal approach
Conceptual modeling
prototyping

Informal approach

It is based on structured communication with the client and the users, that is ,
communication through questionnaires, interviews . It is carried out without any structure
methodology.

Conceptual Modeling

In this a formal method is created for the problem that partitions the problem in to smaller
problems to produce some formal structures representing some aspects of the problem.

Prototyping

It is another method for doing requirement analysis. In this, a partial system is


constructed, which is then used by the client, users and developers to gain a better
understanding of the problem and the needs. Hence, actual experience with a prototype
that implements part of the eventual software system is used to analyze the problem and
understand the requirements for the eventual software system.

Definition of Product

13
HOTEL MANAGEMENT

Like every Hotel and restaurants it has number of times to serve a number of categories
to show and a number of customer records to maintain. Hence it just becomes a
compulsion to replace their existing manual system by a window based computerized
system with efficient front and backend tools, like VB.NET and MS ACCESS, as the
need is to maintain a database which provide the necessary information when ever
required. If we dont get such a facility it becomes a headache rather it is an interesting
job.

Project Aim
Our objective is to made a system which not merely duplicate
the characteristics and effectiveness of their existing system, rather it can use the power
of their existing system and it should also provide the power of window based
computerized environment and it is better than manual system.

RESERVATION

Room Reservation
Hall Reservation

Room Reservation:

14
HOTEL MANAGEMENT

When customer request for a room. Firstly the reservation id of


customer is automatically generated. The user records required information regarding his
name, address, Nationality etc. The user asks him for room type as currently four types of
rooms are available in the hotel.

Hall Reservation

Here, when the customer request for hall for marriages purpose
of birthday parties and others. Firstly the reservation id is automatically generated. Then
the personal information about the customer is entered. There are three types of halls in
the hotel out of those empty halls are displayed. Updation, deletion, addition function is
also provided in hall reservation.

Feasibility Study

15
HOTEL MANAGEMENT

Feasibility study is a test of system proposal according to the workability, impact on the
organization, ability to meet user needs, and effective use of resource. It focuses on three
major questions:-

What are the users demonstrable needs and how does a candidate system meet
then?
What resources are available for given candidate system? Is the problem worth solving?
What are the likely impacts of the candidate system on the organization?

TYPE OF FEASIBILITY STUDY

Mostly there are four main consideration involved in any feasibility study.
Now, we will review these things consideration is related to our project.

Technical Feasibility:

Technical feasibility is concerned with specifying equipments (hardware and software


requirement) that will successfully satisfy the user requirement.
Regarding our system we can say that the company has to bear the cost of a computer
system and the cost of the software i.e. to load the vb.net and ms access. But the
benefits of our system are much more than this cost. So, our system is technically
feasibility also.

Management Feasibility :

It is determination of whether a proposed system will be acceptable to the


management .if the management does not have interest in the system or gives a
negligible support to it, the analyst will tend to view the project as a non-feasible one.
Our project is feasible in thus case also because the M.D of the hotel wants to
computerize the existing system.

Behavioral feasibility:

16
HOTEL MANAGEMENT

To be behavioral feasibility it requires that the introduction of the proposed system must
put special efforts to educate, sell, and train the staff of new ways of the operating
system.
As far as behavioral feasibility is concerned, the staff is not reluctant to any change in the
system because they feel insure by it.

Some people may find that the difficulty to learn and the use the machine as being
restrictive and intolerable.
Some may resist change in the nature of the job and increment in the responsibilities of
individual.
In an automated system, work may appear to become depersonalized, fragmented and
restrictive. They may miss the personnel contact with their work and its associated
challenges.

To reduce this insecurity is first of all tasks during analysis:

We can use some skills to reduce their harassments.


We will make them sure about their job by telling them an automated system
would make their task simple only.
We will tell them that when they are going to be trained they can do their task
efficiency.

Economic feasibility:

Economic analysis is the most frequently used technique for evaluating the effectiveness
of a proposed system .The thing is not to keep the costs lower rather is to keep them
under companys budget.
This is an ongoing effort that improves in accuracy at each phase of the system life cycle.
As far our hotel management system is concerned, it is certainly economically feasible.
As the cost of system is outweighing the benefits, as already discussed, of the proposed
system.

17
HOTEL MANAGEMENT

Project plan
We are having the project of two members to develop the entire project entitled Hotel
Management.

Team Structure

The project development team compromised of two students namely:


Mr. Jatinder Kumar from Arya InfoTech institute Phagwara.
Miss. Ekta Uppal from Arya InfoTech institute Phagwara.
Manager of the Hotel and our guide Mr.Mandeep Singh Gill was also there to guide us.

Development Schedule

The project was scheduled as following:


System requirement specification
System Development schedule
Database design
Coding reports and module integration
Testing

Team Work:-

In the Project report entitled Hotel Management System we have designed the data
flow diagram of our system, designing the screens, flow charts of our project with the
help of the information gathered. Designing reports, coding of the forms, database design
and documentation is also included in my work.

18
HOTEL MANAGEMENT

Software Requirement Analysis

19
HOTEL MANAGEMENT

Requirement analysis is a very important phase in a system development life cycle. We


must analyze the problem before it can be solved.
Requirement analysis is a detailed understanding of all the important factors of the
organization under investigation.

The key questions are:

What is being done?


How is it being done?
How frequently does it occur?
How great is the volume of transaction or decisions?
How well is the task being performed?
Does a problem exist?
If a problem exists, how serious it is?
What is the under lying cause?

20
HOTEL MANAGEMENT

Hardware and Software Requirements

HARDWARE REQUIREMENTS

Central Processing Unit

Type Specification
Processor Pentium III
RAM 128MB

21
HOTEL MANAGEMENT

Hard Disk Space Min. 20GB

Peripherals

Type Specification
Monitor VGA Color
Mouse Scroll mouse
Keyboard Standard
Printer Color/Black-White

Storage Media

Type Specification
Pen Drive 1GB More
Hard Disk 160 GB More
CD-Rom 48x/52x

SOFTWARE REQUIREMENTS

Frond End VB.net


Back End Ms Access

22
HOTEL MANAGEMENT

Introduction of Operating system

23
HOTEL MANAGEMENT

Operating system is an interface between user and hardware machine, it is used to


service the other program and applications its the responsibility of operating

system to utilize hardware components.

Features of operating system


Memory management
File management
Processing
Command interpreter
Security

24
HOTEL MANAGEMENT

Introduction to MS Access
Microsoft Access is a computerized database management system (DBMS) that allows
efficient data storage and retrieval as well as efficient and effective data presentation. You
can create a database in which information can be stored in an organized manner that also
allows tailoring to efficient, effective data retrieval and presentation.

Microsoft access is a relational database management system (RDBMS) used to store and
manipulate large collection of information of any kind. Here RDBMS refers to the
organization of data in a series of rows and columns in such a manner that any specific
piece of information is available with a click of mouse and a few keystrokes .ms access
has tools, which are easy to use and provide powerful development environment, making
it an appropriate choice for novices and professionals. For example: access can be used to
enter and maintain student awards, inventory record of warehouse, telephone numbers.
Once the records are stored, any type of queries can be asked, reports can be created and
data entry forms can be designed.

Access is both a program for ordinary computer and a professional development tool. It is
used for developing database, which are used in system; you can use to set up a billing
system or an efficient indexing system

Access is easy to make tables, screen displays and function, but if you want to develop an
effective database you will need to do a little more. You will have to plan and systematic.

25
HOTEL MANAGEMENT

Features of MS Access
You can import data from Microsoft access database into your contains folder in
outlook .you can also export outlook data back into ms access.

When you output a report with a sub report to a .txt, .rtf or .xls file format, the sub
report is output along with the main report.

Microsoft access objects from other applications, such as Microsoft excel.

You can link from Microsoft excel or lotus 1-2-3 spreadsheet as long as the data is
arrange in an appropriate tabular format.

When a Microsoft spreadsheet is no longer the appropriate tool for your data, you
can create a Microsoft access database from the spreadsheet by clicking convert to
access on data menu in Microsoft excel.

You can link data from Microsoft excel or lotus 1-2-3 spreadsheet as long as the
data is arrange in an appropriate tabular format.

When you use ms access as an activeX component, you can manipulate Microsoft
access objects from other applications, such as Microsoft excels.

Create a pivot table control in a Microsoft access from using pivot table wizard,
you can create a control on a form that allow you to summarize large amount of
data using a format and calculation method you choose. A pivot table is like a cross
tab query, but you can switch the row and column heading dynamically to see
different views of data.

26
HOTEL MANAGEMENT

Introduction to VB. Net


Visual basic.net has been designed to create next generation application for the
Microsoft window operating system and the web. The new features open new
doors for the visual basic developer to rapidly develop scalable web sites. The data
tools now inherently support XML data also With VB.NET. Microsoft has
introduced two new interfaces window forms and web forms, which is the IDE tool
used for writing, debugging, compiling, and executing the visual basic application.
VB.NET is designed from group up to allow developers to easily develop and
deploy complex web applications.

Needs of VB.NET
For nearly a decade, the VB language has been a popular programming language
for the window platform. It is easy to underestimate the impact that VB 1.0 had on
the window market. With the introduction of VB4.0, it becomes simple to create
COM (component object model). COM applications can be created using other
languages like c++, since the language itself is complex many programmers used
VB for creating COM application which is more simple to program. With the
introduction VB5.0, using VB for com programming becomes more popular as it
provided the ability to create active X controls. VB6.0 introduced web classes,
window less control, data designers, new reporting designers, and the ability to
create data sources.
If VB is to retain relevance to users and help attract developers to the new web
services platform, it must be the first class supporter of the .NET frame work. But
in many cases features needed to support the .NET framework conflict with
existing features in the VB language. Thus, the decision has been made by

27
HOTEL MANAGEMENT

Microsoft it loose the bonds of backward compatibility and take language a step
forward in the new evolution. The result is visual basic .NET.

In short, we can say Microsoft has introduced a totally new language in the visual
basic .NET which supports entirely Microsoft.NET strategy which aims to
providing a platform for building internet based application in a faster, efficient
and much more reliable manner along with interoperability with other languages
providing a multi languages environment. So, now let us discuss the features of
visual basic .NET.

Features of VB.NET
Using visual basic is the quickest and the easier way to create powerful, full featured
application that take advantage of the graphical user interface in windows. The feature of
visual basic.NET is as follows:-

VB has always been among the simplest language for creating any kind of
applications.
This gives consistencies among all the .NET languages such as data type and
how objects are exposed and interoperate independent of the architecture
and operating system of the machine.
There is a no need t explicitly allocate or de-allocate memory in VB.NET.
Garbage collection is big advantage of VB.NET; these find the circular
reference and destroy them.
VB.NET is truly an object oriented language, the main feature of object-
oriented language are encapsulation, inheritance and polymorphism.
VB.NET is a type safe in the sense there is no implicit conversion of types
and the programmer has to do their own type conversion.
VB.NET supports threading in applications it is very important when
creating highly scalable server side components, it is equally useful when
creating very interactive user interfaces.
VB.NET supports threading in application it is very important when creating
highly scalable server side components, it is equally useful when creating
very interactive user interfaces.

28
HOTEL MANAGEMENT

VB.NET supports structured way handling the errors that occur in an


application.
For many years VB has been widely regarded having an incredible forms
designer. Web form brings this technology to html development.
A web service is a component that runs on web server and allow client
program to call its method over HTTP. This technology is based on the open
SOAP (simple object access protocol) specification.
VB.NET makes it easier to create and publish, consume or use a web
service.

Architecture of VB.NET
The common language runtime provides the infrastructure for execution of
code and also provide other services, which can be used during execution.
Some of the feature that CLR provides is:
Cross-language integration, especially cross language inheritance.
Automatic memory management, which manages object lifetime so that
reference counting is unnecessary.
Self-describing object, which make using IDL (interface definition
language), type libraries etc unnecessary.
The ability to compile ones and run on any cpu and operating system that
supports the run time which makes the application platform independent.

Execution of VB.NET Programs

Source code (...vb extension)

Visual basic compiler (vb.exe)

MSIL (.il file)


29
Just inExecutable
time compiler (JIT)
HOTEL MANAGEMENT

30
HOTEL MANAGEMENT

Flowchart

31
HOTEL MANAGEMENT

A Flowchart is a pictorial representation of an algorithm. Programmers often use it as a


program-planning tool for organizing a sequence of steps necessary to solve a problem by
a computer. It uses boxes of different shapes to denote different type of instructions. The
actual instructions are written with in these boxes using clear and concise statements.
Solid lines having arrow marks to indicate the flow of operation, that is, the exact
sequence in which the instructions are to be executed, connect these boxes. The process
of drawing a flowchart for an algorithm is often referred as flowcharting.

Flowchart symbols: - only few symbols are needed to indicate the necessary Operations
flowchart.

Terminal
Input/output

Processing
Decision

Flow Lines
Connectors

Terminal: The terminal symbol is used to indicate the beginning(start), end(stop),


and pauses(halt) in the program logic flow

32
HOTEL MANAGEMENT

Input/Output: The input output symbol used to denote any function of an


input/output device in a program.

Processing: A processing symbol is used in a flowchart to represent arithmetic and


data movement instructions. hence, all arithmetic process of adding, subtraction,
multiplying, and dividing are shown by a processing
Decision: The decision symbol is used in a flowchart to indicate a point at which a
decision has to be made, and a branch to one or two or more alternative points is
possible.

Flow lines: Flow lines with arrowheads are used to indicate the flow of operations,
that is, the exact sequence in which the instructions are to be executed.

Connectors: Whenever a flowchart becomes complex enough that the number and
directions of flow lines is confusing, or it spread over more than one page, it is
useful to utilize the connector symbol as a substitute for flow lines.

33
HOTEL MANAGEMENT

Login Flowchart

Start

Input Login Name


and Password

No
Validate
password

Yes

Go to main
Menu

34
HOTEL MANAGEMENT

Flowchart for Reservation

35
HOTEL MANAGEMENT

Data Entry

Type of
Reservatio
n

Hall Room Hall


Reservatio Reservation Reservatio
n n

Yes Check No
Availability

Input the Booking


Reservation

Maintain the customer record


And update status Stop

36
HOTEL MANAGEMENT

37
HOTEL MANAGEMENT

Data flow diagram


The DFD was first developed by lary Constantine, as a way of expressing system
requirements in a graphical form.
This led to a modular design.
A DFD is also Known as bubble chart .A DFD has the purpose of clarifying system
requirement and identifying major transformation that will become programs in system
design. So it is the starting point of the design phase that functionally decomposes the
requirement specification down to the lowest level of detail.
DFD are quite general and are not limited to problem analysis for SRS. DFDs show the
flow of data through the system .A DFD also shows the movement of data through the
different transformation or processes in the system .The process are shown by named
circle (bubbles), and arrows for entering or leaving the bubbles. A rectangle represent
source or sink, and is a net originator or consumer of data .A source or a sink is typically
outside the main system of study.

DFD SYMBOLS
NAME SYMBOLS

Square

Arrow

Circle

Open rectangle

38
HOTEL MANAGEMENT

Item Information
Menu

Food order
Process
CUSTOMER order
Service
information
Order

Food Bill

39
HOTEL MANAGEMENT

Hall Updation

Hall type

Update request Deluxe


ordinary
MANAGER

40
HOTEL MANAGEMENT

41
HOTEL MANAGEMENT

Room booking Hall booking

Information
Customer
Booking
Request Maintaining the
CUSTOMER customer details

Hall Info Room Info

Room Bill

42
HOTEL MANAGEMENT

Room Customer

Status Update

Customer Information

Request for
Bill
Generat Money
Room Information

CUSTOMER e bill CUSTOMER


Bill

Extra Charges

Room Info

43
HOTEL MANAGEMENT

Hall Customer

Status Update

Customer Information

Request for
Bill
Hall Information

Generat Money
CUSTOMER e bill CUSTOMER
Bill

Hall Info

44
HOTEL MANAGEMENT

45
HOTEL MANAGEMENT

Entity Relationship Diagram

Entity relationship diagram is a logical representation of entities, associations and data


elements for an organization and business area. This is used in data designing that
includes data objects and attributes, relationship, that helps to describe how entities in an
enterprise are related to one another.
In the context of structured analysis, ER diagram defines all the
data that are entered, stored, transformed and produced with in an application.

Symbols used in Constructing ER diagram

Attribute

Various data items that describe an entity are known as attributes. Attributes specifies
properties of entities and relationships.

Entity Set

An entity is a thing which can be easily identified. It may be an object, event of interest
and about which data captured, stored or processed.

46
HOTEL MANAGEMENT

Relationship

An association of several attributes in an Entity-Model is called relationship. This


connects entities and represents meaningful dependencies between them.
There are three types of relationships which exist among entities. These are:
(a) One-to-One (b) One-to-Many (c) Many-to-Many

47
HOTEL MANAGEMENT

ER DIAGRAM

48
HOTEL MANAGEMENT

Database Designing
A database is a space in which you can store information that is related to a particular
topic or purpose. A typical example of a data base is a file cabinet where you can diverse
information in different drawers. Another example of a database very common to every
one can be an address book in which you can organize desired information such as last
name, first name, home address, phone number, cell number, email address that can be
organized by last name in an alphabetical order.
The difference between a paper or document-based database and access is the efficiency
and effectiveness that a computerized database provides. Users are able to store and
relative information fast and present information effectively using access. Most of all, it
is cost effective because large amounts of information can be maintained in a personal
computer for an indefinite period of time.
Database is a coherent collection of data with some inherent meaning, designed, built and
populated with data for a specific purpose. A database store data that is useful to us. This
database is only a part of entire data available in the world around us. To be able to
successfully design and maintaining we have to do following:-

Identify which part of the worlds is interested to us.


Identify which specific object in that part of the worlds data is interested to us.
Identify the relationship between the objects.

Main motive in the database design is to manage the share ability of database.
Good database design must be satisfied current and future application needed for
organization. Create to unanticipated user requirement are expandable to modify. Here we
have Microsoft access to design our database with the tables coming next.

49
HOTEL MANAGEMENT

Table Name: - Login form


Field Data Type Description
User Name Text Name of the user
Password Text Password of the user

This data base is used to enter the name and password of the user.

Table Name: - Room Reservation

Field Data Type Description


Room type text Reservation room of customer
Room rent number Room rent of customer
Room number number Room no. of customer
Customer name Text Name of customer
address Text Address of customer
Phone no number Phone no. of customer
Booking from Number Booking day of customer

This data base is used to reserve the room in the hotel.

Table Name: - Hall Reservation

50
HOTEL MANAGEMENT

Field Data Type Description


hall type text Reservation room of customer
hall rent number Room rent of customer
hall number number Room no. of customer
Customer name Text Name of customer
address Text Address of customer
Phone no number Phone no. of customer
Booking from Number Booking day of customer

This data base is used to reserve the hall of different types.

51
HOTEL MANAGEMENT

52
HOTEL MANAGEMENT

53
HOTEL MANAGEMENT

54
HOTEL MANAGEMENT

Main Form

55
HOTEL MANAGEMENT

Imports System.Windows.Forms
Imports nishu

Public Class AppContainer


Dim opnFrm As Form

Private Sub
LogoutMenuItem_Click(sender As
System.Object, e As System.EventArgs)
Handles LogoutMenuItem.Click
Dim ChildForm As New Login
Dim topStart As Integer = 0
Dim leftStart As Integer = 0
ChildForm.Location = New
Point(leftStart, topStart)
ChildForm.Show()
Me.Hide()
End Sub

Private Sub
HallBookingMenuItem_Click(sender As
System.Object, e As System.EventArgs)
Handles HallBookingMenuItem.Click
CloseExistingForm()
Dim ChildForm As New Hall_Book
opnFrm = ChildForm
ChildForm.MdiParent = Me

56
HOTEL MANAGEMENT

ChildForm.StartPosition =
FormStartPosition.Manual
Dim leftStart As Integer = 0
Dim topStart As Integer = 0
ChildForm.Location = New
Point(leftStart, topStart)
ChildForm.Show()
End Sub

Private Sub
UpdateBookedHallMenuItem_Click(sender As
System.Object, e As System.EventArgs)
Handles UpdateBookedHallMenuItem.Click
CloseExistingForm()
Dim ChildForm As New Hall_Updation
opnFrm = ChildForm
ChildForm.MdiParent = Me
ChildForm.StartPosition =
FormStartPosition.Manual
Dim leftStart As Integer = 0
Dim topStart As Integer = 0
ChildForm.Location = New
Point(leftStart, topStart)
ChildForm.Show()
End Sub

Private Sub
RoomBookingMenuItem_Click(sender As

57
HOTEL MANAGEMENT

System.Object, e As System.EventArgs)
Handles RoomBookingMenuItem.Click
CloseExistingForm()
Dim ChildForm As New Room_Book
opnFrm = ChildForm
ChildForm.MdiParent = Me
ChildForm.StartPosition =
FormStartPosition.Manual
Dim leftStart As Integer = 0
Dim topStart As Integer = 0
ChildForm.Location = New
Point(leftStart, topStart)
ChildForm.Show()
End Sub

Private Sub
UpdateBookedRoomMenuItem_Click(sender As
System.Object, e As System.EventArgs)
Handles UpdateBookedRoomMenuItem.Click
CloseExistingForm()
Dim ChildForm As New Room_Updation
opnFrm = ChildForm
ChildForm.MdiParent = Me
ChildForm.StartPosition =
FormStartPosition.Manual
Dim leftStart As Integer = 0
Dim topStart As Integer = 0

58
HOTEL MANAGEMENT

ChildForm.Location = New
Point(leftStart, topStart)
ChildForm.Show()
End Sub

Private Sub
UserSetupMenuItem_Click(sender As
System.Object, e As System.EventArgs)
CloseExistingForm()
Dim ChildForm As New Room_Book
opnFrm = ChildForm
ChildForm.MdiParent = Me
ChildForm.StartPosition =
FormStartPosition.Manual
Dim leftStart As Integer = 0
Dim topStart As Integer = 0
ChildForm.Location = New
Point(leftStart, topStart)
ChildForm.Show()
End Sub
Private Sub CloseExistingForm()
Try
opnFrm.Hide()
Catch ex As Exception

End Try

End Sub

59
HOTEL MANAGEMENT

Private Sub
ExitToolStripMenuItem_Click(sender As
System.Object, e As System.EventArgs)
Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub

Private Sub
UserSetupMenuItem_Click_1(sender As
System.Object, e As System.EventArgs)
Handles UserSetupMenuItem.Click
CloseExistingForm()
Dim ChildForm As New UserSetup
opnFrm = ChildForm
ChildForm.MdiParent = Me
ChildForm.StartPosition =
FormStartPosition.Manual
Dim leftStart As Integer = 0
Dim topStart As Integer = 0
ChildForm.Location = New
Point(leftStart, topStart)
ChildForm.Show()
End Sub

Private Sub AppContainer_Load(ByVal


sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

60
HOTEL MANAGEMENT

End Sub
End Class

61
HOTEL MANAGEMENT

62
HOTEL MANAGEMENT

Imports nishu
Imports System.Data.OleDb
Public Class Login
Dim conn As OleDbConnection
Dim adp As OleDbDataAdapter
Dim ds As DataSet
Private Sub Login_Load(sender As
System.Object, e As System.EventArgs)
Handles MyBase.Load

End Sub

Private Sub OK_Click(ByVal sender As


System.Object, ByVal e As
System.EventArgs) Handles OK.Click
If (CheckUser()) Then
Dim ChildForm As New
AppContainer
ChildForm.StartPosition =
FormStartPosition.Manual
Dim leftStart As Integer = 0
Dim topStart As Integer = 0
ChildForm.Location = New
Point(leftStart, topStart)
ChildForm.Show()
Me.Hide()
Else

63
HOTEL MANAGEMENT

MessageBox.Show("Invalid
Authentication !")
UsernameTextBox.Focus()
End If

End Sub

Private Sub Cancel_Click(ByVal sender


As System.Object, ByVal e As
System.EventArgs) Handles Cancel.Click
Me.Close()
End Sub

Private Function CheckUser() As


Boolean
conn = New OleDbConnection()
conn.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=hm.mdb"
Dim i As Integer
adp = New OleDbDataAdapter("select
* from tbuser where username = @username
and userpassword = @userpassword and
userstatus = @userstatus", conn)
adp.SelectCommand.Parameters.Add("@usernam
e", OleDbType.VarChar, 50).Value =
UsernameTextBox.Text

64
HOTEL MANAGEMENT

adp.SelectCommand.Parameters.Add("@userpas
sword", OleDbType.VarChar, 50).Value =
UsernameTextBox.Text
adp.SelectCommand.Parameters.Add("@usersta
tus", OleDbType.VarChar, 50).Value = "Y"
conn.Open()
ds = New DataSet()
adp.Fill(ds)
Dim IsLogin As Boolean = False
For i = 0 To
ds.Tables(0).Rows.Count - 1
IsLogin = True
Next
adp.Dispose()
conn.Close()
Return IsLogin
End Function
End Class

65
HOTEL MANAGEMENT

66
HOTEL MANAGEMENT

Imports System.Data.OleDb
Public Class Hall_Book
Dim conn As OleDbConnection
Dim adp As OleDbDataAdapter
Dim cmd As OleDbCommand
Private Sub Hall_Book_Load(sender As
System.Object, e As System.EventArgs)
Handles MyBase.Load
conn = New OleDbConnection()
conn.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=hm.mdb"
End Sub
Private Sub Button1_Click(sender As
System.Object, e As System.EventArgs)
Handles Button1.Click
Dim r_id As Integer = getRowID()
cmd = New OleDbCommand()
cmd.Connection = conn
conn.Open()
cmd.CommandText = "insert into
tbhallbooking values (@ID, @b_name,
@b_address, @b_phone, @b_hallno,
@b_hallrent, @b_halltype, @b_hallfrom,
@b_hallto)"
cmd.Parameters.Add("@ID",
OleDbType.Integer).Value = r_id

67
HOTEL MANAGEMENT

cmd.Parameters.Add("@b_name",
OleDbType.VarChar, 50).Value =
txtname.Text
cmd.Parameters.Add("@b_address",
OleDbType.VarChar, 50).Value =
txtaddress.Text
cmd.Parameters.Add("@b_phone",
OleDbType.VarChar, 50).Value =
txtphoneno.Text
cmd.Parameters.Add("@b_hallno",
OleDbType.VarChar, 50).Value =
txtroomno.Text
cmd.Parameters.Add("@b_hallrent",
OleDbType.Integer).Value =
Convert.ToInt32(txtroomrent.Text)
cmd.Parameters.Add("@b_hallrent",
OleDbType.VarChar, 50).Value =
cmbroomtype.Text
cmd.Parameters.Add("@b_hallfrom",
OleDbType.VarChar, 50).Value =
txt_from.Text
cmd.Parameters.Add("@b_hallto",
OleDbType.VarChar, 50).Value = txt_to.Text

Try
Dim cnt As Integer =
cmd.ExecuteNonQuery()
If (cnt > 0) Then

68
HOTEL MANAGEMENT

MessageBox.Show("Record
Saved")
Else
MessageBox.Show("Invalid
input, please check entered data")
End If

Catch ex As Exception
MessageBox.Show("Invalid
input, please check entered data")
End Try

txt_from.Text = ""
txt_to.Text = ""
txtroomrent.Text = ""
txtroomno.Text = ""
txtname.Text = ""
txtphoneno.Text = ""
txtaddress.Text = ""
cmbroomtype.Focus()
conn.Close()
cmd.Dispose()
End Sub
Friend Function getRowID() As Integer
cmd = New OleDbCommand()
cmd.Connection = conn
conn.Open()

69
HOTEL MANAGEMENT

cmd.CommandText = "select max(ID)


from tbhallbooking"
Dim rowid As Integer
rowid = 1
Try
rowid =
Convert.ToInt32(cmd.ExecuteScalar())
rowid = rowid + 1
Catch ex As Exception
End Try
conn.Close()
cmd.Dispose()
Return rowid
End Function
End Class

70
HOTEL MANAGEMENT

71
HOTEL MANAGEMENT

Imports System.Data.OleDb

Public Class Hall_Updation


Dim conn As OleDbConnection
Dim adp As OleDbDataAdapter
Dim ds As DataSet
Dim cmd As OleDbCommand
Dim cnt As Integer

Private Sub up_room_Load(ByVal sender


As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
LoadData()
End Sub
Private Sub LoadData()
ListView1.Items.Clear()
Dim i As Integer
conn = New OleDbConnection()
conn.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=hm.mdb"
adp = New OleDbDataAdapter("select
* from tbhallbooking", conn)
ds = New DataSet()
adp.Fill(ds)
For i = 0 To
ds.Tables(0).Rows.Count - 1

72
HOTEL MANAGEMENT

ListView1.Items.Add(ds.Tables(0).Rows(i)
(0))

ListView1.Items(i).SubItems.Add(ds.Tables(
0).Rows(i)(1))

ListView1.Items(i).SubItems.Add(ds.Tables(
0).Rows(i)(3))

ListView1.Items(i).SubItems.Add(ds.Tables(
0).Rows(i)(4))
Next
adp.Dispose()
conn.Close()
End Sub

Private Sub Button1_Click(ByVal sender


As System.Object, ByVal e As
System.EventArgs) Handles btnupdate.Click
cmd = New OleDbCommand()
cmd.Connection = conn
conn.Open()
Try
cmd.CommandText = "update
tbhallbooking set b_name = @b_name,
b_address = @b_address, b_phone =

73
HOTEL MANAGEMENT

@b_phone, b_hallno = @b_hallno, b_hallrent


= @b_hallrent where ID = @id"
cmd.Parameters.Add("@b_name",
OleDbType.VarChar, 50).Value =
txtname.Text
cmd.Parameters.Add("@b_address",
OleDbType.VarChar, 50).Value =
txtaddress.Text
cmd.Parameters.Add("@b_phone",
OleDbType.VarChar, 50).Value =
txtphoneno.Text
cmd.Parameters.Add("@b_hallno",
OleDbType.VarChar, 50).Value =
txtroomno.Text
cmd.Parameters.Add("@b_hallrent",
OleDbType.Integer).Value =
Convert.ToInt32(txtroomrent.Text)
cmd.Parameters.Add("@ID",
OleDbType.Integer).Value =
Convert.ToInt32(ListView1.SelectedItems(0)
.Text)
cnt = cmd.ExecuteNonQuery()
If (cnt > 0) Then
MessageBox.Show("Record
Updated Sucessfully")
ResetData()

74
HOTEL MANAGEMENT

Else
MessageBox.Show("Error
while updating")
txtname.Focus()
End If
Catch ex As Exception
MessageBox.Show("Invalid
Input, check entered data")
ListView1.Focus()
End Try
cmd.Dispose()
conn.Close()

End Sub

Private Sub Button2_Click(ByVal sender


As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
ResetData()
End Sub
Private Sub ResetData()
LoadData()
txtname.Text = ""
txtaddress.Text = ""
txtaddress.Text = ""
txtphoneno.Text = ""
txtroomno.Text = ""
txtroomrent.Text = ""

75
HOTEL MANAGEMENT

txtname.Focus()
End Sub

Private Sub
ListView1_DoubleClick(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
ListView1.DoubleClick

adp = New OleDbDataAdapter("select


* from tbhallbooking where ID = " &
ListView1.SelectedItems(0).Text, conn)
ds = New DataSet()
adp.Fill(ds)
For i = 0 To
ds.Tables(0).Rows.Count - 1
txtname.Text =
ds.Tables(0).Rows(i)(1)
txtaddress.Text =
ds.Tables(0).Rows(i)(2)
txtphoneno.Text =
ds.Tables(0).Rows(i)(3)
txtroomno.Text =
ds.Tables(0).Rows(i)(4)
txtroomrent.Text =
ds.Tables(0).Rows(i)(5)
Next

76
HOTEL MANAGEMENT

ds.Dispose()
adp.Dispose()
End Sub

Private Sub Button3_Click(ByVal sender


As System.Object, ByVal e As
System.EventArgs) Handles btndel.Click
cmd = New OleDbCommand()
cmd.Connection = conn
conn.Open()
Try
cmd.CommandText = "delete from
tbhallbooking where ID = @id"
cmd.Parameters.Add("@ID",
OleDbType.Integer).Value =
Convert.ToInt32(ListView1.SelectedItems(0)
.Text)
cnt = cmd.ExecuteNonQuery()
If (cnt > 0) Then
MessageBox.Show("Record
deleted sucessfully")
ResetData()
Else
MessageBox.Show("Error
while updating")
txtname.Focus()
End If
Catch ex As Exception

77
HOTEL MANAGEMENT

MessageBox.Show("Invalid
input, check entered data")
ListView1.Focus()
End Try
cmd.Dispose()
conn.Close()
End Sub
End Class

78
HOTEL MANAGEMENT

79
HOTEL MANAGEMENT

Imports System.Data.OleDb
Public Class Room_Book
Dim conn As OleDbConnection
Dim adp As OleDbDataAdapter
Dim cmd As OleDbCommand

Private Sub Form1_Load(ByVal sender As


System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
conn = New OleDbConnection()
conn.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=hm.mdb"
End Sub

Private Sub Button1_Click(ByVal sender


As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim r_id As Integer = getRowID()
cmd = New OleDbCommand()
cmd.Connection = conn
conn.Open()
cmd.CommandText = "insert into
tbroombooking values (@r_id, @r_type,
@r_rent, @r_roomno, @r_name, @r_phoneno,
@r_address, @r_from, @r_to)"
cmd.Parameters.Add("@r_id",
OleDbType.Integer).Value = r_id

80
HOTEL MANAGEMENT

cmd.Parameters.Add("@r_type",
OleDbType.VarChar, 50).Value =
cmbroomtype.Text
cmd.Parameters.Add("@r_rent",
OleDbType.Integer).Value =
Convert.ToInt32(txtroomrent.Text)
cmd.Parameters.Add("@r_roomno",
OleDbType.VarChar, 50).Value =
txtroomno.Text
cmd.Parameters.Add("@r_name",
OleDbType.VarChar, 50).Value =
txtname.Text
cmd.Parameters.Add("@r_phoneno",
OleDbType.VarChar, 50).Value =
txtphoneno.Text
cmd.Parameters.Add("@r_address",
OleDbType.VarChar, 50).Value =
txtaddress.Text
cmd.Parameters.Add("@r_from",
OleDbType.VarChar, 50).Value =
txt_from.Text
cmd.Parameters.Add("@r_to",
OleDbType.VarChar, 50).Value = txt_to.Text

Try
Dim cnt As Integer =
cmd.ExecuteNonQuery()
If (cnt > 0) Then

81
HOTEL MANAGEMENT

MessageBox.Show("Record
Saved")
Else
MessageBox.Show("Invalid
input, please check entered data")
End If

Catch ex As Exception
MessageBox.Show("Invalid
input, please check entered data")
End Try

txt_from.Text = ""
txt_to.Text = ""
txtroomrent.Text = ""
txtroomno.Text = ""
txtname.Text = ""
txtphoneno.Text = ""
txtaddress.Text = ""
cmbroomtype.Focus()
conn.Close()
cmd.Dispose()

End Sub

Friend Function getRowID() As Integer


cmd = New OleDbCommand()
cmd.Connection = conn

82
HOTEL MANAGEMENT

conn.Open()
cmd.CommandText = "select
max(r_id) from tbroombooking"
Dim rowid As Integer
rowid = 1
Try
rowid =
Convert.ToInt32(cmd.ExecuteScalar())
rowid = rowid + 1
Catch ex As Exception
End Try
conn.Close()
cmd.Dispose()
Return rowid
End Function
End Class

83
HOTEL MANAGEMENT

84
HOTEL MANAGEMENT

Imports System.Data.OleDb
Public Class Room_Updation
Dim conn As OleDbConnection
Dim adp As OleDbDataAdapter
Dim ds As DataSet
Dim cmd As OleDbCommand
Dim cnt As Integer

Private Sub Room_Updation_Load(sender


As System.Object, e As System.EventArgs)
Handles MyBase.Load
LoadData()
End Sub
Private Sub LoadData()
ListView1.Items.Clear()
Dim i As Integer
conn = New OleDbConnection()
conn.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=hm.mdb"
adp = New OleDbDataAdapter("select
* from tbroombooking", conn)
ds = New DataSet()
adp.Fill(ds)
For i = 0 To
ds.Tables(0).Rows.Count - 1

85
HOTEL MANAGEMENT

ListView1.Items.Add(ds.Tables(0).Rows(i)
(0))

ListView1.Items(i).SubItems.Add(ds.Tables(
0).Rows(i)(4))

ListView1.Items(i).SubItems.Add(ds.Tables(
0).Rows(i)(5))

ListView1.Items(i).SubItems.Add(ds.Tables(
0).Rows(i)(3))
Next
adp.Dispose()
conn.Close()
End Sub

Private Sub btnupdate_Click(sender As


System.Object, e As System.EventArgs)
Handles btnupdate.Click
cmd = New OleDbCommand()
cmd.Connection = conn
conn.Open()
Try
cmd.CommandText = "update
tbroombooking set r_name = @r_name,
r_address = @r_address, r_phoneno =

86
HOTEL MANAGEMENT

@r_phoneno, r_roomno = @r_roomno, r_rent =


@r_rent where r_id = @r_id"
cmd.Parameters.Add("@r_name",
OleDbType.VarChar, 50).Value =
txtname.Text
cmd.Parameters.Add("@r_address",
OleDbType.VarChar, 50).Value =
txtaddress.Text
cmd.Parameters.Add("@r_phoneno",
OleDbType.VarChar, 50).Value =
txtphoneno.Text
cmd.Parameters.Add("@r_roomno",
OleDbType.VarChar, 50).Value =
txtroomno.Text
cmd.Parameters.Add("@r_rent",
OleDbType.Integer).Value =
Convert.ToInt32(txtroomrent.Text)
cmd.Parameters.Add("@r_id",
OleDbType.Integer).Value =
Convert.ToInt32(ListView1.SelectedItems(0)
.Text)
cnt = cmd.ExecuteNonQuery()
If (cnt > 0) Then
MessageBox.Show("Record
Updated Sucessfully")
ResetData()

87
HOTEL MANAGEMENT

Else
MessageBox.Show("Error
while updating")
txtname.Focus()
End If
Catch ex As Exception
MessageBox.Show("Invalid
Input, check entered data")
ListView1.Focus()
End Try
cmd.Dispose()
conn.Close()
End Sub

Private Sub btndel_Click(sender As


System.Object, e As System.EventArgs)
Handles btndel.Click
cmd = New OleDbCommand()
cmd.Connection = conn
conn.Open()
Try
cmd.CommandText = "delete from
tbroombooking where r_id = @id"
cmd.Parameters.Add("@r_id",
OleDbType.Integer).Value =
Convert.ToInt32(ListView1.SelectedItems(0)
.Text)
cnt = cmd.ExecuteNonQuery()

88
HOTEL MANAGEMENT

If (cnt > 0) Then


MessageBox.Show("Record
deleted sucessfully")
ResetData()
Else
MessageBox.Show("Error
while updating")
txtname.Focus()
End If
Catch ex As Exception
MessageBox.Show("Invalid
input, check entered data")
ListView1.Focus()
End Try
cmd.Dispose()
conn.Close()
End Sub

Private Sub Button2_Click(sender As


System.Object, e As System.EventArgs)
Handles Button2.Click
ResetData()
End Sub

Private Sub
ListView1_DoubleClick(sender As
System.Object, e As System.EventArgs)
Handles ListView1.DoubleClick

89
HOTEL MANAGEMENT

adp = New OleDbDataAdapter("select


* from tbroombooking where r_id = " &
ListView1.SelectedItems(0).Text, conn)
ds = New DataSet()
adp.Fill(ds)
For i = 0 To
ds.Tables(0).Rows.Count - 1
txtname.Text =
ds.Tables(0).Rows(i)(4)
txtaddress.Text =
ds.Tables(0).Rows(i)(6)
txtphoneno.Text =
ds.Tables(0).Rows(i)(5)
txtroomno.Text =
ds.Tables(0).Rows(i)(3)
txtroomrent.Text =
ds.Tables(0).Rows(i)(2)
Next
ds.Dispose()
adp.Dispose()
End Sub
Private Sub ResetData()
LoadData()
txtname.Text = ""
txtaddress.Text = ""
txtaddress.Text = ""
txtphoneno.Text = ""
txtroomno.Text = ""

90
HOTEL MANAGEMENT

txtroomrent.Text = ""
txtname.Focus()
End Sub
End Class

91
HOTEL MANAGEMENT

92
HOTEL MANAGEMENT

Imports System.Data.OleDb
Public Class UserSetup
Dim conn As OleDbConnection
Dim adp As OleDbDataAdapter
Dim ds As DataSet
Dim cmd As OleDbCommand
Dim cnt As Integer
Private Sub UserSetup_Load(sender As
System.Object, e As System.EventArgs)
Handles MyBase.Load
LoadData()
End Sub
Private Sub LoadData()
ListView1.Items.Clear()
Dim i As Integer
conn = New OleDbConnection()
conn.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=hm.mdb"
adp = New OleDbDataAdapter("select
* from tbuser", conn)
ds = New DataSet()
adp.Fill(ds)
For i = 0 To
ds.Tables(0).Rows.Count - 1

ListView1.Items.Add(ds.Tables(0).Rows(i)
(0))

93
HOTEL MANAGEMENT

ListView1.Items(i).SubItems.Add(ds.Tables(
0).Rows(i)(0))
Next
adp.Dispose()
conn.Close()
End Sub

Private Sub Save_Click(sender As


System.Object, e As System.EventArgs)
Handles Save.Click
cmd = New OleDbCommand()
cmd.Connection = conn
conn.Open()
Try
cmd.CommandText = "insert
into tbuser values (@username,
@userpassword, @userstatus)"
cmd.Parameters.Add("@username",
OleDbType.VarChar, 50).Value =
txtusername.Text
cmd.Parameters.Add("@userpassword",
OleDbType.VarChar, 50).Value =
txtpassword.Text
cmd.Parameters.Add("@userstatus",

94
HOTEL MANAGEMENT

OleDbType.VarChar, 50).Value =
cmduserstatus.Text
cnt = cmd.ExecuteNonQuery()
If (cnt > 0) Then
MessageBox.Show("Record
Saved Sucessfully")
ResetData()
Else
MessageBox.Show("Error
While Saving")
txtusername.Text = ""
End If
Catch ex As Exception
MessageBox.Show("Invalid
Input, check entered data")
ListView1.Focus()
End Try
cmd.Dispose()
conn.Close()
End Sub

Private Sub ResetData()


LoadData()
txtpassword.Text = ""
txtusername.Text = ""
cmduserstatus.Text = ""
txtusername.Enabled = True
txtusername.Focus()

95
HOTEL MANAGEMENT

End Sub

Private Sub btnupdate_Click(sender As


System.Object, e As System.EventArgs)
Handles btnupdate.Click
cmd = New OleDbCommand()
cmd.Connection = conn
conn.Open()
Try
cmd.CommandText = "update
tbuser set userpassword = @userpassword,
userstatus = @userstatus where username =
@username"
cmd.Parameters.Add("@userpassword",
OleDbType.VarChar, 50).Value =
txtpassword.Text
cmd.Parameters.Add("@userstatus",
OleDbType.VarChar, 50).Value =
cmduserstatus.Text
cmd.Parameters.Add("@username",
OleDbType.VarChar, 50).Value =
txtusername.Text
cnt = cmd.ExecuteNonQuery()
If (cnt > 0) Then
MessageBox.Show("Record
Updated Sucessfully")

96
HOTEL MANAGEMENT

ResetData()
Else
MessageBox.Show("Error
while updating")
txtusername.Focus()
End If
Catch ex As Exception
MessageBox.Show("Invalid
Input, check entered data")
ListView1.Focus()
End Try
cmd.Dispose()
conn.Close()
End Sub

Private Sub btndel_Click(sender As


System.Object, e As System.EventArgs)
Handles btndel.Click
cmd = New OleDbCommand()
cmd.Connection = conn
conn.Open()
Try
cmd.CommandText = "delete from
tbuser where username = @username"
cmd.Parameters.Add("@username",
OleDbType.VarChar, 50).Value =
txtusername.Text
cnt = cmd.ExecuteNonQuery()
97
HOTEL MANAGEMENT

If (cnt > 0) Then


MessageBox.Show("Record
Deleted Sucessfully")
ResetData()
Else
MessageBox.Show("Error
while Deleting")
txtusername.Focus()
End If
Catch ex As Exception
MessageBox.Show("Invalid
Input, check entered data")
ListView1.Focus()
End Try
cmd.Dispose()
conn.Close()
End Sub

Private Sub Button2_Click(sender As


System.Object, e As System.EventArgs)
Handles Button2.Click
ResetData()
End Sub

Private Sub
ListView1_DoubleClick(sender As
System.Object, e As System.EventArgs)
Handles ListView1.DoubleClick

98
HOTEL MANAGEMENT

adp = New OleDbDataAdapter("select


* from tbuser where username = @username",
conn)
adp.SelectCommand.Parameters.Add("@usernam
e", OleDbType.VarChar, 50).Value =
ListView1.SelectedItems(0).Text
ds = New DataSet()
adp.Fill(ds)
For i = 0 To
ds.Tables(0).Rows.Count - 1
txtusername.Text =
ds.Tables(0).Rows(i)(0)
txtpassword.Text =
ds.Tables(0).Rows(i)(1)
cmduserstatus.Text =
ds.Tables(0).Rows(i)(2)
txtusername.Enabled = False
txtpassword.Focus()
Next
ds.Dispose()
adp.Dispose()
End Sub
End Class

99
HOTEL MANAGEMENT

Bibliography

Before going to prepare this project report. We have collected lot of information from
many sources.
We have studied various book and we internet for difference topic that are covered by us
in our project reports

Books:-
Web Technologies- 11(LPU)

Event driven programming

Electronics Sites:-
http://google.com

http://answer.com

100
HOTEL MANAGEMENT

________________ Date: _____________

(Signature of Student)

__________________________

(Signature of Project In charge)

101
HOTEL MANAGEMENT

Date: _____________

Approved YES NO

______________________

(Signature of Centre Head)

Date: _____________

102

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