Professional Documents
Culture Documents
Hotel Reservation System
Hotel Reservation System
Introduction
1.1 backgrounds
One system to be well organized and technology based it must incorporate a good
information and data storing system. Our project focus on hotel room reservation system we
prepare database which used to store different information related to room reservation and this
data base facilitate searching and retrieve of specific data. And we also prepare GUI. This GUI
used to communicate end users the system.
Generally our project focus on making the hotel’s system modern and technology oriented.
1.2 purposes
The main purpose of this document is to simplify complexity of the system by identifying
The functional and nonfunctional requirements of the system and representing them use
modeling language (UML). This simplified representation is useful for the system end users,
customers and software developer.
1.3 Objective
Rooms information
Customers information
Employers information
1
Security issue To prevent unauthorized users from changing the already exist data
Because of this the new system should have security for accessing the data;
Back up it reserve data for future use, in the case of damaging and it also have backup
mechanism
The system doesn’t allow payment using credit card or master card because of the system
can’t access other database like bank database.
1.6 References
3,http://www.freetutes.com/systemanalysis/
1.7 Overview
This documentation contains four sections. The first section contains about
requirement elicitation and analysis phase and the second section contains design
phase ,the third section contain implementation, the fourth section contain about
quaternaries that we use to gather information.
requirement elicitation and analysis includes what is being done on the current
system, and all about the proposed system,,.
Proposed system includes overview of the proposed system, functional
requirements, on functional requirements and system models.
System models contain scenarios, use case model, object model and dynamic
models.
2
Actors and use case identification and use case diagram is described in use case
model which describe about the external functionality of the system according to
users point of view.
Identifying participant objects and class diagram are described in object model
which describe about structure of system.
Dynamic model also includes diagrams that are used to describe internal
interaction of the system such as sequence diagram, state diagram and activity
diagram.
In system design phase current software architecture and proposed software
architecture are included.
Proposed software architecture includes subsystem decomposition,
hardware/software mapping, persistence data management, access control and
security, global software control ,boundary condition and subsystem service.
Implementation section describe a general description about how to operate each
block of code.
The last section that include in this document is questionnaires that we prepared for
gathering information from the hotel.
The hotel uses traditional file system to store reservation information. And there are a lot of
problem with this traditional file system, Take much time and resource to store, searching and
retrieve data, clashing of reserved rooms , the customer wait a long time to make and cancel
reservation and difficult to reserve the rooms from other place.
3
2.2 Proposed system
2.2.1 Overview
The new system will proposed to keep record in electronic file cabinet called database.
Which used to store different information related to room reservation and this data base
facilitate searching and retrieve of specific data. The proposed system also has GUI. This
GUI used to communicate end users the system.
The system use database to store information and this data base has tables to store customers
and rooms information. The system has also use graphical user interface (GUI) to interact user
with the system this GUI has form to accept information from users and to insert this information
to the data base.
4
2.2.3 Non functional requirements
Show room
Up date password
Crate reservation
Cancel reservation
receptionist Receptionist
ancel
Log in Menu Update reservation
rrrrereservation
date reservation
reservation
Show reservation
Update password
password
Show room
5
2.2.5 Performance characteristics
The system provide reasonable response time
2.2.8 Documentation
The system includes help and support files. This help how to use the system and how to
handle errors if it happens
2.3.1 Scenario
Scenario 1
Flow of event:-
6
Scenario 2
Flow of event:-
Flow of event:-
1. If there is any failurity in the room e.g room window may brake, failurity in bath room etc…
room controller report this problem to the manger and also the room controller give the room
number in which the failurity appear.
2. Manger accept the report and the room number if there is room that must be closed and it
must be maintain the manger search the room according to room number and delete this room
information from the data base.
Scenario 4
Flow of event:-
1. If there is room that full fill quality and ready to be reserved the room controller report
associated with all required room information this information to the manger.
2. Manger accepts the report and add the room based on information.
7
2.3.2.1 Actors Identification
1. Guest: who request reservation service and responsible for pay for reservation service
and cancel reservation when he/she leaves the room.
2. Manager:-who mange the hotel and responsible for change room pricing, add room
and delete.
3. Receptionist:- who receive the guest and responsible for check room availability
,make reservation and cancel reservation
4. Room controller:- who control the room and responsible for Check and Report room
quality
3.they will enter in the guest ID number(note: if it is a new guest they must enter
in the guest information before making a reservation) the screen should fill the guest first and
last name, address , phone number, nationality, room number data of arrival and departure.
Use case 2
3. They will enter the guest id. After clicking button “Cancel “Successfully
Deleted message is display if the guest id is correct.
8
Exit condition:-5 guests acknowledgment for the service
Use case 3
Flow of event: - 2. Manger select “manger login” then “up date room information” button from
menu screen then enter room number and enter new price and other new information. After
clicking button “update” if the room number is correct Successfully updated message will
display.
Use case 4
Flow of event: - 2. Manger select “manger login” button from menu screen then select “add
room” button the screen should fill room number, room type, bed type .price per night and
description. Then click “add “button. If the room number does not conflict previous room
number. Successfully add room message will display.
Use case 5
Flow of event: - 2. Manger select “manger login” button from menu screen then select “delete
room” button
9
3. They will enter the room number and select “delete” button. if the room
number is exist Successfully Deleted message will display
Use case 6
Flow of event: - 2. Receptionist select “receptionist login” button from menu screen then select
“show room information” button
3. They will enter the room number and select “show” button
Exit condition:-4 if the room number is correct all information will display.
10
hotel room reservaion system
cancel reservation
reseptionalist
guest
<<include>>
make reservation
<<include>>
manager
add room
delet room
This topic is concerned with describing objects that will be managed/manipulated by the system.
The objects that will be managed are
1. Guest
2. Room
11
3. Employer
4. Reservation
Object: - Guest
Attribute:-
First_ name
Last _name
Address
Nationality
Phone number
Id
Object: - Room
Attribute:-
Description
Availability
Bed type
Room _number
Priceper_night
Object: - Employer
Attribute:-
Object: - Reservation
12
Attribute:-
date of arrival
date of departure
room number
13
2.4.2 Class diagram
guest
-fname
reservtion -lname
+idno room
+conformation number
+address +room no
-date of departure 1 *
+nationality +avalablity
-date of arival
* 1 +phone number +price per night
+room number
+make reservation() +room type
+cancel reservation()
+payfor reservation()
*
+gurantee reservation()
resptionalist
+make reservation()
employer
-fname
-lname * *
+idno
+password
+phone number
room controler
+address
+reservation service() +cheke& report room quality()
* *
manager
* 1
+add room()
+delete room()
+change room pricing()
14
2.5 dynamic models
2.5.1 Sequence diagram
1 sequence diagram for make reservation use case
/ : Guest
1 : reques resrvation()
4 : record information()
6 : return message()
7 : return message()
8 : return message()
9 : give valide information()
10 : record informatin()
15
/GUI /DB
/Resptionsit
/ : Guest
1 : reques to cancel resrvation()
6 : return message()
7 : return message()
8 : return message()
9 : give valide room()
10 : inter room()
12 : return message()
13 : return message()
14 : return message()
16
3 sequence diagram for delete room use case
/ : room controler
1 : report to delet room()
4 : return message()
5 : return message()
6 : return message()
17
4 sequence diagram for add room use case
/ : room controler
1 : report to add room()
2 : fill information()
4 : return data()
6 : responce()
18
2.5.2 Activity diagram
request reservation
reserve information
[unsatsify]
[satsify]
[VALID]
cancel reservation
19
2.5.3 State chart diagram
1 state chart diagram for guest object
20
requestresrvation
else
if[not sefficent]
else
21
2 state chart for guest object
22
3. System design
3.1 Design goals
User interface:-it is front end the system and developed with Microsoft visual studio
2008 and this interface is convenient and attractive, easy to use, easily understandable by
all users.
Performance characteristics:- include the speed and space requirements imposed on the
system.
Speed:- the system should provide good response time and maximum
throughput
Space: - the system requires high memory available to optimize speed and the
system should use memory sparingly.
To achieve those Performance characteristics we use a relational database because, A
relational database provides:-an abstraction of data that is higher than flat files, Complex queries over
attributes, large dataset ,Relational databases have been used for awhile and are a mature technology.
Documentation:-The system includes help and support files. This help how to use
the system and how to handle errors if it happens
Error handling :- the system use exception handling mechanism and error report
message box to indicate the error is occurred
3.3.1 Overview
In this SDD we describe what is the hardware configuration of the system, which
Node is responsible for which functionality, how is communication between nodes realized,
What type of data management system we use, how to access and control the system. How does
the system sequence operations, How is the system initialized, How is it shut down and How are
Exceptional cases detected and handled.
23
3.3.2 Subsystem decomposition
Hotel Rome reservation system decomposed into Database manager (administrator)
Interfaces sub system implementing user interface for Manager to add, delete and update
room’s information.
Receptionist interface sub system implementing user interface for receptionist to add, delete
and up date reservation information.
Repository sub system implementing the communication between Receptionist and
manager
interface
manager recreationalist
Repository
database
24
3.3.3 Hardware/software mapping
The proposed system two tire software architecture
Dell pc Dell pc
Studio
Dell pc
Acer pc
Microsoft visual
Studio
25
3.3.4 Persistent data management
To store our persistence data we use relational database system by using Microsoft access
database.
ERDIGRAME
26
first name nationality roomcost roomno
id Reservation
Guest datearrival
comfiremno
lastname
phone no
datedeparture
gaddress
Control
make Books
room type
fname
Room
Employer
price per night eaddress
room number
avalability username
eid
27
Guest table
Receptionist table
28
Reservation table
29
3.3.6 Global software control
The system is event driven that means if the user (administrator/recreationalist) click on some
button the system perform some action.
Execution ()
Log in
Delete Database
command
Add ()
Menu
Execution ()
Delete ()
Update ()
Update
Command command Search ()
Menu item
Execution Execution ()
()
Search
command
Execution ()
30
3.3.7 Boundary conditions
<<include>>
manger
confger server
manager
resptionsit
+add room info()
+crate reservation() +delete room info()
+cancel reservation() +update room info()
+update reservation()
31
4. Implementation
1 create reservation
int rn;
32
DateTime today= DateTime.Now; //to get the current date
DateTime indate=dateTimePicker1.Value;
DateTime outdate = dateTimePicker2.Value;
}
else if (isNumeric)
{
MessageBox.Show("first name must text", "Error");
fname.Focus();
}
else if (isNum)
{
MessageBox.Show("last name must text", "Error");
lname.Focus();
}
else if (isn)
{
MessageBox.Show("nationality must text", "Error");
nation.Focus();
}
else if (!isnu)
{
MessageBox.Show("phone number must be number");
try
{
if (phone.TextLength != 10)
throw new Exception("pone number must be 10 diget");
}
catch
{
MessageBox.Show("Invalid phone number", "Entry Error");
}
}
/* the following code segement do first open connection with data base and
reade the data from the room table by specifically select room number
column records then coompare it with input room number if the input room
number is not reserved previously” all information in crete resrvation enter
in to resrvation and geust tabe then Successfully create resrvation
conformation number “will display else” ths room is olredy resrved pleas
select anoter room” message will displayed.or if the room number is doen’t
exist in room table "there is no this type of room" message will display */
33
else
{
try
{
con.Open();/ / to open connection
OleDbDataReader reade = null;
OleDbCommand cmdd = new OleDbCommand("select * from room
where( r_number=" + room_no.Value + " ) ", con);//to read the data from room
table
reade = cmdd.ExecuteReader();
while (reade.Read())
{
rn = (int)reade["r_number"];
if (room_no.Value == rn)
{
if (male.Checked == true)
{
com.ExecuteNonQuery();
comm.ExecuteNonQuery();
34
query2 = "insert into resrvation values ('" +
dateTimePicker1.Value + "', '" + dateTimePicker2.Value + "', " +
room_no.Value + ",'" + id.Text + "')";
com.ExecuteNonQuery();
comm.ExecuteNonQuery();
con.Close();
}
}
35
2.Cancel reservation
/* the following code segement do first accept guest id to delet if the guest
id is exist delet all information releted to this gust id number from guest and
resrvation table then “ Successfully Deleted” massage will displayed.
Else there is no this roomnumbre massage will displayed.
string ss;
OleDbConnection con = new
OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=C:\Users\FAN\Documents\Visual Studio
2008\Projects\hotel\WindowsFormsApplication1\hotel.accdb");
public delet_resrvation()
{
InitializeComponent();
}
string query;
string query2;
if (id.Text == "")
{
MessageBox.Show("enter the gguest id");
}
else
{
try
36
{
con.Open();
OleDbDataReader reade = null;
OleDbCommand cmdd = new OleDbCommand("select * from guest
where (g_id='" + id.Text + "')", con);
reade = cmdd.ExecuteReader();
while (reade.Read())
{
ss = reade["g_id"].ToString();
if (id.Text == ss)
{
else
{
MessageBox.Show("there is no this roomnumbre");
}
}
37
{
id.Text = "";
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
con.Close();
}
}
}
38
3.Update reservation
//the following code segments used to validate input data that accept throw controls
39
DateTime indate = dateTimePicker1.Value;
DateTime outdate = dateTimePicker2.Value;
else if (isNumeric)
{
MessageBox.Show("first name must text", "Error");
fname.Focus();
}
else if (indate < today || outdate < indate)
{
MessageBox.Show("please enter the correct date");
}
else if (isNum)
{
MessageBox.Show("last name must text", "Error");
lname.Focus();
}
else if (isn)
{
MessageBox.Show("nationality must text", "Error");
nation.Focus();
}
else if (!isnu)
{
MessageBox.Show("phone number must be number");
try
{
if (phone.TextLength != 10)
throw new Exception("pone number must be 10 diget");
}
catch
{
MessageBox.Show("Invalid phone number", "Entry Error");
}
}
else
{
/*The following code segment do it accept guest id if the guest id is exist up date all
information related to this guest id then “Successfully updated” message will
display.else incorreect gust id incorreect gust id display*/
try
{
con.Open();
OleDbDataReader reade = null;
40
OleDbCommand cmdd = new OleDbCommand("select * from guest
where (g_id=" + textBox1.Text + ")", con);
reade = cmdd.ExecuteReader();
while (reade.Read())
{
ss = reade["g_id"].ToString();
if (textBox1.Text == ss)
{
if (male.Checked == true)
{
query = "update guest set g_fname='" + fname.Text
+ "', g_lname=' " + lname.Text + "',g_id= " + id.Text + ",g_address= '" +
adress.Text + "',g_nation='" + nation.Text + "' ,g_phone=" + phone.Text +
",g_sex='" + male.Text + "' where ( g_id= '" +id.Text+ "')";
query2 = "update resrvation set in_date='" +
dateTimePicker1.Value + "', out _date=' " + dateTimePicker2.Value +
"',r_number= " + numericUpDown1.Value + ",g_address= '" + adress.Text +
"',g_id='" + id.Text + "' where ( g_id= '" + id.Text + "')"; //sql command
used to update date from the database
OleDbCommand com = new OleDbCommand(query, con);
com.ExecuteNonQuery();
MessageBox.Show("Successfully updated");
}
else if (female.Checked == true)
{
}
else
{
MessageBox.Show("incorreect gust id");
41
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
con.Close();
}
}
fname.Text = "";
lname.Text = "";
id.Text = "";
adress.Text = "";
numericUpDown1.Value =0 ;
nation.Text = "";
phone.Text = "";
// level.SelectedIndex=0;
// price.Text = "";
}
}
}
}
42
4. Show reservation
string ss;
OleDbConnection con = new
OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=C:\Users\FAN\Documents\Visual Studio
2008\Projects\hotel\WindowsFormsApplication1\hotel.accdb");//to connect
database with application
public show_rervation()
{
InitializeComponent();
}
}
else
43
{
try
{
con.Open();
OleDbDataReader reade = null;
OleDbCommand cmdd = new OleDbCommand("select * from guest
where (g_id='" + textBox1.Text + "')", con); /*sql command used to select
information in table */
reade = cmdd.ExecuteReader();
while (reade.Read())
{
ss = reade["g_id"].ToString();
// pa = reade["pass"].ToString();
// ss = reade["g_id"];
if (textBox1.Text == ss)
{
// con.Open();
string query = " select * from resrvation
where(g_id='" + textBox1.Text + "')";
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(query,
con);
da.Fill(dt);
dataGridView1.DataSource = dt;
}
else
{
MessageBox.Show("incorrect id");
}
}
try
{
44
con.Open();
string query = " select * from resrvation ";
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(query, con);
da.Fill(dt);
dataGridView1.DataSource = dt;
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
// the following code segments used to up date receptionist password it first accept the
previous receptionist password and compare it with receptionist password in the
receptionist table if it exist update the password and user name then display
“Successfully up dated” message else it display “incoorect password please
enter the correct information” message.*/
public partial class delet_employer : Form
{
OleDbConnection con = new
OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=C:\Users\FAN\Documents\Visual Studio
2008\Projects\hotel\WindowsFormsApplication1\hotel.accdb");
string pa;
public delet_employer()
{
InitializeComponent();
}
45
private void button1_Click(object sender, EventArgs e)
{
string query;
try
{
con.Open();
OleDbDataReader reade = null;
OleDbCommand cmdd = new OleDbCommand("select * from
receptionist", con);
reade = cmdd.ExecuteReader();
while (reade.Read())
{
pa = reade["pass"].ToString();
if (p_pass.Text==pa)
{
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
con.Close();
}
46
6. Update manger password
// the following code segments used to up date manger password it first accept the
previous manger password and compare it with manger password in the manger
table if it exist update the password and user name then display “Successfully up
dated” message else it display “incoorect password please enter the
correct information” message.*/
public partial class mang_login : Form
{
OleDbConnection con = new
OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=C:\Users\FAN\Documents\Visual Studio
2008\Projects\hotel\WindowsFormsApplication1\hotel.accdb");
string pa;
public mang_login()
{
InitializeComponent();
}
47
while (reade.Read())
{
pa = reade["pass"].ToString();
if (p_pass.Text == pa)
{
query = "update manger set u_name='" + n_uname.Text + "',
pass='" + n_pass.Text + "' where(pass='" + p_pass.Text + "')";
}
else {
MessageBox.Show("please enter the correct information");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
con.Close();
}
7. Add room
48
/* when the manager want to add new room first fill all required information and
check weather it is in correct format or not and if the data is valid insert the data
to room table and “insert successfully” message will be displayed.
OleDbConnection con = new
OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=C:\Users\FAN\Documents\Visual Studio
2008\Projects\hotel\WindowsFormsApplication1\hotel.accdb");
public add_room()
{
InitializeComponent();
}
string query;
int num;
bool isnum = int.TryParse(price.Text, out num);
if (price.Text == "" && numericUpDown1.Value == 0)
{
MessageBox.Show("please fill all requrment");
}
else if (!isnum)
{
MessageBox.Show("price must be number");
}
else
{
try
{
con.Open();
query = "insert into room values (" +
numericUpDown1.Value + ", ' " + comboBox1.SelectedItem + "', " +
numericUpDown2.Value + ", " + numericUpDown3.Value + "," + price.Text + ")";
OleDbCommand com = new OleDbCommand(query, con);
com.ExecuteNonQuery();
MessageBox.Show("Successfully add room");
}
catch (OleDbException t)
{
MessageBox.Show("ths room is olredy execet please enter
anoter room number"+t);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
con.Close();
}
49
8.cancel room
/* to cancel room from room table insert the room number and chcek wehter the room
number is found or not and if it is found cancel the spesified room from room table and
“delate succesfuly” message will be displayed. If the room is not avalable the” room not
found” missage will be displayed.
OleDbConnection con = new
OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=C:\Users\FAN\Documents\Visual Studio
2008\Projects\hotel\WindowsFormsApplication1\hotel.accdb");
string ss;
public delete_room()
{
InitializeComponent();
}
50
{
MessageBox.Show("enter the room number");
}
else if(!isnumbr)
{
MessageBox.Show("room number must be number");
}
else
{
con.Open();
OleDbDataReader reade = null;
OleDbCommand cmdd = new OleDbCommand("select * from room
where (r_number=" + textBox1.Text+ ")", con);
reade = cmdd.ExecuteReader();
while (reade.Read())
{
ss = reade["r_number"].ToString();
if (textBox1.Text == ss)
{
}
else{
MessageBox.Show("room number note found");
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
con.Close();
51
8. Update room
/* to update the room information first accept room number that need to be updated and
check the room is found or not. if it is found, insert all information about the room and
validate the data if it is in a correct format insert the updated information to room table
and “update successfully” message will found. Else” room is not found” message will be
displayed.
OleDbConnection con = new
OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=C:\Users\FAN\Documents\Visual Studio
2008\Projects\hotel\WindowsFormsApplication1\hotel.accdb");
string ss;
public up_date_room()
{
InitializeComponent();
}
52
}
try
{
con.Open();
OleDbDataReader reade = null;
OleDbCommand cmdd = new OleDbCommand("select * from room
where (r_number=" +pre_roomno.Value + ")", con); /*sql command used to select
specific room information*/
reade = cmdd.ExecuteReader();
while (reade.Read())
{
ss = reade["r_number"].ToString();
}
if ( pre_roomno.Value.ToString()==ss)
{
string query;
query = "update room set r_number=" +
new_roomno.Value + ", r_level=' " + leve.SelectedItem + "',n_bed= " +
no_bed.Value + ",buld= " + buld.Value + ",price=" + price.Text + " where (
r_number = " + pre_roomno.Value + ")";); /*sql command used to update the
room information*/
OleDbCommand com = new OleDbCommand(query, con);
com.ExecuteNonQuery();
MessageBox.Show("Successfully updated");
}
else
{
MessageBox.Show("room number not found");
53
catch (Exception ee)
{
MessageBox.Show(ee.Message);
}
con.Close();
}
}
/*to show room information first insert the specified room number that need to be
displayed and if the room number is available the room information is displayed through
data grid view. Else “room is not found “message will be displayed.
*/
public partial class show_room : Form
{
OleDbConnection con = new
OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data
54
Source=C:\Users\FAN\Documents\Visual Studio
2008\Projects\hotel\WindowsFormsApplication1\hotel.accdb");
string ss;
public show_room()
{
InitializeComponent();
}
else
{
con.Open();
OleDbDataReader reade = null;
OleDbCommand cmdd = new OleDbCommand("select * from room
where (r_number=" + textBox1.Text+ ")", con);
reade = cmdd.ExecuteReader();
while (reade.Read())
{
ss = reade["r_number"].ToString();
if (textBox1.Text == ss)
{
dataGridView1.DataSource = dt;
}
else{
MessageBox.Show("room number not found");
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
55
con.Close();
}
dataGridView1.DataSource = dt;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
con.Close();
}
56
5. Questioner
We prepare the question for gathering all information about the current system , to
identify the problem and the requirement of users ,and we get all relevant
information from hotel manger(Ato Zekarias Tefera). And he gives all response
according to our question.
57