Hotal MGT Project

Download as pdf or txt
Download as pdf or txt
You are on page 1of 66

Project Report of

Hotel Management
System
By
Name: Chaman dwivedi

Submitted in partial fulfillment of the requirements


for the degree of

Bachelor of Computer Applications


Infopark collage of It management

Submitted to Submitted By

Mr. uday sir Chaman dwivedi


ACKNOWLEDGEMENT

I offer my sincere appreciation to all people who provide their support to

this project. I feel great pleasure while working on this project work.

There are some people who help me a lot by providing valuable

suggestions and time during this project work.

First I want to thank Mr. Uday sir who gave knowledge through which I

have developed this project.and Than’k to Director Sir Abhay Dwivedi to

Provide me facility to develop project in Infopark.

Chaman dwivedi

BCA -V
Table of Contents

S. No. Topic

1. Introduction

2. Objective of the Project

3. Problem Statement

4. Requirement Analysis

5. Feasibility Analysis And Design

6. System Design

7. Form Layouts

8. Coding

9. Testing

12. Future Scope of the Project

13. Conclusion

14. Bibliography
1.Introduction Of Project

A Hotel is an organization where delicacy, hospitability and service matter

a lot. And the hotel always try to be better the in all the areas where ever

the possibilities are there. The Computer has made this possible by

providing the internet, email, and networking and by other software. In

the same fashion the “Dummy “software Named “Hotel Management

System” is the project designed for the hotel industry people who found

their work quite hardly manageable because of keeping all wears and

tears because each and every thing is the matter which should be

recorded. For this purpose the following project is quit helpful and handy

because almost all the areas are covered in the project. Like Restaurant,

Rooms Health club, and transport. So the project is quite easy to use and

easy to carry. Today the efficiency of the computerized department is

best and do work speedily. Following are the departments which covered

in the projects:-

1. Front Office(Reception)

2. Restaurant

3. Room Services

4. Transport Enquiry

5. Different Department (Products, Employees Etc...)


2.Objective Of Project

The objective of the project is to make the hotel computerized

almost every area, and the block of the hotel like restaurant,

rooms, entertainment, sport, transport etc... Can keep their records

separately.

The hotel people will have to make login of each and every one

therefore security of the data is kept secured.

The facilities given into the project makes the project useful to the

hotel and the workers of the hotel because their work will be easy

and they will find their work easy and correct, all the details can be

checked as any time and can be changed.

System Analysis

3.Problem Statement

The Major problems during the designing of this project occurred were:-

1. Facts Collection

2. Attribute Collection

3. Decision Making

4. Meeting to the Hotel people


All the problems took place during the preparation of the project to give

the shape of actual project it was quite difficult to collect the facts like

what attribute they use to store the relevant data of any area.

Meeting to the hotel people was quit tough task as they were not ready to

talk about their personal matters as the working style of any hotel make

the hotel unique. And then decision making that whether the facts given

to me was appropriate to meet the requirement of the project.


4.Requirement Analysis

The requirement of the project was the working style of a hotel which is

working as its own way

1. The choice of the hotel

a. Selecting the meeting persons

i. His area of work

ii. His duty or role

iii. His Contribution to the project

b. Selecting the Details

i. Selection of the detail required for the project

ii. Selection of the Data and requirement of the working

department

c. Making the detail useful

i. Arranging the details in to table

ii. Connection of the table

2. Creation of the project

a. Making the tables

b. Making the ER Diagrams

c. Making the forms

d. Taking the proper name (as they are unique)

3. Testing

a. Testing the project at the site

b. Testing the project according the use

4. Trouble shooting
a. Sorting out the problems occurred

b. Taking the details of the troubles faced

5.Feasibility Analysis And Design

The feasibility study proposes one or more conceptual solutions to the

problem set of the project. It is a test of a system proposal according to

its workability impact on the organization, ability to meet user needs and

effective use of resources .The objective of a feasibility study is not to

solve the problem but to acquire a sense of its scope. Cost benefit

analysis is also done .The result is a format proposal detailing the nature

and nature and scope of the proposed solution.

Feasibility analysis usually considers a number of project alternatives and

the most satisfactory solution is selected among the alternatives. The

alternatives are also need to be evaluated in a broad way without

committing too many resources.

Four primary areas of interest in feasibility study are: -

1. ECONOMIC FEASIBILITY: - An evaluation of development cost

weighed against the ultimate income of benefit derived from the

development system or product.

This project can run on DOS or Windows 10 operating system, which are

most commonly available at nominal price. Hence, there are no

economical constraints.
2. TECHNICAL FEASIBILITY: A study of function, performance &

constraints that many affect the ability to achieve an acceptable system.

This project can run on any Pentium processor & does not require any

additional hardware.

3. BEHAVIOURAL FEASIBILITY: This project is very user friendly &

menu driven project & it will be readily accepted by the user.


Waterfall Model

This project is based on a Waterfall technique, which is based on top –

down approach i.e. the user will get finally whatever is desire without

having any intermediate interference in between.

Numerical system is based on waterfall model. The explicit model of

software development process was derived from other engineering

process. The waterfall model offered a means of making the development

process more visible.

Requirements analysis and


specification.

Design and Specification

Coding and Module


Testing

Integration and System


Testing

Delivery and
Maintenance
SYSTEM REQUIREMENTS

Hard ware Specification:

Processor Speed : Intel I3 Processor

RAM : 2GB

Hard Disk : 500GB

Key Board : 104 keys

Software Specification

Language : C#.NET with Windows Form

Database : MS SqlServer 2008

Operating System : Windows10

Development Tool : Microsoft Visual Studio 2010


VISUAL BASIC.NET C#
All .NET languages create code called intermediate language and as long
as that code was written to the Common Language Specification the
intermediate language can be used by any other .NET language. This
means that all languages are first class languages as far as .NET is
concerned. C# (pronounced "C-sharp") is a modern, object-oriented programming
language developed by Microsoft as part of its .NET framework. It was created in the early
2000s under the leadership of Anders Hejlsberg, who was also behind the development of
Delphi and TypeScript. C# is widely used for building a variety of applications, including
desktop, web, mobile, and game development, especially with frameworks like .NET Core
(now just .NET), ASP.NET, and Unity.

Key Features of C#:

1. Object-Oriented Programming (OOP):


o C# is designed around the principles of encapsulation, inheritance, and
polymorphism, which are fundamental to building modular, reusable code.
o Everything in C# is an object, even primitive types (like integers, floats) are
treated as objects in some contexts.
2. Type Safety:
o C# is a strongly typed language, meaning that variable types are enforced at
compile time. This reduces runtime errors and improves code quality.
3. Modern Language Features:
o C# includes features such as automatic memory management (via garbage
collection), lambda expressions, async/await, and LINQ (Language
Integrated Query), making it a powerful and flexible language.
4. Cross-Platform:
o With the introduction of .NET Core (now just .NET), C# can run on multiple
platforms, including Windows, macOS, and Linux, making it a great choice
for cross-platform development.
5. Interoperability:
o C# has excellent integration with other languages, especially within the
Microsoft ecosystem. It can easily interact with unmanaged code via P/Invoke
and COM interop.
6. Rich Library Support:
o The .NET library (often referred to as the Framework Class Library or
FCL) provides a vast collection of classes for networking, data access,
security, XML processing, and much more.
7. Versatile Applications:
o C# can be used for:
 Desktop applications (Windows Forms, WPF)
 Web applications (ASP.NET)
 Mobile applications (Xamarin)
 Cloud services (Azure)
 Games (Unity)
MS SQLSERVER 2008

Microsoft SqlServer 2008 is a powerful, yet easy to learn, relational

database application for Microsoft Windows. This tutorial is designed for

users who are new or only have little experience using sqlserver 2008. It

introduces fundamental database concepts and operations and illustrates

how they are performed in Microsoft sqlserver 2008. This tutorial does not

cover all of the features and functions of MS SqlServer 2008; emphasis

will be on basic and frequently-used features, such as the creation of

tables and queries, or importing spreadsheet into Access.

Relational Database: in relational databases such as SqlServer 2008,

data is stored in tables made up of one or more fields (Access calls a

column a field). The data stored in each column must be of a single data

type such as Character, Number or Date. A collection of values from each

column of a table is called a record or a row in the table.

Different tables can have the same column in common. This feature is

used to explicitly specify a relationship between two tables. Values

appearing in column A in one table are shared with another table

Table: tables are the main units of data storage in a database. A table is

a collection of data about a specific topic; it is made up of one of more

fields.
Field: a field is a column in a table and defines a data type for a set of

values in a table. For example, a mailing list table might include fields for

first name, last name, address, city, state, zip code, and telephone

number.

Record: a record in a row in a table and is a set of values defined by

fields.

In a mailing list table, each record would contain the data for one person

as specified by the intersecting fields.

Data type: data types are the properties of each field. A field only has

one data type, such as Character, Number or Date.

Primary Key: a primary key is a value that can be used to identify a

unique record in a table.

Design View: it provides the tools for creating fields in a table.

Datasheet View: it allows you to update, edit, and delete in formation

from a table.
6.System Design

System design is an essential activity in the System Development Life

Cycle. System design is the general detailed specification of the computer

based solution that was selected during system analysis. Design

specification forms the basis for system development. The design is a

solution, the translation of requirements into ways of meeting them. In

the process the end user requirement were translated into specification

for a computer based information system. System design consists of two

phases:-

1. LOGICAL DESIGN

2. PHYSICAL DESIGN

In logical design the detailed specification of the new system is described

i.e. output, the inputs and the databases, all in manner that meets

project requirements.

The activity following logical design, are the procedure followed in the

physical design i.e. producing programs, software, files and a working

system.

Logical Design

Database Design

This phase is one of the most crucial as well as important part

of the System Design. The complete database description must confirm to

the rule of logical and physical data structures imposed by the database

management system that will manage the database.


DFD DataFlow Diagram

Login -

User

User id
password

Login

Invalid Dashboard

Add
client About

Room Reservation
Add client-

Add
client

Add client successfully

Client
Client Client
search Delete
update
Room-

Add
Room

Add Room successfully

Room
Room Room
search Delete
update
DataBase Tables

Room table:
Reservation table:
Client table -
7.INPUT-OUTPUT SCREENS

FORM1-WELCOME SCREEN
FORM2-LOGIN
FORM3-Resister frm
FORM 4-NEW Client ENTRY FORM
FORM 5- update and delete client from
FORM 6-RESERVATION ENTRY FORM
FORM 7-Upadte and delete reservation from
FORM 8-NEW ROOM BOOKING INFORMATION FORM
FORM 9-UPADTE AND DELETE ROOM FORM
About frm:
Dashboard1 from
8 .Coding:
Login Screen(frmLogin)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace Hotal_management_system
{
public partial class login : Form
{
public login()
{
InitializeComponent();
}

private void login_Load(object sender, EventArgs e)


{

private void reglbl_Click(object sender, EventArgs e)


{

register form3 = new register();


form3.Show();
}

private void button1_Click(object sender, EventArgs e)


{
SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial
Catalog=reception;Integrated Security=True;Pooling=False");

string reception = "SELECT Firstname, Lastname, password, Email,


Gender FROM reception WHERE (Email = @email) AND (password = @password)";
SqlCommand cmd = new SqlCommand(reception, con);
cmd.Parameters.AddWithValue("@email",txtemail.Text);
cmd.Parameters.AddWithValue("@password",txtpass.Text);
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
if(dr.HasRows)
{
this.DialogResult=DialogResult.OK;
MessageBox.Show("Login successfully");
txtemail.Clear();
txtpass.Clear();
}
else
{
MessageBox.Show("Invalid UserId or Password.");
}
con.Close();

private void label10_Click_1(object sender, EventArgs e)


{
Application.Exit();
}

private void lgnbtn_Click(object sender, EventArgs e)


{
login form2 = new login();
form2.Show();
}

}
}
Main Screen(frmdashboard)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Hotal_management_system
{
public partial class Dashboard : Form
{
public string username;
public Dashboard()
{
InitializeComponent();
}
private void Movepanel(Control btn)
{
panelslider.Top = btn.Top;
panelslider.Height = btn.Height;
}

private void button1_Click(object sender, EventArgs e)


{
Movepanel(button1);
dashboard1 f1 = new dashboard1();
f1.Show();

private void timer1_Tick(object sender, EventArgs e)


{
labledatetime.Text = DateTime.Now.ToString("dd-mm-yyyy hh:mm:ss tt");
}

private void Dashboard_Load(object sender, EventArgs e)


{
timer1.Start();
labelusername.Text = username;
}

private void btnlogout_Click(object sender, EventArgs e)


{
DialogResult result = MessageBox.Show("Are you want to log Out?",
"logout", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (DialogResult.Yes == result)
{
timer1.Stop();
this.Close();
}
}

private void button2_Click(object sender, EventArgs e)


{
Movepanel(button2);
client form1 = new client();
form1.Show();
}

private void button3_Click(object sender, EventArgs e)


{
Movepanel(button3);
Room form1 = new Room();
form1.Show();

private void button4_Click(object sender, EventArgs e)


{
Movepanel(button4);
reservation form1 = new reservation();
form1.Show();
}

private void userControlsetting1_Load(object sender, EventArgs e)


{

private void userControlclient1_Load(object sender, EventArgs e)


{

private void button5_Click_1(object sender, EventArgs e)


{

Movepanel(home);
home ft = new home();
ft.Show();
}

}
}
Resister frm

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

namespace Hotal_management_system
{
public partial class register : Form
{
public register()
{
InitializeComponent();
}
SqlConnection con = new SqlConnection(@"server=.\SQLEXPRESS;Initial
Catalog=reception;Integrated Security=True;Pooling=False");

private void regbtn_Click(object sender, EventArgs e)


{

if (fg.Text == "" || lasttxt.Text == "" || emailtxt.Text == "" ||


passtxt.Text == "" | gencmb.Text=="")
{
MessageBox.Show("missing apportunities");
}
else
{
try
{
con.Open();

string reception = "INSERT INTO reception VALUES ('" + fg.Text +


"', '" + lasttxt.Text + "', '" +
emailtxt.Text + "', '" + passtxt.Text + "', '" +
gencmb.SelectedItem.ToString() + "')";
SqlCommand cmd = new SqlCommand(reception, con);
cmd.ExecuteNonQuery();
MessageBox.Show("Registered successfully");

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

private void label10_Click_1(object sender, EventArgs e)


{
Application.Exit();
}
private void lgnbtn_Click(object sender, EventArgs e)
{
login form2 = new login();
form2.Show();
}

}
}
NewClientEntryForm(ClientNew)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace Hotal_management_system
{
public partial class client : Form
{
public client()
{
InitializeComponent();
}

SqlConnection con = new SqlConnection(@"Server=.\SQLEXPRESS;Initial


Catalog=reception;Integrated Security=True;Pooling=False");

private void button1_Click(object sender, EventArgs e)


{

string reception = "INSERT INTO client_table (Client_id,


Client_name, Gender, Client_phone, Client_address) VALUES (@Client_id, @Client_name,
@Gender, @Client_phone, @Client_address) ";
SqlCommand cmd = new SqlCommand(reception, con);
cmd.Parameters.AddWithValue("@Client_id",textBoxclientid.Text);
cmd.Parameters.AddWithValue("@Client_name",textBoxclientname.Text);
cmd.Parameters.AddWithValue("@Gender",cmbGender.Text);
cmd.Parameters.AddWithValue("@Client_phone",textBoxphone.Text);
cmd.Parameters.AddWithValue("@Client_address",textBoxaddress.Text);
con.Open();
int stts= cmd.ExecuteNonQuery();
if(stts>0)
MessageBox.Show("Add succesfully...");
else
MessageBox.Show("Faild...");

con.Close();
}

private void textBoxuserphone2_TextChanged(object sender, EventArgs e)


{
string du = "SELECT * FROM client_table ";
SqlDataAdapter d = new SqlDataAdapter(du, con);
SqlCommandBuilder cmd = new SqlCommandBuilder(d);
DataTable dt = new DataTable();
d.Fill(dt);
dataGridViewuserclient.DataSource = dt;
}
}
}
EditClientInformationForm:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace Hotal_management_system
{
public partial class client : Form
{
public client()
{
InitializeComponent();
}

SqlConnection con = new SqlConnection(@"Server=.\SQLEXPRESS;Initial


Catalog=reception;Integrated Security=True;Pooling=False");

private void button1_Click(object sender, EventArgs e)


{

string reception = "INSERT INTO client_table (Client_id,


Client_name, Gender, Client_phone, Client_address) VALUES (@Client_id, @Client_name,
@Gender, @Client_phone, @Client_address) ";
SqlCommand cmd = new SqlCommand(reception, con);
cmd.Parameters.AddWithValue("@Client_id",textBoxclientid.Text);
cmd.Parameters.AddWithValue("@Client_name",textBoxclientname.Text);
cmd.Parameters.AddWithValue("@Gender",cmbGender.Text);
cmd.Parameters.AddWithValue("@Client_phone",textBoxphone.Text);
cmd.Parameters.AddWithValue("@Client_address",textBoxaddress.Text);
con.Open();
int stts= cmd.ExecuteNonQuery();
if(stts>0)
MessageBox.Show("Add succesfully...");
else
MessageBox.Show("Faild...");

con.Close();
}

private void textBoxuserphone2_TextChanged(object sender, EventArgs e)


{
string du = "SELECT * FROM client_table ";
SqlDataAdapter d = new SqlDataAdapter(du, con);
SqlCommandBuilder cmd = new SqlCommandBuilder(d);
DataTable dt = new DataTable();
d.Fill(dt);
dataGridViewuserclient.DataSource = dt;
}

private void buttonupdate3_Click(object sender, EventArgs e)


{
}
}
}
ADDRoomForm(frmRoom)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace Hotal_management_system
{
public partial class Room : Form
{
public Room()
{
InitializeComponent();
}
SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-
6DONVN0\SQLEXPRESS;Initial Catalog=reception;Integrated Security=True;Pooling=False");

private void button2_Click(object sender, EventArgs e)


{
string dd = "INSERT INTO Roomtable (Roomnumber, RoomType , RoomPhone ,
Roomfree )VALUES (@Roomnumber, @RoomType , @RoomPhone , @Roomfree )";

SqlCommand cmd = new SqlCommand(dd, con);


cmd.Parameters.AddWithValue("@RoomType", comboBoxtype.Text);
cmd.Parameters.AddWithValue("@RoomPhone", textBoxphoneno.Text);
cmd.Parameters.AddWithValue("@Roomfree", comboBoxfree.Text);
cmd.Parameters.AddWithValue("@Roomnumber",textBoxroomno1.Text );
con.Open();
int h = cmd.ExecuteNonQuery();

if ( h> 0)
MessageBox.Show("Add succesfully...");
else
MessageBox.Show("Faild...");

con.Close();
}

private void textBoxusersearchroom_TextChanged(object sender, EventArgs e)


{
string dj = "SELECT * FROM Roomtable ";
SqlDataAdapter d= new SqlDataAdapter(dj,con);
SqlCommandBuilder cmd =new SqlCommandBuilder(d);
DataTable dt= new DataTable();
d.Fill(dt);
dataGridViewuserroom.DataSource=dt;
}

private void button1_Click(object sender, EventArgs e)


{SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-
6DONVN0\SQLEXPRESS;Initial Catalog=reception;Integrated Security=True;Pooling=False");

try
{
con.Open();

// SQL query to update the Roomtable


string query = "UPDATE Roomtable SET Roomtype = @Roomtype, RoomPhone = @RoomPhone,
Roomfree = @Roomfree WHERE Roomnumber = @Roomnumber";

// Using 'using' block to ensure the command is disposed of correctly


using (SqlCommand cmd = new SqlCommand(query, con))
{
// Add parameters to the command
cmd.Parameters.AddWithValue("@Roomnumber", int.Parse(textBox1room.Text)); //
Ensure this parses correctly
cmd.Parameters.AddWithValue("@Roomtype", comboBoxtype1.Text);
cmd.Parameters.AddWithValue("@RoomPhone", textBoxphone1.Text);
cmd.Parameters.AddWithValue("@Roomfree", comboBox1free.Text);

// Execute the update query


cmd.ExecuteNonQuery();
}

// Notify the user of success


MessageBox.Show("Update successful", "Updated", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
catch (Exception ex)
{
// Handle any errors that occur during the update
MessageBox.Show("Error: " + ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
// Always close the connection in a finally block to ensure it's closed even if an
exception occurs
if (con.State == ConnectionState.Open)
{
con.Close();
}

}
}

private void button3_Click(object sender, EventArgs e)


{
con.Open();

SqlCommand cmd = new SqlCommand("DELETE FROM Roomtable WHERE Roomnumber =


@Roomnumber", con);
cmd.Parameters.AddWithValue("@Roomnumber", int.Parse(textBox1room.Text));
// Fixed parameter name

cmd.ExecuteNonQuery();
con.Close();

MessageBox.Show("Record deleted successfully", "Deleted",


MessageBoxButtons.OK, MessageBoxIcon.Information);
}

}
}
Remove room:
private void button3_Click(object sender, EventArgs e)
{
con.Open();

SqlCommand cmd = new SqlCommand("DELETE FROM Roomtable WHERE Roomnumber =


@Roomnumber", con);
cmd.Parameters.AddWithValue("@Roomnumber", int.Parse(textBox1room.Text));
// Fixed parameter name

cmd.ExecuteNonQuery();
con.Close();

MessageBox.Show("Record deleted successfully", "Deleted",


MessageBoxButtons.OK, MessageBoxIcon.Information);
}
New Room Entry Form(frmRoomEntry)
private void button2_Click(object sender, EventArgs e)
{
string dd = "INSERT INTO Roomtable (Roomnumber, RoomType , RoomPhone ,
Roomfree )VALUES (@Roomnumber, @RoomType , @RoomPhone , @Roomfree )";

SqlCommand cmd = new SqlCommand(dd, con);


cmd.Parameters.AddWithValue("@RoomType", comboBoxtype.Text);
cmd.Parameters.AddWithValue("@RoomPhone", textBoxphoneno.Text);
cmd.Parameters.AddWithValue("@Roomfree", comboBoxfree.Text);
cmd.Parameters.AddWithValue("@Roomnumber",textBoxroomno1.Text );
con.Open();
int h = cmd.ExecuteNonQuery();

if ( h> 0)
MessageBox.Show("Add succesfully...");
else
MessageBox.Show("Faild...");

con.Close();
}
Edit RoomForm(frmeditRoomDetail)
private void button1_Click(object sender, EventArgs e)
{SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-
6DONVN0\SQLEXPRESS;Initial Catalog=reception;Integrated Security=True;Pooling=False");

try
{
con.Open();

// SQL query to update the Roomtable


string query = "UPDATE Roomtable SET Roomtype = @Roomtype, RoomPhone = @RoomPhone,
Roomfree = @Roomfree WHERE Roomnumber = @Roomnumber";

// Using 'using' block to ensure the command is disposed of correctly


using (SqlCommand cmd = new SqlCommand(query, con))
{
// Add parameters to the command
cmd.Parameters.AddWithValue("@Roomnumber", int.Parse(textBox1room.Text)); //
Ensure this parses correctly
cmd.Parameters.AddWithValue("@Roomtype", comboBoxtype1.Text);
cmd.Parameters.AddWithValue("@RoomPhone", textBoxphone1.Text);
cmd.Parameters.AddWithValue("@Roomfree", comboBox1free.Text);

// Execute the update query


cmd.ExecuteNonQuery();
}

// Notify the user of success


MessageBox.Show("Update successful", "Updated", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
catch (Exception ex)
{
// Handle any errors that occur during the update
MessageBox.Show("Error: " + ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
// Always close the connection in a finally block to ensure it's closed even if an
exception occurs
if (con.State == ConnectionState.Open)
{
con.Close();
}
AddResevationForm:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace Hotal_management_system
{
public partial class reservation : Form
{
public reservation()
{
InitializeComponent();
}
SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-
6DONVN0\SQLEXPRESS;Initial Catalog=reception;Integrated Security=True;Pooling=False");

private void buttonaddres_Click(object sender, EventArgs e)


{

string dh= "INSERT INTO Reservation


(Id,Room_type,Room_number,client_Id,resin,out)VALUES(@Id,@Room_type,@Room_number,@clie
nt_Id, @resin,@out)";

SqlCommand cmd = new SqlCommand(dh, con);


cmd.Parameters.AddWithValue("@Id",textBoxresid3.Text);
cmd.Parameters.AddWithValue("@Room_type", comboBoxtypes4.Text);
cmd.Parameters.AddWithValue("@Room_number", comboBoxNOres.Text);
cmd.Parameters.AddWithValue("@client_Id",textBoxclientidres.Text);
cmd.Parameters.AddWithValue("@resin",dateTimePickerin.Text);
cmd.Parameters.AddWithValue("@out",dateTimePickerout.Text );
con.Open();
int res= cmd.ExecuteNonQuery();

if ( res> 0)
MessageBox.Show("Add succesfully...");
else
MessageBox.Show("Faild...");

con.Close();
}

private void textBoxucleintid1_TextChanged(object sender, EventArgs e)


{
string dj = "SELECT * FROM Reservation ";
SqlDataAdapter g = new SqlDataAdapter(dj, con);
SqlCommandBuilder cmd = new SqlCommandBuilder(g);
DataTable dt = new DataTable();
g.Fill(dt);
dataGridViewreservation.DataSource=dt;
}

private void buttoncancel2_Click(object sender, EventArgs e)


{
con.Open();

SqlCommand cmd = new SqlCommand("DELETE FROM Reservation WHERE Room_number


= @Room_number", con);
cmd.Parameters.AddWithValue("@Room_number",
int.Parse(textBoxclient9.Text)); // Fixed parameter name

cmd.ExecuteNonQuery();
con.Close();

MessageBox.Show("Cancel successful", "Canceled", MessageBoxButtons.OK,


MessageBoxIcon.Information);
}

private void buttonadd8_Click(object sender, EventArgs e)


{// Create the connection
SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-
6DONVN0\SQLEXPRESS;Initial Catalog=reception;Integrated Security=True;Pooling=False");

try
{
con.Open();

// SQL query to update the client_table


string query = "UPDATE Reservation SET Id = @Id, Room_type =
@Room_type, Room_number = @Room_number, resin = @resin, out = @out WHERE Client_Id =
@Client_Id";

// Using 'using' block to ensure the command is disposed of correctly


using (SqlCommand cmd = new SqlCommand(query, con))
{
// Add parameters to the command with explicit data types where
needed

cmd.Parameters.AddWithValue("@Id", textBox1.Text); // Assuming Id


is a string in this case (check data type)
cmd.Parameters.AddWithValue("@Room_type", comboBoxroomtype6.Text);
cmd.Parameters.AddWithValue("@Room_number", comboBoxroomno5.Text);
cmd.Parameters.AddWithValue("@Client_Id",
int.Parse(textBoxclient9.Text)); // Ensure Client_Id is parsed to an integer
cmd.Parameters.AddWithValue("@resin", dateTimePickerin3.Value);
// Use Value to get DateTime from DateTimePicker
cmd.Parameters.AddWithValue("@out", dateTimePickerout3.Value); //
Same here for the 'out' date

// Execute the update query


cmd.ExecuteNonQuery();
}

// Notify the user of success


MessageBox.Show("Update successful", "Updated", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
catch (Exception ex)
{
// Handle any errors that occur during the update
MessageBox.Show("Error: " + ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
// Always close the connection in a finally block to ensure it's
closed even if an exception occurs
if (con.State == ConnectionState.Open)
{
con.Close();
}
}

}
}
}
EditResevationForm:

private void buttonadd8_Click(object sender, EventArgs e)


{// Create the connection
SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-
6DONVN0\SQLEXPRESS;Initial Catalog=reception;Integrated Security=True;Pooling=False");

try
{
con.Open();

// SQL query to update the client_table


string query = "UPDATE Reservation SET Id = @Id, Room_type =
@Room_type, Room_number = @Room_number, resin = @resin, out = @out WHERE Client_Id =
@Client_Id";

// Using 'using' block to ensure the command is disposed of correctly


using (SqlCommand cmd = new SqlCommand(query, con))
{
// Add parameters to the command with explicit data types where
needed

cmd.Parameters.AddWithValue("@Id", textBox1.Text); // Assuming Id


is a string in this case (check data type)
cmd.Parameters.AddWithValue("@Room_type", comboBoxroomtype6.Text);
cmd.Parameters.AddWithValue("@Room_number", comboBoxroomno5.Text);
cmd.Parameters.AddWithValue("@Client_Id",
int.Parse(textBoxclient9.Text)); // Ensure Client_Id is parsed to an integer
cmd.Parameters.AddWithValue("@resin", dateTimePickerin3.Value);
// Use Value to get DateTime from DateTimePicker
cmd.Parameters.AddWithValue("@out", dateTimePickerout3.Value); //
Same here for the 'out' date

// Execute the update query


cmd.ExecuteNonQuery();
}

// Notify the user of success


MessageBox.Show("Update successful", "Updated", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
catch (Exception ex)
{
// Handle any errors that occur during the update
MessageBox.Show("Error: " + ex.Message, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
// Always close the connection in a finally block to ensure it's
closed even if an exception occurs
if (con.State == ConnectionState.Open)
{
con.Close();
}
}
CancelResevationForm

private void buttoncancel2_Click(object sender, EventArgs e)


{

con.Open();

SqlCommand cmd = new SqlCommand("DELETE FROM Reservation WHERE Room_number


= @Room_number", con);
cmd.Parameters.AddWithValue("@Room_number",
int.Parse(textBoxclient9.Text)); // Fixed parameter name

cmd.ExecuteNonQuery();
con.Close();

MessageBox.Show("Cancel successful", "Canceled", MessageBoxButtons.OK,


MessageBoxIcon.Information);
Dashboard1 from
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace Hotal_management_system
{
public partial class dashboard1 : Form
{
public dashboard1()
{
InitializeComponent();
}
SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-
6DONVN0\SQLEXPRESS;Initial Catalog=reception;Integrated Security=True;Pooling=False");

void showrooms()
{
string dj = "SELECT count(*) from Roomtable";
SqlCommand cmd = new SqlCommand(dj, con);
con.Open();
object rc = cmd.ExecuteScalar();
con.Close();
labelroom4.Text = rc.ToString();
}
void showclient()
{
string dj = "SELECT count(*) from client_table ";
SqlCommand cmd = new SqlCommand(dj, con);
con.Open();
object rc = cmd.ExecuteScalar();
con.Close();
labelclient4.Text = rc.ToString();
}

private void labelroom4_Click(object sender, EventArgs e)


{

private void dashboard1_Load(object sender, EventArgs e)


{
showrooms();
showclient();
}

}
}
About frm:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Hotal_management_system
{
public partial class abouts : Form
{
public abouts()
{
InitializeComponent();
}

private void lbl4_Click(object sender, EventArgs e)


{
login form2 = new login();
form2.Show();
}

private void label2_Click(object sender, EventArgs e)


{
login form2 = new login();
form2.Show();
}

private void lbl3_Click(object sender, EventArgs e)


{
contact form1 = new contact();
form1.Show();
}

private void label2_Click_1(object sender, EventArgs e)


{
Dashboard form1 = new Dashboard();
form1.Show();
}

private void lbl2_Click(object sender, EventArgs e)


{
about f = new about();
f.Show();
}

}
}
Reports
Reports

1. Room report:

This report will show the Room .


SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-
6DONVN0\SQLEXPRESS;Initial Catalog=reception;Integrated Security=True;Pooling=False");

private void button2_Click(object sender, EventArgs e)


{
string dd = "INSERT INTO Roomtable (Roomnumber, RoomType , RoomPhone ,
Roomfree )VALUES (@Roomnumber, @RoomType , @RoomPhone , @Roomfree )";

SqlCommand cmd = new SqlCommand(dd, con);


cmd.Parameters.AddWithValue("@RoomType", comboBoxtype.Text);
cmd.Parameters.AddWithValue("@RoomPhone", textBoxphoneno.Text);
cmd.Parameters.AddWithValue("@Roomfree", comboBoxfree.Text);
cmd.Parameters.AddWithValue("@Roomnumber",textBoxroomno1.Text );
con.Open();
int h = cmd.ExecuteNonQuery();

if ( h> 0)
MessageBox.Show("Add succesfully...");
else
MessageBox.Show("Faild...");

con.Close
}
Add Client Report
SqlConnection con = new SqlConnection(@"Server=.\SQLEXPRESS;Initial
Catalog=reception;Integrated Security=True;Pooling=False");

private void button1_Click(object sender, EventArgs e)


{

string reception = "INSERT INTO client_table (Client_id,


Client_name, Gender, Client_phone, Client_address) VALUES (@Client_id, @Client_name,
@Gender, @Client_phone, @Client_address) ";
SqlCommand cmd = new SqlCommand(reception, con);
cmd.Parameters.AddWithValue("@Client_id",textBoxclientid.Text);
cmd.Parameters.AddWithValue("@Client_name",textBoxclientname.Text);
cmd.Parameters.AddWithValue("@Gender",cmbGender.Text);
cmd.Parameters.AddWithValue("@Client_phone",textBoxphone.Text);
cmd.Parameters.AddWithValue("@Client_address",textBoxaddress.Text);
con.Open();
int stts= cmd.ExecuteNonQuery();
if(stts>0)
MessageBox.Show("Add succesfully...");
else
MessageBox.Show("Faild...");

con.Close();
}
Testing
Testing is a set of activities that can be planned in advance and conducted

systematically. For this reasona template for software testing a set of

steps into which can place specific test case design and testing methods

should be defined for the software process. All provide the software

developer with a template for testing and alll have the following generic

characteristics :

 To perform effective testing, a software team should conduct

effective normal technical reviews.

 Testing begins at the component level and works “outward” toward

the integeration of the entire computer-bassed system.

 Different testing techniques are appropriate at different points in

time.

 Testing is conducted by the developers of the software and (for

large project) an independent test groups.

 Testing and debugging are the different activities, but debugging

must be accomodated in any testing strategy.

TESTING PRINCIPLES: There are many principles that guide software

testing. Before applying methods to design effective test cases, a

software engineer must understand the basic principles that guide

software testing. Following are main principles for testing.


 All test should be traceable to customer requirements: This is

in order to uncover any defects that might cause the program or

systemto fail to meet the the clients requirements.

 Tests should be planned long before testing begins: Soon

after requirements model is completed, test planning can begin.

Detailled test cases can begin as soon as the design model is

designed.

 The Pareto principle applies to software testing: Stated

simply, the pareto principles implies that 80 of errors uncovered

during testing will likely be traceable to 20 percent of program

components and to throughly test them.

 Testing should begin “in the small” and progress towards

testing “il the large”: The first tests planned and executed

generally focus on individual components. As testing progresses,

focus shifts inan attempt to find errors in integrated clusters of

progresses and ultimately in the entire system.

 Exhaustive testing is not possible: The number of path

peramutation for even a moderately sized program is exceptionally

large. It is impossible to execute every combination of path during

testing.

 To be most effective, testing should be conducted by an

independent third party: The software engineer who has created


the system is not the best person to conduct all tests of the

software.

Testing Objectives: This objectives also demonstrates that the software

functions are working according to software requirement specifications

(SRS) with regard to functionallity, features, Facilities and performance.

 Testing is a process of executing a program with the intent of

finding an errors.

 A good test case is one that has a high probabillity of finding an as

yet undescovered error.

 A successful test is one that uncovers an as yet undiscovered

errors.

LEVELS OF TESTING:

There are three levels of testing individual module to the entire software

systems

Unit Testing: In unit testing individual components are tested to ensure

that they operate correctly.

 There are number of reasons in support of unit testing the entire

product.

 The size of a single module is small enough that we can locate an

error fairly easily.

 The module is small enough that we can attempt to test it in some

demonstrably exhaustive fashion.


 Confusing interactions of multiple errors in widely different parts of

the of software are eliminated.

Commans errors in Computation are:

1) Incorrect arithmetic precedence

2) Mixed code operations

3) Incorrect intializations

4) Precision inaccuracy

5) Incorrect symbolic representation of an expression.

Test cases in unit testing shiuld uncover error such as:

1) Comparision of different data types

2) Incorrect logical operation or precedence

3) Exception of equality when precision error makes equality unlikely

4) Incorrect comparison of variables

5) Improper loop termination

6) Failure to exit when divergent iteration is encountered

7) Improperly modified loop variables

Unit testing is a simplified when a component with a high cohesion is

designed. When only one functionis addressed by a component, the

number of test cases is reduced and errors can be more easily predicted

and uncovered.

Integration Testing :The second level of testing is called integration

testing. Integration testing is a systematic technique for constructing the


program structure while at same time conducting tests to uncover errors

is associated with interfacing.

In this testing many unit tested modules are combined into sub-system ,

which are then tested. The goal here is to see if the modules can be

integrated property.

Approches to Integration Testing: The various approaches , which are

used for the integration testing are:-

1) Incremental approaches

2) Top-down approaches

3) Bottam-up integration

4) Regression testing

5) Smoke testing

6) Sandwich Integration testing

System Testing: The sub-systems are inegrated to make up the entire

system. The testing process is concerned with finding error that result

most unanticipated between sub systems and system components. Its is

also concerend with validating that the system need its functional or non-

functional requirements.

There are essentially three main kinds of system testing:

1) Alpha Testing

2) Beta Testing

3) Acceptance Testing

Alpha Testing: Alpha Testing refers to the system testing caried out by

the test team with in development organization.


Beta Testing: Beta testing is the system testing performed by a selected

group of friendly customers.

1. Acceptance Testing: Acceptance testing is the testing performed

by the customer to determine whether to accept or reject the

delivery of the system.


Future Application

Various new features can be added so that it can attract more and more

people:

 The project can also be used in the hotel room so the customer can

also be familiar to the hotel system.

 This project can also be used for the future booking & provides the

report about any transaction.


CONCLUSION

The HOTEL MANAGEMENT SYSTEM is indeed a great help in simplifying

the collection of fine. The project will eliminate the need to maintain

resisters and makes the task easy.

It helps to maintain all the information about the customers, staff

members and rooms but there is a great scope of improvement of the

system as more improvisation would be added into the system, it would

become better.

I hope my project has given any reader a clear understatnding of the type

of computerized Hotel Managament System.


Biography

For the development this project I have to follow some books. The

methods and concepts of these books help me to solve conceptual

& syntax detailed problems.

1. C#.Net WROX

2. System Analysis & Design Elias M. Award

3. S/W Engineering Roger S. Pressman

You might also like