1. 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
1.3.1, General Objective of the project The main objective of our project is changing manual room reservation system in to computerized system by deeply investigate the technological problems associated with the hotel room reservation system which would alive the existing system. 1.3.2 SPECIFIC OBJECTIVES To make of searching specific data, storing and retrieving data access operations more organized and faster. To reduce time to reserve the room. To avoid Clashing of reserved room
1.4 scopes
The new system should provide the following service store Reservation information in organize manner about 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.5 Definitions, acronyms, and abbreviations -GUI:- graphical user interface -RE;-requirement elastration -UML: - unify modeling language -ER DIGRAME: - Entity relational diagram -SDD: .System Design Document
1.6 References 1, system analysis design methods sixth edition by whiten Bentleydittman 2, software engineering seventh edition by Summerville 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.
2 .Requirement elicitation and analyses 2 .1current system Get Smart hotel is one of the hotel that found in south Ethiopia Dilla city around molla golja.and it provide different service and one of the service provide by Get smart hotel is room services .there are a number of employers participate to give this service .some of this are manger, room controller and Receptionist and each employer has their own responsibility. Manager:-who mange the hotel and responsible for change room pricing, add room and delete. Receptionist: - who receive the guest and responsible for check room availability, make reservation and cancel reservation. Room controller: - who control the room and responsible for Check and Report room quality .to accomplish this task these employers interact each other and with guest. 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.
2.2.2 Functional requirements Room reservation system is a system that used to make room reservation based on customers need. 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. The system provides the following service
Make reservation without clashing By Storing room status information By Storing customer information Cancel reservation easily
4
2.2.3 Non functional requirements 2.2.4 User interface The system has user interface to communicate user with in the system it look like the figure below.
Add room
Manger menu
manager Log in
Up date room Show room
Main
Delete room
Menu
Show reservation Up date password Crate reservation
receptionist Log in
Receptionist Menu
Cancel reservation ancel 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.6 Security issues The system has login page it allow only the user who have privilege to accuse the database therefore the data can’t accused easily by any user.
2.2.7 Error handling When the user makes some mistakes the system responds that error is occurred using easily understandable messages and allows the user to recover from the error.
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 System model
2.3.1 Scenario Scenario 1
Scenario name:-Guest wants to reserve room Participating actors:-Guest and Receptionist Flow of event:1. The guest gives all required information to Receptionist 2. The Receptionist informed about different room type availability and the price for each of room types 3. Guest can make an informed decision in what they want 4. After the reservation is complete the hotel database will assign a guest ID number to the new customer. 5. The Receptionist give confirmation number to the guest 6. The guest is concerned they are simply given a confirmation number for the reservation Which they present upon arrival.
6
Scenario 2
Scenario name:-Guest wants to cancel reservation Participating actors:-Guest and Receptionist Flow of event:1. the guest give the confirmation number to Receptionist 2. The Receptionist take confirmation number and using this number search the guest information from database then simple cancel reservation. Scenario 3
Scenario name:-room failurity Participating actors:-room controller and manager 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
Scenario name:-add new room Participating actors:-room controller and manager 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.
2.3. 2 use case model 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
2.3.2.2 Use case identification Use case 1
Use case name:-make reservation Participating actor: - initiated by guest communicate with Receptionist Entry condition:-1.guest request reservation service Flow of event:- 2. Receptionist choose “receptionist login” then “create reservation” 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. 4. After clicking button “create” conformation number will be displayed if the room is free or ths room is olredy resrved pleas select anoter room messge will display. Exit condition:-5 guests receive conformation number and give acknowledgment Use case 2
Use case name:-cancel reservation Participating actor: - initiated by guest communicate with Receptionist Entry condition:-1.guest request to cancel reservation Flow of event: - 2. Receptionist choose “receptionist login “then “cancel reservation” 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
Use case name:-change room pricing Participating actor: - manger Entry condition:-1.manger wants to change room price 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. Exit condition:-3. exit Use case 4
Use case name:-add room Participating actor: - manger Entry condition:-1.manger wants to add new room 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. Exit condition:-3. exit
Use case 5
Use case name:-delete room Participating actor: - manger Entry condition:-1.manger wants to delete new room 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 Exit condition:-4 exit Use case 6
Use case name:-check room availability Participating actor: - initiated by guest communicate with Receptionist Entry condition:-1. Receptionists want to check room availability 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. Use case 7:- pay for reservation Use case 8:- guarantee reservation Use case 9:- check and report room quality
2.3.2.3
use case diagram
10
hotel room reservaion system
cancel reservation reseptionalist guest
make reservation
<>
check room avalablity <> <>
pay for reservation guarantee reservation
manager
room controler
add room check room quality delet room
change room price
2.4
object model 2.4.1 Identifying participant objects
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 Attributes of the object are:. 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: Employer first name
Employer last name Employer id Password Phone number Address
Object: - Reservation 12
Attribute: date of arrival date of departure room number
13
2.4.2
Class diagram guest reservtion +conformation number -date of departure -date of arival * +room number
1
-fname -lname +idno +address +nationality +phone number
room 1
*
+make reservation() +cancel reservation() +payfor reservation() +gurantee reservation()
*
resptionalist +make reservation()
employer -fname -lname +idno +password +phone number +address
*
* room controler
+reservation service()
+cheke& report room quality() *
*
manager *
1
14
+add room() +delete room() +change room pricing()
+room no +avalablity +price per night +room type
2.5
dynamic models
2.5.1 Sequence diagram 1 sequence diagram for make reservation use case
/Resptionsit
/GUI
/DB
/ : Guest 1 : reques resrvation()
2 : give resrvation information() 3 : choose room,pay&give requr information() 4 : record information()
5 : get rservation information,if invalid()
6 : return message() 7 : return message() 8 : return message() 9 : give valide information() 10 : record informatin() 11 : get resrvation information,if valide()
12 : return room number() 13 : return room numer() 14 : return room nuber()
2 sequence diagram for cancel reservation use case 15
/GUI
/Resptionsit
/DB
/ : Guest 1 : reques to cancel resrvation()
2 : request room number() 3 : give room number() 4 : inter room number()
5 : get room nmber.if invalide roomnumber()
6 : return message() 7 : return message() 8 : return message() 9 : give valide room() 10 : inter room() 11 : get room number,if valide room number()
12 : return message() 13 : return message() 14 : return message()
16
3 sequence diagram for delete room use case
/manager
/GUI
/database
/ : room controler 1 : report to delet room() 2 : inter room number() 3 : add room number()
4 : return message() 5 : return message() 6 : return message()
17
4 sequence diagram for add room use case
/manager
/GUI
/database
/ : room controler 1 : report to add room() 2 : fill information() 3 : add room information()
4 : return data() 5 : return room data() 6 : responce()
18
2.5.2 Activity diagram
request reservation
reserve information [unsatsify] [satsify]
select room
give all require information
record requird information [invalid information] [VALID] conformation number generate
cancel reservation
19
pay for reservation
2.5.3 State chart diagram 1 state chart diagram for guest object
20
requestresrvation
get resrvation information
give requre information
choose room
else
pay for resrvation if[not sefficent]
else
get conformation number
21
if[in valide]
2 state chart for guest object
get room report
show room quality
delet room
add room
22
3. System design 3.1 Design goals Design goals of the propose system
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.
Security:-The application must implement basic security behaviors: Authentication: Login using a user name and a password Authorization: as per our software specifications, manager will have enhanced privileges to perform tasks that general user would not be authorized.
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.2. Current software architecture The current system doesn’t use any computerized system to provide service Hence there is no software architecture.
3.3 Proposed software architecture 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
Fig Subsystem decomposition
interface
manager
recreationalist
Repository
database
24
3.3.3 Hardware/software mapping The proposed system two tire software architecture
Dell pc
Dell pc
Microsoft visual
Database server
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
nationality
first name
roomcost id
roomno
Reservation
datearrival
Guest
comfiremno
lastname phone no
datedeparture
gaddress
Control make
Books
room type password
bed type
fname Room Employer
price per night
eaddress room number avalability
username
27
eid
Guest table Attribute F_name L_name Id Phone no Address Nationality Room table
Data type text text text text text text
Length 25 25 25
Attribute room type bed type Availability room no Manger table
Data type text text text number
Length 25 25 25
Attribute F_name L_name Id Username Address Password
Data type text text text text text text
Length 25 25 25 25 25 25
Data type text text text text text text
Length 25 25 25 25 25 25
25 25
Receptionist table Attribute F_name L_name Id Username Address Password
28
Reservation table Attribute room no in date Outdate Conformation no Cost per date
Data type number number number number number
Length
3.3.5 Access control and security Object Actor Manger
Receptionist
Guest
Room
Add room information () Delete room information () Update room information () Add guest information Show room () information() Delete guest information () Update guest information()
29
Reservation show reservation ()
show reservation () crate reservation() cancel reservation() update reservation()
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. Manager
Add command
Receptionist
Application
Execution () Log in Delete command Menu
Execution ()
Database Add () Delete () Update ()
Menu item
Command
Update command
Execution ()
Execution () Search command Execution ()
30
Search ()
3.3.7 Boundary conditions <>
start srver
<> manage server
<>
shut down server
manger confger server
3.4. Subsystem services
hotel room reservation
manager resptionsit +crate reservation() +cancel reservation() +update reservation()
+add room info() +delete room info() +update room info()
31
4. Implementation 1 create reservation
//to connect database with application OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\FAN\Documents\Visual Studio 2008\Projects\hotel\WindowsFormsApplication1\hotel.accdb"); int rn; private void button1_Click(object sender, EventArgs e) { string query; string query2;
//for validting the input data int fnam, lnam, nat, phon; bool isNumeric = int.TryParse(fname.Text, out fnam); bool isNum = int.TryParse(lname.Text, out lnam); bool isn = int.TryParse(nation.Text, out nat); bool isnu = int.TryParse(phone.Text, out phon);
32
DateTime today= DateTime.Now; //to get the DateTime indate=dateTimePicker1.Value; DateTime outdate = dateTimePicker2.Value;
current date
if (fname.Text == "" && lname.Text == "" && nation.Text == "" && phone.Text == "") { MessageBox.Show("please fill all requrement"); } else if(indate
} 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) {
query = "insert into guest values ('" + fname.Text + "', ' " + lname.Text + "','" + id.Text + "', ' " + adress.Text + "','" + nation.Text + "'," + phone.Text + ",'" + male.Text + "')"; query2 = "insert into resrvation values ('" + dateTimePicker1.Value + "', '" + dateTimePicker2.Value + "'," + room_no.Value + ",'" + id.Text + "')";
//sql command used to insert the date
in to database OleDbCommand comm = new OleDbCommand(query2, con); OleDbCommand com = new OleDbCommand(query, con); com.ExecuteNonQuery(); comm.ExecuteNonQuery(); MessageBox.Show("Successfully create resrvation conformation number=>"+room_no.Value); } else if (female.Checked == true) { //con.Open(); query = "insert into guest values ('" + fname.Text + "', ' " + lname.Text + "','" + id.Text + "', ' " + adress.Text + "','" + nation.Text + "'," + phone.Text + ",'" + female.Text + "')";
34
query2 = "insert into resrvation values ('" + dateTimePicker1.Value + "', '" + dateTimePicker2.Value + "', " + room_no.Value + ",'" + id.Text + "')"; OleDbCommand comm = new OleDbCommand(query2, con); OleDbCommand com = new OleDbCommand(query, con); com.ExecuteNonQuery(); comm.ExecuteNonQuery(); MessageBox.Show("Successfully create resrvation conformation number=>" + room_no.Value); } } else { MessageBox.Show("there is no this type of room"); } } catch (OleDbException ) { MessageBox.Show("ths room is olredy resrved pleas select anoter room" ); } catch (Exception ex) { MessageBox.Show(ex.Message); } 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(); } private void button1_Click(object sender, EventArgs e) { 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) { query = "delete from guest where (g_id= '" + id.Text + "')"; query2 = "delete from resrvation where (g_id= '" + id.Text + "')"; OleDbCommand com = new OleDbCommand(query, con); OleDbCommand comm = new OleDbCommand(query2, con); com.ExecuteNonQuery(); comm.ExecuteNonQuery(); MessageBox.Show("Successfully
Deleted ");
} else { MessageBox.Show("there is no this roomnumbre"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); } } private void numericUpDown1_ValueChanged(object sender, EventArgs e) { } private void label3_Click(object sender, EventArgs e) { Form4 bbb = new Form4(); bbb.Show(); this.Hide(); } private void button2_Click(object sender, EventArgs e)
37
{ id.Text = ""; } private void button3_Click(object sender, EventArgs e) { this.Close(); } private void button4_Click(object sender, EventArgs e) { string query1; string query3; try { con.Open(); query1 = "delete * from guest "; query3 = "delete * from resrvation "; OleDbCommand comd = new OleDbCommand(query1, con); OleDbCommand commd = new OleDbCommand(query3, con); comd.ExecuteNonQuery(); commd.ExecuteNonQuery(); MessageBox.Show("Successfully Deleted"); } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); } } }
38
3.Update reservation
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 String query, query2,ss;
//the following code segments used to validate input data that accept throw controls private void button1_Click(object sender, EventArgs e) { int fnam, lnam, nat, phon,tex; bool isnumber = int.TryParse(textBox1.Text, out tex); bool isNumeric = int.TryParse(fname.Text, out fnam); bool isNum = int.TryParse(lname.Text, out lnam); bool isn = int.TryParse(nation.Text, out nat); bool isnu = int.TryParse(phone.Text, out phon); // bool isnumeri = int.TryParse(price.Text, out pr); DateTime today = DateTime.Now;
39
DateTime indate = dateTimePicker1.Value; DateTime outdate = dateTimePicker2.Value; if (textBox1.Text == "" && fname.Text == "" && lname.Text == "" && nation.Text == "" && phone.Text == "" ) { MessageBox.Show("please fill all requrement"); } 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 } else if (female.Checked == true) {
updated");
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='" + female.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 + "')"; OleDbCommand com = new OleDbCommand(query, con); OleDbCommand comm = new OleDbCommand(query2, con); com.ExecuteNonQuery(); comm.ExecuteNonQuery(); MessageBox.Show("Successfully
updated");
} } else { MessageBox.Show("incorreect gust id");
41
} } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); } } private void r_Click(object sender, EventArgs e) { } private void label15_Click(object sender, EventArgs e) { Form4 vvp = new Form4(); vvp.Show(); this.Hide(); } private void textBox4_TextChanged(object sender, EventArgs e) { } private void button2_Click(object sender, EventArgs e) { fname.Text = ""; lname.Text = ""; id.Text = ""; adress.Text = ""; numericUpDown1.Value =0 ; nation.Text = ""; phone.Text = ""; // level.SelectedIndex=0; // price.Text = ""; } private void numericUpDown1_ValueChanged(object sender, EventArgs e) { } private void label2_Click(object sender, EventArgs e) { } } }
42
4. Show reservation
/*The following code segment used to show specifically reservation information it first accept guest id then compare it with guest information in guest table if it excites it retrieve all reservation information related to inserted guest id and show in the data grid view else it return “incorrect id” message.*/ 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
database with application public show_rervation() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "") { MessageBox.Show("enter the guest id"); } else
43
connect
{ 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"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); } }
// the following methode used to show all requred resrvation information private void button5_Click(object sender, EventArgs e) { 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); } }
5. Update receptionist password
// 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) { query = "update receptionist set u_name='" + u_name.Text + "' ,pass='" + n_pass.Text + "' where ( pass= '" + p_pass.Text + "')"; OleDbCommand com = new OleDbCommand(query, con); com.ExecuteNonQuery(); MessageBox.Show("Successfully up dated"); } else { MessageBox.Show("enter correct information"); } } 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(); } private void button1_Click(object sender, EventArgs e) { string query; try { con.Open(); OleDbDataReader reade = null; OleDbCommand cmdd = new OleDbCommand("select * from manger", con); reade = cmdd.ExecuteReader();
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 + "')"; OleDbCommand com = new OleDbCommand(query, con); com.ExecuteNonQuery(); MessageBox.Show("Successfully cange password"); } 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(); } private void button1_Click(object sender, EventArgs e) { 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(); } private void button2_Click(object sender, EventArgs e) { textBox1.Text = ""; } private void button3_Click(object sender, EventArgs e) { this.Close(); }
//method that perform the delation private void button1_Click(object sender, EventArgs e) { string query; int room; bool isnumbr=int.TryParse(textBox1.Text,out room); try { if (textBox1.Text == "")
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) { query = "delete * from room where ( r_number= " + textBox1.Text + ")"; OleDbCommand com = new OleDbCommand(query, con); com.ExecuteNonQuery(); MessageBox.Show("Successfully Deleted"); } else{ MessageBox.Show("room number note found"); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); } private void label3_Click(object sender, EventArgs e) { Form3 ccc = new Form3(); ccc.Show(); this.Hide(); } } }
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(); } private void up_date_room_Load(object sender, EventArgs e) { } private void textBox1_TextChanged(object sender, EventArgs e) {
52
} private void button1_Click(object sender, EventArgs e) { int num; bool isnum = int.TryParse(price.Text, out num); if (price.Text == "" &&pre_roomno.Value == 0) { MessageBox.Show("please fill all requrment"); } else if (!isnum) { MessageBox.Show("price must be number"); } else { 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(); } }
10. Show room information
/*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(); } private void button1_Click(object sender, EventArgs e) { int room; bool isnumbr=int.TryParse(textBox1.Text,out room); try { if (textBox1.Text == "") { 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) { string query = " select * from room where(r_number=" + textBox1.Text + ")"; DataTable dt = new DataTable(); OleDbDataAdapter da = new OleDbDataAdapter(query, con); da.Fill(dt); dataGridView1.DataSource = dt; } else{ MessageBox.Show("room number not found"); } } } catch (Exception ex) { MessageBox.Show(ex.Message); }
55
con.Close(); }
//to show all room information private void button2_Click(object sender, EventArgs e) { try { con.Open(); string query = " select * from room
";/*sql command used
select all room information from room table*/ DataTable dt = new DataTable(); OleDbDataAdapter da = new OleDbDataAdapter(query, con); da.Fill(dt); 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.
1. When the hotel was established? 2. What kind of system is using? 3. How many employers was there? 4. How mach was its capital? 5. What kind of data storage was used? 6. What are the statues of the current system? 7. How many employers are working on the organization currently? 8. What is work division looks like? 9. How mach capital it has currently? 10. What are the problems of the current system? 11. What kind of system need to be developed? 12. What are the requirements do you need to incorporate?
57