Sei sulla pagina 1di 95

A

PROJECT REPORT ON

HOTEL MANAGEMENT
Submitted in Partial Fulfilment of Requirement
For the Degree of

Bachelor of computer application

M.J.P ROHILKHAND UNIVERSITY, BAREILLY

SESSION 2014-15
PROJECT GUIDE:-

SUBMITTED BY:-

MR. ASIF MUSTAFA

RIZWAN MUSTAFA
BCA 6TH SEM

(LECTUReR)
(COMPUTER APPLICATION DEPtt.)

ROLL NO. 131110012

KHUSRO MEMORIAL DEGREE COLLEGE


C.B GANJ BAREILLY
1

Certificate
This is to certify that the project report
entitled HOTEL MANAGEMENT SYSTEM
has

been

completed

MUSTAFA.

RIZWAN

by

Who is the student of BCA

(Bachelor of Computer Application) session


2014-2015

at

department

of

Computer

Science of Khusro Memorial Degree College


c.b. Ganj Bareilly .
This

is

to

certify

that

the

above

statements are correct to the best of


my knowledge and belief.

Project Guide-

MR. ASIF MUSTAFA

ACKNOWLEDGEMENT
Computers are magnificent tools for the realization of our
dreams, but no machine can replace the human spark of spirit,
compassion, love, and understanding. Thanks God, the
merciful and the passionate, for providing us the opportunity
to step in the excellent world of computer science.
Thanks goes to our project guide MR.ASIF MUSTAFA

MR. VEER PAL SAHU (H.O.D of BCA department),


MR.SYED MUSHARRAF ALI Lecturer, Department of
Computer Science, Her valuable guidance, advice, motivation
and patience helped us all the time of writing and coding of
this project. We also wish to Thanks to DR. ASIF KHAN

(CONVENER) Department of Computer Science, for his


sincere and timely cooperation during this period. His kind
support and guidance have been of great value in this project.
This work would not be possible without his help.
We also convey our sincere thanks to MR. VEER PAL SAHU
(H.O.D of BCA department), for all the facilities provided to us
in carrying out this project and motivation. They had given as
during the progress of this project.
3

We are also grateful to our entire group members for their


valuable suggestions and words for inspiration for our project
work i.e. HOTEL MANAGEMENT SYSTEM remain
thankful to the entire staff of department of Computer Science.
Lastly, I offer my regards and blessing to all of those who
supported me in any respect during the completion of this
project work.

Thank You

(RIZWAN MUSTAFA)
PREFACE

The main objective of this project is to computerize


the check in and checkout of customers. As the work is done
manually there is a lot of paperwork and the data are scattered
in various files so there is a lot of chances for the loss of
information. For decreasing the paper work so that it may save
time we need to make the system computerize. Due to this the
work will be done much faster in comparision to manual work,
which will be done much faster in comparison to manual work,
which will be error free. Computerization is done for the
follwing main purpose:
Computerization the sales and finance accounts system
Reducing the paper work
Time Management
Accuracy and portability
Speed up decision-making
To control the operation
Error free operation

TABLE OF CONTENTS
1. INTRODUCTION
OPERATION ENVIRONMENT
OBJECTIVE

7
8
9

2.VISUAL BASIC

10

3. PROBLEM DEFINITION

11

4. SOFTWARE DESIGN

12

5. FEASIBILITY STUDY

12

6. SOFTWARE REQUIREMENTS SPECIFICATION

14-15

7. DEFICIENCY OF CURRENT SYSTEM

16-18

8. SOFTWARE ENGINEERING PROCESS MODEL USED

19-21

9. VALIDATION CHECKS

22-23

10.DATA FLOW DIAGRAM

24-32

11. TABLE

33-37

12. SNAP SHOT

38-51

13. CODING

52-85

14. SYSTEM TESTING

86-89

15. EVALUATION

90-92

16. CONCLUSION

93
6

17. REFERENCES

94

INTRODUCTION OF HOTEL
A hotel is an establishment that provides lodging paid on
a short term basis. Facilities provided may range from a basic bed and
storage for clothing , to luxury features like en-suite bathrooms .Larger
hotels may provided additional guest facilities such as a swimming pool,
business centre, childcare , conference facilities and social function
services.
Hotel rooms are usually numbered (or named in some smaller hotels
and B&Bs) to allow guests to identify their room. Some hotels offer
meals as part of a room and board arrangement. In the United
Kingdom , a hotel is required by law to serve food and drinks to all
guests within certain stated hours. In Japan, capsule hotels provided a
minimized amount of room space and shared facilities.
An upscale full service hotel facilities that offers luxury amenities , full
service accommodation ,on-site full service restaurant(s),and the highest
level of personalized and professional service. Luxury Hotels are
normally classified with at least a four Diamond or five Diamond status
or a four or Five Star rating depending on the country and local
classification standards . Examples may include : Waldorf Astoria , Four
Seasons, Conrad ,Fairmont ,and Ritz Carlton.
Full service hotels often contain upscale full-service facilities with a large
volume of full service accommodation

, on-site full service

restaurant(s) ,and a variety of on-site amenities such as swimming


pools , a health club, childrens activities ,ballrooms ,on-site conference
facilities ,and other amenities .
Examples may include: InterContinental ,Starwood-Westin, Hilton,
Marriott, and Hyatt hotels
7

OPERATION ENVIRONMENT

PROCESSOR

DUAL CORE CORE,2

OPERATING SYSTEM

WINDOW98, WINDOW XP, &

MEMORY

WINDOW 7,
1GB RAM OR ROME

HARD DISK SPACE

MINIMUM 60GB DATABASE


USAGE FOR FUTURE

DATABASE

MS ACCESS, SQL SERVER 2005

OBJECTIVE
Our team has decided to work on a PROJECT on a very
interesting topic HOTEL MANGEMENT SYSTEM that keeps
all the maintenance records of entry data. The system will be
very much prevalent in coming times to help the users in their
operations in connection with security.
Our objectives here is to automate all above activities used in
software in user friendly manner to entertain user and given
rise to their knowledge and also to eliminate the difficulties.

It was very encouraging, motivating and of all


purpose an entirely new experience for us to do better in
future.

INTRODUCTION TO VISUAL BASIC


VISUAL BASIC is a high level programming language which
evolved from the earlier DOS version called BASIC. BASIC means Beginners'
All-purpose Symbolic Instruction Code. It is a very easy programming
language to learn. The code look a lot like English Language. Different
software companies produced different versions of BASIC, such as Microsoft
QBASIC, QUICKBASIC, GW BASIC ,IBM BASICA and so on. However, people
prefer to use Microsoft Visual Basic today, as it is a well developed
programming language and supporting resources are available everywhere.
Now, there are many versions of VB exist in the market, the most popular one
and still widely used by many VB programmers is none other than Visual
Basic 6. We also have VB.net, VB2005, VB2008 and the latest VB2010. Both
Vb2008 and VB2010 are fully object oriented programming (OOP) language.

History of visual basic:Alan cooper is considered the father of visual basic.


In 1987, then director of application of software for coactive computing
corporation wrote a program called Ruby that delivered visual programming
to the average programmer/user.
VB 1.0 was introduced in 1991. The Drag and drop design for creating
the user interface is derived form developed by Alan cooper and his
company called tripod.
Microsoft contracted with cooper and his associates to develop tripod
in to a program able form system for window 3.0 under the code Ruby. Tripod
did not include a programming language at all.
Microsoft decided to combine ruby with the basic language to create
visual basic.

10

Visual basic can used in a number of different areas, for Example:


education, Engineering, Research, Medicine, Business, Commerce Marketing
and sales, Accounting, Consulting, Law, Science.

PROBLEM DEFINITION
Our project attempts to replace the tedious and time space
consuming paper and pen work with the easy to use, time, space
saving computerized system.
When we start to work on this project we thought to give
emphasis only on Hotel Management System. When we want to
collect data from companies/colleges. We notice numbers of
shortcomings in the existing system.
After passing all the phase of a software development, we
were able to fulfil the shortcoming of the Hotel Management
System.
Simple interface of the system let one to work easily. All the
authority and security of the software let one to work easily. All the
authority and security if the software highly checked.

According to the working condition and requirements we have


of Hotel Management System.

11

SOFTWARE DESIGN
OBJECTIVE OF DESIGN:

It provides better and efficient service to members.


Reduce the workload of employee.
Faster retrieval of information about the desired book.
Provide facility for proper monitoring reduces paper work

and provide data security.


All details will be available on a click.
Fast access to database (Quick transaction) less error.
More storage capacity.
Search facility.
Look and Feel Environment.

FEASIBILITY STUDY
A procedure that identifies, describes and evaluates
candidate systems and selects the best system for the job is
called as Feasibility Study.
Three key considerations are involved in the feasibility analysis:
1. Technical Feasibility
2. Economic Feasibility
3. Behavioural Feasibility
12

1. TECHNICAL FEASIBILITY
The use of Microsoft Visual Studio .NET makes form design
easy and convenient. The project can be run on any system with
minimum requirements. It reduces data entry errors because of data
entry validation, it can be easily handled by any user, and it also helps in
faster form design. Also the project database though developed in SQL
SERVER 2005, it is very easy to operate. Hence the project is technically
feasible.

2. ECONOMIC FEASIBILITY
Cost benefit analysis is very important in deciding whether the project is
economically feasible or not. It is alone sufficient to save our time and
money. It is one time investment and does not require regular
maintenance. Through cost benefit analysis it was concluded that the
benefits outweigh costs and thus the project is economically feasible.

3.BEHAVIOURAL FEASIBILITY
Behavioural feasibility determines how much effort will go into
educating, selling and training the user staff on a candidate system. The
project was also evaluated to be behaviourally feasible as it is very userfriendly and hardly needs any extra efforts to educate user for its utility
and functioning.

13

SOFTWARE REQUIREMENT SPECIFICATION


The SRS is often referred to as the parent document
because all subsequent project management documents, such as design
specifications, statements of work, software architecture specifications,
testing and validation plans, and documentation plans, are related to it.
The SRS document itself states in precise and explicit language those
function and capabilities software. Its important to note that an SRS
contains functional and non functional requirement only; it doesnt offer
design suggestion, possible solutions to technology or business issues, or
any other information other than what the development team
understands the customers system requirements to be.

A well-designed, well-written SRS accomplish four major goals:


It provides feedback to the customer. An SRS is the customers assurance
that the development organization understands the issues or problems
to be solved and the behaviour necessary to address those problems.
It decomposes the problem into component parts. The simple
act of writing down software requirement in a well-designed format
organizes information places border surround the problem, solidifies
ideas, and helps break down the problem into its component part in an
orderly fashion.
It serves as a product validation check. The SRS also serves as
the parent document for testing and validation strategies that will be
applied to the requirements for verification.

14

NEED FOR SRS


The basic purpose of software requirements is to bridge the
communication gap between the customer and a user. SRS is a medium
through which the client and the user need i.e. actually defined. A SRS
establishes the basic of agreement between the user & the supplier on
what product will do? The basic foe the agreement is frequently obliged
into a legal contact between the user and developer. Through the SRS the
client clearly describes.
What is the expected from the developer and the developer clearly
understand?

What capability to build in software?


A SRS provides a reference or validation of the final product i.e.
SRS helps the user to determine of the software needs the clients
requirements. Without a proper SRS there is no way a user can
determine if the software being delivered is what cost ordered and there
is no way requirements have been fulfilled.
SRS will most likely manifesto. As an error in the final system
implements SRS. After all the SRS document specifies a long system
the even a correct not satisfy the user. Yearly , if we want quality
software that has few errors we must begin with high quality software.
High quality SRS reduces the development cost. A quality of
SRS has impact on the product. We have already seen that error
increases almost exponentially as the time progresses. A requirement
error is dedicated and removed after the system has been developed can
cost up to 100times. More than removing, it during the requirement

15

phase. Clearly, we can have a tremendous reduction in the project by


reducing errors in the SRS.
Requirement specification is an attempt to develop.
USER FEINDLLLY SOFTWAR to help users. First of all we need to
determine exact requirements of the users so that the software thus we
are going to develop would them in the best possible manner as it can
users would not face the problems that they were facing with the
previous system.

Requirements specification document clearly and


accurately list all the needs and requirement of the users and
also the problems that users were facing in previous system

DEFICIENCY OF CURRENT SYSTEM


Lack of quick information:
In the current system there is lack of quick information. If
someone wants information about any particular topic then it takes lots
of time to give him/her that information. For getting that information
he/she will to wait for long time which can also be the disadvantage.

Lack of security:
In the current system all the transaction are handled
manually so it is not very much safe on account of keeping records of
keeping record secured so that anyone cannot make any wrong
manipulation with that and also cannot spoil the record. The files in
which information is stored can be stolen or destroyed by the third party.
They may also be damaged due to the natural problems such they may
16

caught fire or rates may also bite them. It is also very easy for one
information stored in the file.

Increasing the cost of stationary:


In current system all the details are kept manually so it is
increases the cost of stationary.

Information overload:
In current system there is information overload because all the
processing of transaction and records keeping system is manual. In
current system all the details of regarding retailers, inventory, billing and
orders are kept manually, so it increases the number of files for keeping
all these records.

Data redundancy:
It means that same data fields appear in many files and often
in different formats. In manual system. It poses quit a big problem
because the data has to be maintained in large volumes but in our
system. This problem can be overcome by providing the condition if the
data entered is duplicate. It will not be entered otherwise updating will
take place.

Difficulty in accessing the data:

17

In manual system, searching information is time


consuming but in our system any information can be accessed by
providing the primary key.

SOFTWARE REQUIREMENTS
Operating system- Windows 98 is used as the operating
system as it is stable and supports more features and is
more users friendly.
.NET Framework 2.0 / 3.5.
Database SQL Server 2005- SQL Server 2005 is used as
database as it easy to maintain and retrieve records by
simple queries which are in English language which are
easy to understand and easy to write.

HARDWARE REQUIREMENTS
Intel dual core is used as a processor because it is fast
than other processors to provide reliable and stable and
we can run our pc for long time.
By using this processor we can keep on developing our
project without any worries.
Ram 1 GB is used as it will provide fast reading and
writing capabilities and will in turn support in
processing.
18

SOFTWARE ENGINEERING PROCESS MODEL


USED
The waterfall model shows a process, where developers are to
follow these phases in order:
I.
II.
III.
IV.
V.
VI.

Requirements specification (Requirements analysis)


Software Design
Integration
Testing (or Validation)
Deployment (or Installation)
Implementation & Maintenance

I. Requirements Specification:
A Software Requirements Specification is a complete
description of the behaviour of a system to be developed. It
includes a set of use cases that describe all the interactions the
users will have with the software.
We studied the requirement and specification provided by
client & list out all the functional requirement of project that
would be implemented from our side. We also suggest client
some good functionality like contact import.

19

II. Software design:


Software design is a process of problem solving and
planning for a software solution. After the purpose and
specifications of software are determined, software developers
will design or employ designers to develop a plan for a
solution.
We have divided the project into small modules and plan how
we can design and implement the module as per the client
expectation. First we have plan a database scheme of project,
which would help us to go in correct flow, we have also design
the DFD (Data Flow Design) to implement the website.

III. System integration:


System integration is the bringing together of the
component subsystems into one system and ensuring that the
subsystems function together as a system. In information
technology, systems integration is the process of linking
together different computing systems and software applications
physically or functionally, to act as a coordinated whole. We
have complete knowledge of all interfaces that would include
on our project. It includes interfaces between Modules,
Database, Server, and between the other system API
(Application program interface), which would work with. For a
system to be successfully implemented and used, the elements
like DB, files/function must be in place and functioning
correctly.

20

IV. Software testing:


Software testing is an investigation conducted to
provide stakeholders with information about the quality of the
product or service under test. Software testing also provides an
objective, independent view of the software to allow the
business to appreciate and understand the risks of software
implementation. Test techniques include, but are not limited to,
the process of executing a program or application with the
intent of finding software bugs (errors or other defects).
We have checked the accuracy, completeness, consistency,
spelling and accessibility of project. These areas are the first
things judged by the user. Users must have the best possible
experience with our project.

V. Software deployment:
Software deployment is all of the activities that make a
software system available for use. The general deployment
process consists of several interrelated activities with possible
transitions between them. These activities can occur at the
producer site or at the consumer site or both. Because every
software system is unique, the precise processes or procedures
within each activity can hardly be defined. Therefore,
"deployment" should be interpreted as a general process that has
to be customized according to specific requirements or
characteristics.
21

VII. Implementation & Maintenance:


The Maintenance phase is the longest phase of the
SDLC. In this phase the software is updated to:
-Fulfil the changing customer need.
-Adapt to accommodate change in the external environment.
-Correct errors and oversights previously undetected in the
testing phase.
-Enhance the efficiency of the software.

VALIDATION CHECKS
Under validation we have provided certain constraints
and primary keys to few fields of the tables of the database
used in application. This validation made at database level is
listed below:

Required Field Validation:


we use require field for fill the information compulsory
in the project without this validation the data will not be
submitted in the project.

Not null:
22

Not null constraint is used restrict field to have null


values. Few fields in our database are mandatory to fill.

Numeric only:
Numeric only constraints restrict field to have numeric
values only. Otherwise it violates the rule.

Character only:
It restricts the field to accept only character value.

Date:
The valid date with valid format should be enter in the
given textbox.

Email:
The @ Symbol is required in this field otherwise it will
not work properly

23

DATA FLOW DIAGRAM

24

DATA FLOW DIAGRAM

25

CONTEXT LEVEL DFD HOTEL MANAGEMENT


SYSTEM

26

DATA FLOW DIAGRAM OPENING A ROOM

27

DATA FLOW DIAGRAM CHECK-IN OF A NEW


CUSTOMER

28

DATA FLOW DIAGRAM CHECK-OUT OF CUSTOMER

Update Table
process

29

DATA FLOW DIAGRAM LISTING OF CUSTOMERS

30

DATA FLOW DIAGRAM BILL OF CUSTOMER

Processing

4
Close
Database

3
Computer Bills

Cash
CUSTOMER

31

DATA FLOW DIAGRAM LIST OF ALL RECORDS

32

TABLES

33

CHANGE PASSWORD

34

NEW CUSTOMER DETAIL

35

CUSTOMER DETAIL

36

PARKING DETAIL TABLE

37

FORM & IMAGE

38

SPLASH FORM IMAGE

39

LOGIN IMAGE

40

FORGET PASSWORD IMAGE

41

CHANGE PASSWORD IMAGE

42

MAIN FORM IMAGE

43

ADD CUSTOMER DETAIL IMAGE

44

CHECKIN DETAIL IMAGE

45

ROOM DETAIL IMAGE

46

PARKING IMAGE

47

FOOD MENU IMAGE

48

CHECKOUT DETAILS IMAGE

49

CHECKOUT IMAGE

50

CHECKOUT BILL IMAGE

51

CODING

52

SPLASH CODING
using
using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Form12 : Form
{
public Form12()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
progressBar1.Value = progressBar1.Value+1;
if (progressBar1.Value == 100)
{
timer1.Enabled = false;
Form1 f1 = new Form1();
f1.Show();
this.Hide();

}
}

}
}

53

LOGIN FORM CODING


using
using
using
using
using
using
using
using
using
using

System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Data.SqlClient;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
System.Drawing.Imaging;
System.IO;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
SqlConnection con;
SqlCommand cmd;
SqlDataReader dr;
string cs = "Data Source=localhost;Initial Catalog=HMS;User ID=sa";
public Form1()
{
InitializeComponent();
}

private void linkLabel1_LinkClicked_1(object sender,


LinkLabelLinkClickedEventArgs e)
{
new Form14().ShowDialog();
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
MessageBox.Show("Please enter user name", "Input Error",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
textBox1.Focus();
return;
}
if (textBox2.Text == "")
{
MessageBox.Show("Please enter password", "Input Error",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
textBox2.Focus();
return;
}
else
{
try
{
con = new SqlConnection(cs);
con.Open();
string str = "select * from login where user_name='" +
textBox1.Text + "' and password='" + textBox2.Text + "'";
cmd = new SqlCommand(str, con);
dr = cmd.ExecuteReader();
if (dr.Read())
{

54

MessageBox.Show("login Successfull");
Form3 f3 = new Form3();
f3.Show();
this.Hide();
}
else
{
MessageBox.Show("Check Username or Password", "Input Error",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}

}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}

55

FORGET PASSWORD CODING


using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Data.SqlClient;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
System.Drawing.Imaging;
System.IO;

namespace WindowsFormsApplication1
{
public partial class Form14 : Form
{
SqlConnection con;
SqlCommand cmd;
SqlDataReader dr;
string cs = "Data Source=localhost;Initial Catalog=HMS;User ID=sa";
string s1, s2;
public Form14()
{
InitializeComponent();
}
private void button3_Click(object sender, EventArgs e)
{
try
{
con = new SqlConnection(cs);
con.Open();
string qr = "select * from security where security_question='" +
comboBox1.Text + "'";
cmd = new SqlCommand(qr, con);
dr = cmd.ExecuteReader();
if (dr.Read())
{
s1 = dr[0].ToString();
s2 = dr[1].ToString();
}

SqlConnection con2 = new SqlConnection(cs);


con2.Open();
string qr2 = "select * from security where security_question='" +
comboBox1.Text + "'";
cmd = new SqlCommand(qr2, con2);
dr = cmd.ExecuteReader();
if (dr.Read())
{
s1 = dr[0].ToString();
s2 = dr[1].ToString();
}

56

SqlConnection con3 = new SqlConnection(cs);


con3.Open();
string qr3 = "select * from security where security_question='" +
comboBox1.Text + "'";
cmd = new SqlCommand(qr3, con3);
dr = cmd.ExecuteReader();
if (dr.Read())
{
s1 = dr[0].ToString();
s2 = dr[1].ToString();
}
if (comboBox1.Text == s1 && textBox2.Text == s2)
{
SqlConnection con4 = new SqlConnection(cs);
con4.Open();
string qr4 = "select Password from login where user_name='" +
textBox1.Text + "'";
cmd = new SqlCommand(qr4, con4);
dr = cmd.ExecuteReader();
if (dr.Read())
{
MessageBox.Show(dr[0].ToString());
con3.Close();
}
}
else
{
MessageBox.Show("wrong answer");
}

}
catch (Exception A)
{
MessageBox.Show(A.Message);
}

private void button2_Click(object sender, EventArgs e)


{
this.Close();
}

57

CHANGE PASSWORD CODING


using
using
using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
System.Data.SqlClient;

namespace WindowsFormsApplication1
{
public partial class Form2 : Form
{
SqlConnection con;
SqlCommand cmd;
SqlDataReader dr;
string cs = "Data Source=localhost;Initial Catalog=HMS;User ID=sa";
String s1, s2;
public Form2()
{
InitializeComponent();
}
private void button3_Click_1(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(cs);
con.Open();
string sql = "select * from login";
cmd = new SqlCommand(sql, con);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
s1 = dr[0].ToString();
s2 = dr[1].ToString();
}
if (textBox1.Text == s1)
{
if (textBox2.Text == s2)
{
if (textBox3.Text != "" && textBox4.Text != "")
{
if (textBox3.Text == textBox4.Text)
{
SqlConnection con1 = new SqlConnection(cs);
con1.Open();
string str1 = "update login set password='" +
textBox4.Text + "'";
SqlCommand cmd1 = new SqlCommand(str1, con1);
cmd1.ExecuteNonQuery();
MessageBox.Show(" Password Successful change");
}
else
MessageBox.Show("Plese Check Your Confirm Password. . . .

58

.");
}
else
MessageBox.Show("Please Enter New and Confirm Password. . . .
.");

}
else
MessageBox.Show("Plese Enter Correct Password. . . . .");
con.Close();

}
else
MessageBox.Show("Plese select Correct user type. . . . .");
con.Close();

private void button2_Click_1(object sender, EventArgs e)


{
this.Close();
}
}
}

59

MAIN FORM CODING


using
using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
private void button12_Click(object sender, EventArgs e)
{
Form4 f4 = new Form4();
f4.ShowDialog();
}
private void button13_Click(object sender, EventArgs e)
{
Form5 f5 = new Form5();
f5.ShowDialog();
}

private void button15_Click_1(object sender, EventArgs e)


{
Form7 f7 = new Form7();
f7.ShowDialog();
}
private void button16_Click_1(object sender, EventArgs e)
{
Form8 f8 = new Form8();
f8.ShowDialog();
}
private void button17_Click_1(object sender, EventArgs e)
{

Form9 f9 = new Form9();


f9.ShowDialog();

60

private void button1_Click_1(object sender, EventArgs e)


{
Form10 f10 = new Form10();
f10.ShowDialog();
}
private void button19_Click_1(object sender, EventArgs e)
{
this.Close();
Form1 f = new Form1();
f.Show();

private void button2_Click(object sender, EventArgs e)


{
new Form2().ShowDialog();
}
private void button3_Click(object sender, EventArgs e)
{
new Form6().ShowDialog();
}
}

61

ADD CUSTOMER DETAIL CODING


using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Data.SqlClient;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
System.Drawing.Imaging;
System.IO;

namespace WindowsFormsApplication1
{
public partial class Form4 : Form
{
SqlConnection con = null;
SqlCommand cmd = null;
SqlDataReader dr = null;
string fi;
string cs = "Data Source=localhost;Initial Catalog=HMS;User ID=sa";
public Form4()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
if (textBox1.Text.Length == 0 || textBox2.Text.Length == 0 || textBox3.Text.Length ==
0 || comboBox1.Text.Length == 0 || dateTimePicker1.Text.Length == 0 || textBox4.Text.Length
== 0 || textBox5.Text.Length == 0 || textBox6.Text.Length == 0 || textBox7.Text.Length == 0
|| textBox8.Text.Length == 0 || textBox9.Text.Length == 0 || textBox10.Text.Length == 0)
{
MessageBox.Show("Please Fill All Entries");
}
else
{
try
{
con = new SqlConnection(cs);
con.Open();
string str = "insert into customer_detail values('" + textBox1.Text + "','" +
textBox2.Text + "','" + textBox3.Text + "','" + comboBox1.Text + "','" + dateTimePicker1.Text
+ "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "','" + textBox7.Text +
"','" + textBox8.Text + "','" + textBox9.Text + "','" + textBox10.Text + "')";
cmd = new SqlCommand(str, con);
cmd.ExecuteNonQuery();
MessageBox.Show("Record Submitted");

}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}

62

private void button1_Click(object sender, EventArgs e)


{

try
{
con = new SqlConnection(cs);
con.Open();
string st = "select isnull(max(customer_id),0)+001 from
customer_detail";
cmd = new SqlCommand(st, con);
int sr = Convert.ToInt32(cmd.ExecuteScalar());
textBox1.Text = Convert.ToString(sr);
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}

private void button3_Click(object sender, EventArgs e)


{
this.Close();
Form3 f = new Form3();
f.Show();
}
private void textBox8_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsNumber(e.KeyChar) | char.IsControl(e.KeyChar))
e.Handled = false;
else
e.Handled = true;
}
private void Form4_Load(object sender, EventArgs e)
{
}
}

63

CHECKIN DETAILS CODING


using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Data.SqlClient;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
System.Drawing.Imaging;
System.IO;

namespace WindowsFormsApplication1
{
public partial class Form5 : Form
{
SqlConnection con = null;
SqlCommand cmd = null;
SqlDataReader dr = null;
string fi;
string cs = "Data Source=localhost;Initial Catalog=HMS;User ID=sa";
string s1,s2;
public Form5()
{
InitializeComponent();
}
private void button8_Click(object sender, EventArgs e)
{
this.Close();
Form3 f = new Form3();
f.Show();
}
private void button1_Click(object sender, EventArgs e)
{
}
private void button4_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(cs);
con.Open();
string sql = "select * from check_in";
cmd = new SqlCommand(sql, con);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
s1 = dr[10].ToString();
s2 = dr[0].ToString();
}
if (comboBox1.Text == s1)
{
if (textBox1.Text == s2)
{
MessageBox.Show("room is already reserve");

64

else
{
if (textBox1.Text.Length == 0 || textBox2.Text.Length == 0 || textBox3.Text.Length
== 0 || textBox4.Text.Length == 0 || textBox5.Text.Length == 0 || textBox6.Text.Length == 0
|| numericUpDown1.Text.Length == 0 || numericUpDown2.Text.Length == 0 ||
dateTimePicker1.Text.Length == 0 || textBox7.Text.Length == 0 || comboBox1.Text.Length ==
0 || comboBox2.Text.Length == 0 || comboBox3.Text.Length == 0 || textBox8.Text.Length ==
0 || textBox9.Text.Length == 0)
{
MessageBox.Show("Please Fill All Entries");
}
else
{
try
{
con = new SqlConnection(cs);
con.Open();
string str = "insert into check_in values('" + textBox1.Text + "','" +
textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" +
textBox6.Text + "','" + numericUpDown1.Text + "','" + numericUpDown2.Text + "','" +
dateTimePicker1.Text + "','" + textBox7.Text + "','" + comboBox1.Text + "','" +
comboBox2.Text + "','" + comboBox3.Text + "','" + textBox8.Text + "','" + textBox9.Text +
"')";
cmd = new SqlCommand(str, con);
cmd.ExecuteNonQuery();
MessageBox.Show("Record Submitted");

}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

}
private void textBox7_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsNumber(e.KeyChar) | char.IsControl(e.KeyChar))
e.Handled = false;
else
e.Handled = true;
}
private void textBox8_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsNumber(e.KeyChar) | char.IsControl(e.KeyChar))
e.Handled = false;
else
e.Handled = true;
}
private void textBox9_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsNumber(e.KeyChar) | char.IsControl(e.KeyChar))
e.Handled = false;

65

else
e.Handled = true;
}
private void button7_Click(object sender, EventArgs e)
{
new Form13().ShowDialog();

}
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
string str = Convert.ToString(comboBox1.SelectedItem);
if (comboBox2.SelectedItem == "AC")
{
textBox8.Text = "1500";

}
else
{
textBox8.Text = "1000";
}

private void button1_Click_1(object sender, EventArgs e)


{
if (textBox1.Text.Length == 0)
{
MessageBox.Show("First Insert borrower ID");
return;
}
try
{
con = new SqlConnection(cs);
con.Open();
string sql = "select * from customer_detail where customer_id= '" +
textBox1.Text + "' ";
cmd = new SqlCommand(sql, con);
dr = cmd.ExecuteReader();
if (dr.Read())
{
MessageBox.Show("Record found");
textBox2.Text = dr[1].ToString();
textBox3.Text = dr[3].ToString();
textBox4.Text = dr[5].ToString();
textBox5.Text = dr[9].ToString();
textBox6.Text = dr[11].ToString();

66

else
{
MessageBox.Show("Check Barrower ID", "Input Error",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}

}
}

}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}

67

CHECKIN DETAILS CODING


using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Data.SqlClient;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
System.Drawing.Imaging;
System.IO;

namespace WindowsFormsApplication1
{
public partial class Form13 : Form
{
SqlConnection con = null;
SqlCommand cmd = null;
SqlDataReader dr = null;
string fi;
string cs = "Data Source=localhost;Initial Catalog=HMS;User ID=sa";
public Form13()
{
InitializeComponent();
}
private void Form13_Load(object sender, EventArgs e)
{
con = new SqlConnection(cs);//connection string class=constring
con.Open();
string st = "select
customer_id,customer_name,gender,adults,childrens,contact_no,date,days,room_no,ac,floor,p
rice,amount from check_in ";
cmd = new SqlCommand(st, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
int J = da.Fill(ds, "check_in");
if (J > 0)
{
dataGridView1.DataSource = ds;
dataGridView1.DataMember = "check_in";
}
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();

68

ROOM DETAILS CODING


using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Data.SqlClient;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
System.Drawing.Imaging;
System.IO;

namespace WindowsFormsApplication1
{
public partial class Form8 : Form
{
SqlConnection con = null;
SqlCommand cmd = null;
SqlDataReader dr = null;
string fi;
string cs = "Data Source=localhost;Initial Catalog=HMS;User ID=sa";
public Form8()
{
InitializeComponent();
}

private void button2_Click(object sender, EventArgs e)


{
if (comboBox1.Text.Length == 0)
{
MessageBox.Show("First Insert borrower ID");
return;
}
try
{
con = new SqlConnection(cs);
con.Open();
string sql = "select * from check_in where room_no= '" +
comboBox1.Text + "' ";
cmd = new SqlCommand(sql, con);
dr = cmd.ExecuteReader();
if (dr.Read())
{
MessageBox.Show("Record found");
textBox1.Text = dr[10].ToString();
textBox2.Text = dr[1].ToString();
textBox3.Text = dr[2].ToString();
textBox4.Text = dr[3].ToString();
textBox5.Text = dr[4].ToString();
textBox6.Text = dr[5].ToString();

69

textBox7.Text = dr[8].ToString();
textBox8.Text = dr[9].ToString();
}
else
{
MessageBox.Show("Check customer_ID", "Input Error",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}

}
}

}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}

70

PARKING CODING
using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Data.SqlClient;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
System.Drawing.Imaging;
System.IO;

namespace WindowsFormsApplication1
{
public partial class Form10 : Form
{
SqlConnection con = null;
SqlCommand cmd = null;
SqlDataReader dr = null;
string fi;
string cs = "Data Source=localhost;Initial Catalog=HMS;User ID=sa";
public Form10()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
if (textBox1.Text.Length == 0)
{
MessageBox.Show("First Insert borrower ID");
return;
}
try
{
con = new SqlConnection(cs);
con.Open();
string sql = "select * from check_in where customer_id= '" +
textBox1.Text + "' ";
cmd = new SqlCommand(sql, con);
dr = cmd.ExecuteReader();
if (dr.Read())
{
MessageBox.Show("Record found");
textBox2.Text = dr[1].ToString();
}
else
{
MessageBox.Show("Check customer_ID", "Input Error",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}

}
catch (Exception ex)
{

71

MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,


MessageBoxIcon.Error);
}

private void button1_Click(object sender, EventArgs e)


{
if (textBox3.Text.Length == 0 || textBox4.Text.Length == 0)
{
MessageBox.Show("Please Fill All Entries");
}
else
{
con = new SqlConnection(cs);
con.Open();
string str = "insert into parking_detail values('" + textBox1.Text +
"','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text
+ "')";
cmd = new SqlCommand(str, con);
cmd.ExecuteNonQuery();
MessageBox.Show("Record Submitted");
}

private void button3_Click_1(object sender, EventArgs e)


{
this.Close();
Form3 f = new Form3();
f.Show();
}

72

FOOD MENU CODING


using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Data.SqlClient;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
System.Drawing.Imaging;
System.IO;

namespace WindowsFormsApplication1
{
public partial class Form9 : Form
{
SqlConnection con = null;
SqlCommand cmd = null;
SqlDataReader dr = null;
string fi;
string cs = "Data Source=localhost;Initial Catalog=HMS;User ID=sa";
int a, b, c;
public Form9()
{
InitializeComponent();
}

private void button17_Click(object sender, EventArgs e)


{
this.Hide();
Form3 f3=new Form3();
f3.Show();
}

a = Convert.ToInt32(textBox1.Text);
b = Convert.ToInt32(textBox2.Text);
c = a * b;
textBox3.Text = Convert.ToString(c);

private void button1_Click(object sender, EventArgs e)


{
a = Convert.ToInt32(textBox1.Text);
b = Convert.ToInt32(textBox2.Text);
c = a * b;
textBox3.Text = Convert.ToString(c);
}
private void button2_Click(object sender, EventArgs e)
{
a = Convert.ToInt32(textBox4.Text);
b = Convert.ToInt32(textBox5.Text);
c = a * b;

73

textBox6.Text = Convert.ToString(c);

private void button3_Click(object sender, EventArgs e)


{
a = Convert.ToInt32(textBox7.Text);
b = Convert.ToInt32(textBox8.Text);
c = a * b;
textBox9.Text = Convert.ToString(c);
}
private void button4_Click(object sender, EventArgs e)
{
a = Convert.ToInt32(textBox10.Text);
b = Convert.ToInt32(textBox11.Text);
c = a * b;
textBox12.Text = Convert.ToString(c);
}
int d, f, g, h,i;
private void button5_Click(object sender, EventArgs e)
{

d = Convert.ToInt32(textBox3.Text);
f = Convert.ToInt32(textBox6.Text);
g = Convert.ToInt32(textBox9.Text);
h = Convert.ToInt32(textBox12.Text);
i = d + f + g + h;
textBox13.Text = Convert.ToString(i);

private void button12_Click(object sender, EventArgs e)


{
a = Convert.ToInt32(textBox30.Text);
b = Convert.ToInt32(textBox31.Text);
c = a * b;
textBox32.Text = Convert.ToString(c);
}
private void button6_Click(object sender, EventArgs e)
{
a = Convert.ToInt32(textBox14.Text);
b = Convert.ToInt32(textBox15.Text);
c = a * b;
textBox16.Text = Convert.ToString(c);
}
private void button7_Click(object sender, EventArgs e)
{
a = Convert.ToInt32(textBox17.Text);
b = Convert.ToInt32(textBox18.Text);
c = a * b;
textBox19.Text = Convert.ToString(c);
}
private void button8_Click(object sender, EventArgs e)
{
a = Convert.ToInt32(textBox20.Text);
b = Convert.ToInt32(textBox21.Text);
c = a * b;
textBox22.Text = Convert.ToString(c);
}
private void button9_Click(object sender, EventArgs e)

74

a = Convert.ToInt32(textBox23.Text);
b = Convert.ToInt32(textBox24.Text);
c = a * b;
textBox25.Text = Convert.ToString(c);

private void button10_Click(object sender, EventArgs e)


{
d = Convert.ToInt32(textBox16.Text);
f = Convert.ToInt32(textBox19.Text);
g = Convert.ToInt32(textBox22.Text);
h = Convert.ToInt32(textBox25.Text);
i = d + f + g + h;
textBox26.Text = Convert.ToString(i);
}
private void button11_Click(object sender, EventArgs e)
{
a = Convert.ToInt32(textBox27.Text);
b = Convert.ToInt32(textBox28.Text);
c = a * b;
textBox29.Text = Convert.ToString(c);
}
private void button13_Click(object sender, EventArgs e)
{
a = Convert.ToInt32(textBox33.Text);
b = Convert.ToInt32(textBox34.Text);
c = a * b;
textBox35.Text = Convert.ToString(c);
}
private void button14_Click(object sender, EventArgs e)
{
a = Convert.ToInt32(textBox36.Text);
b = Convert.ToInt32(textBox37.Text);
c = a * b;
textBox38.Text = Convert.ToString(c);
}
private void button15_Click(object sender, EventArgs e)
{
d = Convert.ToInt32(textBox29.Text);
f = Convert.ToInt32(textBox32.Text);
g = Convert.ToInt32(textBox35.Text);
h = Convert.ToInt32(textBox38.Text);
i = d + f + g + h;
textBox39.Text = Convert.ToString(i);
}
private void button16_Click(object sender, EventArgs e)
{
a = Convert.ToInt32(textBox40.Text);
b = Convert.ToInt32(textBox41.Text);
c = a * b;
textBox42.Text = Convert.ToString(c);
}
private void button17_Click_1(object sender, EventArgs e)
{
a = Convert.ToInt32(textBox43.Text);
b = Convert.ToInt32(textBox44.Text);
c = a * b;

75

textBox45.Text = Convert.ToString(c);

private void button18_Click(object sender, EventArgs e)


{
a = Convert.ToInt32(textBox46.Text);
b = Convert.ToInt32(textBox47.Text);
c = a * b;
textBox48.Text = Convert.ToString(c);
}
private void button19_Click(object sender, EventArgs e)
{
a = Convert.ToInt32(textBox49.Text);
b = Convert.ToInt32(textBox50.Text);
c = a * b;
textBox51.Text = Convert.ToString(c);
}
private void button20_Click(object sender, EventArgs e)
{
d = Convert.ToInt32(textBox42.Text);
f = Convert.ToInt32(textBox45.Text);
g = Convert.ToInt32(textBox48.Text);
h = Convert.ToInt32(textBox51.Text);
i = d + f + g + h;
textBox52.Text = Convert.ToString(i);
}
private void button21_Click(object sender, EventArgs e)
{
d = Convert.ToInt32(textBox13.Text);
f = Convert.ToInt32(textBox26.Text);
g = Convert.ToInt32(textBox39.Text);
h = Convert.ToInt32(textBox52.Text);
i = d + f + g + h;
textBox53.Text = Convert.ToString(i);
con = new SqlConnection(cs);
con.Open();
string str = "insert into food values('" + textBox53.Text + "','" +
textBox54.Text + "','" + textBox55.Text + "','" + textBox56.Text + "')";
cmd = new SqlCommand(str, con);
cmd.ExecuteNonQuery();
MessageBox.Show("Record Submitted");
}
private void button22_Click(object sender, EventArgs e)
{
if (textBox54.Text.Length == 0)
{
MessageBox.Show("First Insert borrower ID");
return;
}
try
{
con = new SqlConnection(cs);

76

con.Open();
string sql = "select * from check_in where customer_id= '" +
textBox54.Text + "' ";
cmd = new SqlCommand(sql, con);
dr = cmd.ExecuteReader();
if (dr.Read())
{
MessageBox.Show("Record found");
textBox55.Text = dr[1].ToString();
textBox56.Text = dr[10].ToString();
}
else
{
MessageBox.Show("Check customer_ID", "Input Error",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}

}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}

private void button23_Click(object sender, EventArgs e)


{
this.Close();
Form3 f = new Form3();
f.Show();
}

77

CHECKOUT DETAILS CODING


using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Data.SqlClient;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
System.Drawing.Imaging;
System.IO;

namespace WindowsFormsApplication1
{
public partial class Form7 : Form
{
SqlConnection con = null;
SqlCommand cmd = null;
SqlDataReader dr = null;
string fi;
string cs = "Data Source=localhost;Initial Catalog=HMS;User ID=sa";
public Form7()
{
InitializeComponent();
}
private void button2_Click_1(object sender, EventArgs e)
{
new Form11().ShowDialog();
}
private void button4_Click(object sender, EventArgs e)
{
int a, b,c;
if (textBox1.Text.Length == 0)
{
MessageBox.Show("First Insert borrower ID");
return;
}
try
{
con = new SqlConnection(cs);
con.Open();
string sql = "select * from check_in where customer_id= '" +
textBox1.Text + "' ";
cmd = new SqlCommand(sql, con);
dr = cmd.ExecuteReader();
if (dr.Read())
{
MessageBox.Show("Record found");
textBox2.Text = dr[1].ToString();
comboBox1.Text = dr[2].ToString();
textBox3.Text = dr[3].ToString();

78

textBox4.Text = dr[4].ToString();
dateTimePicker1.Text = dr[8].ToString();
textBox5.Text = dr[9].ToString();
textBox6.Text = dr[10].ToString();
textBox7.Text = dr[11].ToString();
textBox8.Text = dr[12].ToString();
textBox9.Text = dr[13].ToString();
textBox12.Text = dr[14].ToString();
a = Convert.ToInt32(textBox5.Text);
b = Convert.ToInt32(textBox9.Text);
c = a * b;
textBox10.Text = Convert.ToString(c);
con = new SqlConnection(cs);
con.Open();
string sql1 = "select * from parking_detail where customer_id= '"
+ textBox1.Text + "' ";
cmd = new SqlCommand(sql1, con);
dr = cmd.ExecuteReader();
if (dr.Read())
{

textBox11.Text = dr[3].ToString();
}
con = new SqlConnection(cs);
con.Open();
string sql2 = "select * from food where customer_id= '" +
textBox1.Text + "' ";
cmd = new SqlCommand(sql2, con);
dr = cmd.ExecuteReader();
if (dr.Read())
{

textBox14.Text = dr[0].ToString();
}
}
else
{
MessageBox.Show("Check customer_ID", "Input Error",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
int z, y, x, w , u ;
private void button3_Click(object sender, EventArgs e)

79

z = Convert.ToInt32(textBox10.Text);
y = Convert.ToInt32(textBox12.Text);
x = Convert.ToInt32(textBox11.Text);
w = Convert.ToInt32(textBox14.Text);
u = w + x + z - y;
textBox13.Text = Convert.ToString(u);

}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text.Length == 0 || textBox2.Text.Length == 0 || comboBox1.Text.Length
== 0 || textBox3.Text.Length == 0 || textBox4.Text.Length == 0 ||
dateTimePicker1.Text.Length == 0 || dateTimePicker2.Text.Length == 0 ||
textBox5.Text.Length == 0 || textBox6.Text.Length == 0 || textBox7.Text.Length == 0 ||
textBox8.Text.Length == 0 || textBox9.Text.Length == 0 || textBox10.Text.Length == 0 ||
textBox11.Text.Length == 0 || textBox14.Text.Length == 0 || textBox12.Text.Length == 0 ||
textBox13.Text.Length == 0)
{
MessageBox.Show("Please Fill All Entries");
}
else
{
try
{
con = new SqlConnection(cs);
con.Open();
string str = "insert into check_out values('" + textBox1.Text + "','" +
textBox2.Text + "','" + comboBox1.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" +
dateTimePicker1.Text + "','" + dateTimePicker2.Text + "','" + textBox5.Text + "','" +
textBox6.Text + "','" + textBox7.Text + "','" + textBox8.Text + "','" + textBox9.Text + "','" +
textBox10.Text + "','" + textBox11.Text + "','" + textBox14.Text + "','" + textBox12.Text + "','"
+ textBox13.Text + "')";
cmd = new SqlCommand(str, con);
cmd.ExecuteNonQuery();
MessageBox.Show("Record Submitted");

}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

private void button8_Click_1(object sender, EventArgs e)


{
this.Close();
Form3 f = new Form3();
f.Show();
}
private void button7_Click(object sender, EventArgs e)
{
new Form15().ShowDialog();
}

80

81

CHECKOUT DETAIL CODING


using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Data.SqlClient;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
System.Drawing.Imaging;
System.IO;

namespace WindowsFormsApplication1
{
public partial class Form15 : Form
{
SqlConnection con = null;
SqlCommand cmd = null;
SqlDataReader dr = null;
string fi;
string cs = "Data Source=localhost;Initial Catalog=HMS;User ID=sa";
public Form15()
{
InitializeComponent();
}
private void Form15_Load(object sender, EventArgs e)
{
con = new SqlConnection(cs);//connection string class=constring
con.Open();
string st = "select
customer_id,customer_name,gender,contact_no,checkin_date,checkout_date,days,room_no,ac
,floor,price,room_amount,parking_charges,food_charges,advance_amount,grand_total from
check_out ";
cmd = new SqlCommand(st, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
int J = da.Fill(ds, "check_out");
if (J > 0)
{
dataGridView1.DataSource = ds;
dataGridView1.DataMember = "check_out";
}
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();

82

CHECKOUT BILL CODING


using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Data.SqlClient;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
System.Drawing.Imaging;
System.IO;

namespace WindowsFormsApplication1
{
public partial class Form11 : Form
{
SqlConnection con = null;
SqlCommand cmd = null;
SqlDataReader dr = null;
string fi;
string cs = "Data Source=localhost;Initial Catalog=HMS;User ID=sa";
public Form11()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox2.Text.Length == 0)
{
MessageBox.Show("First Insert borrower ID");
return;
}
try
{
con = new SqlConnection(cs);
con.Open();
string sql = "select * from check_out where customer_id= '" +
textBox2.Text + "' ";
cmd = new SqlCommand(sql, con);
dr = cmd.ExecuteReader();
if (dr.Read())
{
MessageBox.Show("Record found");
textBox3.Text = dr[1].ToString();
textBox4.Text = dr[8].ToString();
textBox5.Text = dr[16].ToString();
}
}

83

catch (Exception ex)


{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}

private void Form11_Load(object sender, EventArgs e)


{
try
{
con = new SqlConnection(cs);
con.Open();
string st = "select isnull(max(bill_id),0)+001 from bill_details";
cmd = new SqlCommand(st, con);
int sr = Convert.ToInt32(cmd.ExecuteScalar());
textBox1.Text = Convert.ToString(sr);
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
private void button2_Click(object sender, EventArgs e)
{
if (textBox1.Text.Length == 0 || textBox2.Text.Length == 0 ||
textBox3.Text.Length == 0 || textBox4.Text.Length == 0 ||
textBox5.Text.Length == 0)
{
MessageBox.Show("Please Fill All Entries");
}
else
{
try
{
con = new SqlConnection(cs);
con.Open();
string str = "insert into bill_details values('" + textBox1.Text +
"','" + textBox2.Text + "','" + textBox3.Text + "','" +
textBox4.Text + "','" + textBox5.Text + "')";
cmd = new SqlCommand(str, con);
cmd.ExecuteNonQuery();
MessageBox.Show("Record Submitted");

}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}

}
private void button3_Click(object sender, EventArgs e)
{
this.Close();
}
}

84

85

SYSTEM TESTING
The Form authentication collects user's credential and lets
the application use own logic to authenticate users. The collected user's
credential is validated using the list maintained by the application. The
application maintains its own user list either using <credential> element
in the web.config file or using database. The advantage of using form
authentication is that the users don't need to be the member of windows
network to have access to the application.
The access control mechanism to prevent unauthorized logging to the
system.
System checks the password under the particular user identification. The
computer permits the various resources to the authorized person.
To understand what measures are taken for security of application, first
we need to understand what kind of threats penetrates the security of
application. Errors and omission, disgruntled and dishonest employees,
external attacks and natural disasters.
Install the software on a clean system.
Check for proper operation of software.
Check for .dll file conflicts.
Check for registry entry problems.
Check for file conflicts.
Create Application item.
Push application to test station and check for proper operation.
After performing all the above steps it is justified as project has been
implemented successfully.
basically based on the client what they want to update in the software. In
the project evaluation the main thing is how the project will work and
how much better performance in the system. The project is windows

86

based application so it will be do proper work and properly interact with


the hardware.
In this type of testing we test various integration of the project module
by providing the input. The primary objective is to test the module
interfaces in order to ensure that no errors are occurring when one
module invokes the other module.
Testing admin login form-This form is used for login of
administrator of the system. In this we enter the username and
password if both are correct administration page will open
otherwise if any of data is wrong it will get redirected back to the
login form and again ask for username and password.
Book Addition- Admin can enter details of book and can add the details
to the main book table also he can view the books requests.
Unit testing is undertaken when a module has been created and
successfully reviewed .In order to test a single module we need to
provide a complete environment i.e. besides the module we would
require
The procedures belonging to other modules that the module under
test calls.
Non local data structures that module accesses.
A procedure to call the functions of the module under test with
appropriate parameters.
Unit testing was done on each and every module
observations it will be decided whether the program behaves as
expected or not.
Our Project went through two levels of testing
1. Unit Testing
87

2. Integration Testing
The aim of the system testing process was to determine all defects in our
project .The program was subjected to a set of test inputs and various
observations were made and based on these observations it will be
decided whether the program behaves as expected or not.
Our Project went through two levels of testing
1. Unit Testing
2. Integration Testing

88

UNIT TESTING
Unit testing is undertaken when a module has been created and
successfully reviewed .In order to test a single module we need to
provide a complete environment i.e. besides the module we would
require
The procedures belonging to other modules that the module
under test calls.
Non local data structures that module accesses.
A procedure to call the functions of the module under test
with appropriate parameters.
Unit testing was done on each and every module
1. Test For the admin module
Testing admin login form-This form is used for login of
administrator of the system. In this we enter the username and
password if both are correct administration page will open
otherwise if any of data is wrong it will get redirected back to
the login form and again ask for username and password.
Book Addition- Admin can enter details of book and can add the
details to the main book table also he can view the books requests.

INTEGRATION TESTING
In this type of testing we test various integration of the project
module by providing the input. The primary objective is to test the
module interfaces in order to ensure that no errors are occurring
when one module invokes the other module.
89

EVALUATION
The Form authentication collects user's credential and
lets the application use own logic to authenticate users. The
collected user's credential is validated using the list maintained by
the application. The application maintains its own user list either
using <credential> element in the web.config file or using database.
The advantage of using form authentication is that the users don't
need to be the member of windows network to have access to the
application.
The access control mechanism to prevent unauthorized logging to
the system.
System checks

the

password

under

the

particular

user

identification. The computer permits the various resources to the


authorized person.
To understand what measures are taken for security of application,
first we need to understand what kind of threats penetrates the
security of application. Errors and omission, disgruntled and
dishonest employees, external attacks and natural disasters.
Install the software on a clean system.
Check for proper operation of software.
Check for .dll file conflicts.
Check for registry entry problems.
Check for file conflicts.
Create Application item.
Push application to test station and check for proper
operation.

90

After performing all the above steps it is justified as project has


been implemented successfully.
basically based on the client what they want to update in the
software. In the project evaluation the main thing is how the project
will work and how much better performance in the system. The
project is windows based application so it will be do proper work
and properly interact with the hardware.
Evaluation processes are multi-level, multi-loop, multi-agent
feedback systems. This phase is basically based on the client what
they want to update in the software. In the project evaluation the
main thing is how the project will work and how much better
performance in the system. The project is windows based
application so it will be do proper work and properly interact with
the hardware.

Steps to Evaluate
Install the software on a clean system.
Check for proper operation of software.
Check for .dll file conflicts.
Check for registry entry problems.
Check for file conflicts.
Create Application item.
Push application to test station and check for proper
operation.
After performing all the above steps it is justified as project has
been implemented successfully.

91

Security Measure Taken:To understand what measures are taken for


security of application, first we need to understand what kind of
threats penetrates the security of application. Errors and omission,
disgruntled and dishonest employees, external attacks and natural
disasters.

i) Authentication:System checks the password under the particular user


identification. The computer permits the various resources to the
authorized person.

ii) Authorization:The access control mechanism to prevent unauthorized


logging to the system.

iii) Form authentication


The Form authentication collects user's credential and lets
the application use own logic to authenticate users. The collected
user's credential is validated using the list maintained by the
application. The application maintains its own user list either using
<credential> element in the web.config file or using database. The
advantage of using form authentication is that the users don't need
to be the member of windows network to have access to the
application.

92

93

CONCLUSION
No body is perfect, neither Man or computer

No man is Mr. perfect, so how a computer can be perfect &


accurate. No s/w package can cover up the entire problem error.

This package is suitable HOTEL

MANAGEMENT

SYSTEM. The user can efficiently conduct all the operation


related to hotel management through menu provided. The
programming done in visual studio .Net package is systematic &
easily comprehensive.

The application developed for HOTEL

MANAGEMENT

overcome the problem of manul system in case of accuracy, speed


&efficiently. The system is useful for person who has less
knowledge of computer because of system would have valuable
time & resource of the system by providing accurate info. And
report to management.

94

REFERENCES
BLACK BOOK:For C# .NET Professional C# .NET 2008 Mathew Macdonald
Publication (Black book) .
For MS SQL SERVER 2008
www.google.com
www.w3school.com
www.programmer2 programmer.com

95

Potrebbero piacerti anche