Professional Documents
Culture Documents
Diamond Hotel
Diamond Hotel
Diamond Hotel
A Research Paper
Submitted for the partial fulfillment of the requirements for the award of the
Diploma in
Submitted By
Name
1) Mahomoud abdi sead 3) Abdirahman sead abdilahi
2) Abdirisak ramadan ali
DEPARTMENT OF ICT
Tisqaad College
i
Tisqaad Computer Science College
CERTIFICATE
This is to certify that the project titled “Diamond Hotel” is a bona-fide work done by
Student Name
1) Mahomoud abdi sead 3) abdirisak ramadan ali
2) Abdirahman sead abdilahi
DECLARATION
We, mahomoud abdi sead , abdirahman sead abdilahi and abdirisak ramadan ali hereby declare
that this thesis is our original work and has not been presented for the award of any diploma in any
other college or university.
ii
Mahomoud abdi sead abdirahman sead abdilahi
Signature……………………. Signature………….…….
Date: ………………….
Mahomed “Aamin”
ICT,
Tisqaad College, Hargeisa. Somaliland.
Signature………………………………………………..
Date: ………………………
ACKNOWLEDGEMEN
BISMILLAH , first thanks to Allah(SW) who allowed us to achieve this stage of life and
make our long dream came true, again special thanks goes to our parents whom their
encouragement and advice for our studying.
We are also here to express our gratitude to our advisor Mr: Abdirahman Ali for his
support, guidance and encouragement of our project.
This book would not have been possible without the help of many people whose
comments and suggestions significantly improved the end result of this project.
Finally, we wish to express our appreciation to all who has contributed whatever
donations to this paper including our family, friends and our honorable teachers.
iii
Table of Contents
Contents
A Research Paper ........................................................................................................................................... i
Submitted for the partial fulfillment of the requirements for the award of the .............................................. i
Information Communication Technology (ICT) ....................................................................................... i
Under the Guidance of Mahomed “Aamiin” ............................................................................................... i
DEPARTMENT OF ICT ............................................................................................................................ i
CERTIFICATE .................................................................................................................................................. ii
In partial fulfillment of the requirements for the award of Diploma. (ICT) ................................................. ii
DECLARATION ............................................................................................................................................... ii
ACKNOWLEDGEMEN .................................................................................................................................... iii
Chapter One .................................................................................................................................................. 1
Introduction .................................................................................................................................................. 1
1.0 Introduction ............................................................................................................................................ 1
1.1 Background ............................................................................................................................................. 1
1.1.1 Organizational background .............................................................................................................. 1
1.1.2 Mission ............................................................................................................................................. 2
1.1.3 Vision................................................................................................................................................ 2
1.1.4 Organization Structure ..................................................................................................................... 2
1.2 Problem Statement ................................................................................................................................. 3
1.3 Proposed Solution ................................................................................................................................... 3
1.4 The project goals and objectives ............................................................................................................ 3
1.4.1 Project Goals .................................................................................................................................... 3
1.4.2 Project objectives............................................................................................................................. 4
1.5 Theoretical Background .......................................................................................................................... 4
iv
1.6 Project Management .............................................................................................................................. 5
1.6.1 Total Cost ......................................................................................................................................... 5
1.6.2 Time Management ........................................................................................................................... 6
Chapter Two: Analysis .................................................................................................................................. 7
2.0 Introduction ........................................................................................................................................ 7
2.1 Fact Finding ......................................................................................................................................... 7
2.1.1 Interview .......................................................................................................................................... 8
2.2 Requirement ....................................................................................................................................... 8
2.2.1 Functional requirement system ................................................................................................... 8
2.2.2 Non-functional requirement ............................................................................................................ 9
2.3 System DFDs........................................................................................................................................ 9
2.3.1 Context diagram............................................................................................................................... 9
2.3.2 Level zero diagram ......................................................................................................................... 10
2.3.3 Lower level ..................................................................................................................................... 11
Project Design............................................................................................................................................. 12
3.0 Introduction .......................................................................................................................................... 12
3.1 Data dictionary .................................................................................................................................. 12
3.1.1 Data item dictionary ...................................................................................................................... 12
Customer table........................................................................................................................................ 13
Payment table ......................................................................................................................................... 13
3.1.2 Data structure dictionary ............................................................................................................... 14
3.1.3 Data store dictionary ..................................................................................................................... 14
3.1.4 Data flow dictionary ....................................................................................................................... 15
3.2 Data design ....................................................................................................................................... 15
3.2.1 Entities and Attributes ................................................................................................................... 16
3.2.2 Database design ............................................................................................................................. 16
3.2.2.1 Create an initial ERD ................................................................................................................... 17
3.2.2.3 Create 3NF designs for all tables, taking care to identify all primary and foreign keys ............. 18
What is Normalization?........................................................................................................................... 18
First Normal Form (1NF) ......................................................................................................................... 18
Second Normal Form (2NF)..................................................................................................................... 18
Third Normal Form (3NF) ........................................................................................................................ 19
v
3.2.2.4 Generate the final ERD that will include new entities identified during normalization ............. 19
3.3 Interface & Screens Design ............................................................................................................... 19
First Normal Form (1NF) ......................................................................................................................... 20
Second Normal Form (2NF)..................................................................................................................... 20
Third Normal Form (3NF) ........................................................................................................................ 20
3.3 Interface & Screens Design ............................................................................................................... 21
Chapter 4 .................................................................................................................................................... 23
Project implementation .............................................................................................................................. 23
4.0 Introduction .......................................................................................................................................... 23
4.1 Application Development ................................................................................................................. 23
4.1.1 Modules ..................................................................................................................................... 23
Splash Form............................................................................................................................................. 23
Splash Code: ............................................................................................................................................ 23
Login Form .............................................................................................................................................. 25
Login form Code: ..................................................................................................................................... 25
Dashboard Design ................................................................................................................................... 27
Dashboard form Codes: .......................................................................................................................... 27
Customer Form ....................................................................................................................................... 28
Customer Code ....................................................................................................................................... 29
Employee Form ....................................................................................................................................... 34
Employee Code ....................................................................................................................................... 34
Salary Form ............................................................................................................................................. 39
Salary Code ............................................................................................................................................. 40
Chapter Five ................................................................................................................................................ 47
Conclusion and Future work ................................................................................................................... 47
5.0 Introduction .......................................................................................................................................... 47
5.1 Future work ....................................................................................................................................... 47
The interfaces that will update is:- ......................................................................................................... 47
5.2 Conclusion ......................................................................................................................................... 48
References .............................................................................................................................................. 49
vi
Chapter One
Introduction
1.0 Introduction
1.0 Introduction
This book is to DIAMOND HOTEL MANAGEMENT SYSTEM. It is the one of the largest
hotels in Hargeisa. It provides various services such as: restaurant, party holes, and room
services. This system helps the hotel to manage hotel in computerized system. We used C#
language to this system. Reasons we choose this language is:
• It is easy for user
• It is popular language
• It is most easy for usage
.
1.1 Background
Starting a small business is a risky, especially for beginners. Taking a careful approach and a small
start-up is the best way to start a small business. Entrepreneurs should avoid investing too much
of their personal money in financial ruin if they fail in small business. Starting a service business
allows a professional entrepreneur with a unique background to make the most of his or her skills,
and sometimes earn more than they can work as employees in the same business.
Daimond Hotel was established Hargeisa in 2016, Somaliland. It is located in hero awr. The owner
of this Daimond Hotel is omer Abdi jama. There are staff working at the current location of the
hotels and it also has many values. So it has a good income. Because our society eats foods that
do not come from the country.
1
1.1.2 Mission
Service, and public safety to serve only the highest quality product, prepare it in a clean and
sparkling environment, and serve it in a warm and friendly manner.
1.1.3 Vision
diamond Hotel is committed to customer care, improving the quality of its food. In order not to
fall below where it is today, it is important for us to move on from where we are today.
• Customer satisfaction becomes: We aim to treat every customer as if they were a guest
in our home.
• Teamwork and trust become: We provide support for our employees and encourage
them to make their own decisions.
Manager
2
1.2 Problem Statement
Problem statement Improving performance and efficiency in diamond Hotel is a major goal of
diamond Hotel. The problem with this business was that all the demands were recorded in the
business book, and the cashier and the waiter may misunderstand each other or the cashier may be
distracted by an offer and forget to write down the amount. Unnecessary costs are involved, take
time, also mistakes are not always avoidable and repetition of work may take place.
So, to organize it, save the client's data to the storage and how best to provide it.
• A data was sometime is loss we solve, another data was not loss because is a computer in
date and take a pack up.
• All data will be stored in the system by changing from the manual control system to the
data.
• No data will be lost because the system will be taken back up.
Maximize profit because a system is minimizing the risk of getting loss, since all Transaction
recorded to the system and viewed if needed like that the whole reports of the
To analyze the influence of product quality toward buying decisions of small business like
Restaurants.
To analyze the influence of price toward buying decisions at hood ale shop.
4
As of March 2021 the current production-ready Visual Studio version was 2019, with older
versions such as 2012 and 2013 on Extended Support, and 2015 and 2017 on Mainstream
Support.
2 Laptop 500$ 4 GB
3 Keyboard 10$
4 Mouse 3$
TOTAL 813$
5
1.6.2 Time Management
Time Management
3.5
3
3
2.5
2.5
2.1
2
2
1.7
1.5
0.5
0
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5
Series 1
6
Chapter Two: Analysis
2.0 Introduction
In this chapter we will discuss the information we receive from the shop we also talked the shop
owner about the problems with the manual process we are interviewed them about how the shop
operators work.
Also This chapter will provide a full description of the system and its users then it depicts the
functional And non-functional requirements that have been collected using several methods from
Brainstorming interview and e-surveys, after determining the most important requirement,
Requirement analysis was adopted using several tools such as use - case diagram, sequence
diagram and activity diagram Before making our project we must to make Analysis to try the solve
problems that we found our analysis. At the end of this chapter we will talk about a data flow
diagram (DFD) explains the relationship among different components of a system by showing the
flow of data (from which external entities data is coming from, where data will go and where data
will finally be stored in) within it. A general overview of a system is represented with a context
diagram, also known as a level 0 DFD, which shows a system as a single process. A level 1 diagram
provides greater detail, focusing on a system’s main functions. Diagrams that are level 2 or higher
illustrate a system’s functioning with increasing detail.
Effective and efficient methods, we also see it as the easiest way to store data as well as to recover
lost data without reason. And that more information is not lost.
Also this project is structured around fact-finding studies, designed to assist us in gathering key
information about Restaurant. After a deep unique research, we have discovered the smoothest
procedure for solving this problem.
7
2.1.1 Interview
When we met Hassan the owner of hotel we asked few questions regarding his hotel. We did a lot
of interviews to get information and to provide full support then we make a system for his place.
The questions were as this
Question Answer
What do you use and work with? We use excel and word document.
What do you think will make program We hope it will be fullness program.
easy To use for you?
2.2 Requirement
Before starting making any project the manager of project must determine what is functional, on
functional and quality functional for the project. Functional requirements show how the system
behave. Nonfunctional requirements are mainly to specify criteria that judge the operation of the
system like reliability for example. Quality requirement will show security, usability and
maintainability of project, as well as monitoring staff and materials
8
2. Data can be saved automatically soon after it is entered so that the risk of data being lost is
minimized. 3. Sorting and storing documents and other information like searching is much
easier.
6. Addition of new customer, modification of keeping the customer treatment history will be
simple.
9
process, with its relationship to external entities. It should be easily understood by a wide audience,
including stakeholders, business analysts, data analysts and developers.
Customer Kitchen
Customer Kitchen
2.0 3.0
Inventory
Update Update
Goods Data inventor
and sold Hotel y file
file
Employee
Manager
D2 Items Sold D1 Inventory
File
4.0
Produce
managemen
t Reports Hotel
Manager
process, with its relationship to external entities.
10
2.3.3 Lower level
A lower level diagram is component-level design process that follows a step-by-step refinement
process. This process can be used for designing data structures, required software architecture the
goal of LLD or a low-level design document (LLDD) is to give the internal logical design of the
actual program code. High-level design is created based on the low-level design. LLD describes
the class diagrams with the methods and relations b/w classes and program specs. It describes the
modules so that the programmer can directly code the program from the document
Food Staff
Customers
Customer Order
1.0
Receive
Customer
Order And
Bill
Receipt
Shift Leader
Reports
11
Chapter Three
Project Design
3.0 Introduction
This project is insight into design and implementation of Diamond Hotel. The primary aim of this
project is to improve accuracy and enhance safety and efficacy of the Golden Hotel. Today
management is one of the most essential features of all forms.
12
Customer table
Entity Attribute Data type Primary key
Payment table
Entity Attribute Data type Primary key
13
3.1.2 Data structure dictionary
Customer data
User
Customer detail
Customer
Customer info Diamond
Hotel
Employee Customer Information
System
Customer detail
A dictionary data structure is one which is capable of storing objects in sorted order based on key
such as a string or integer. For instance, say you have several hundred base objects which consist
of the name of the base, the latitude and longitude at which it is located and its armaments. One
way of storing this cities is to sort them by name, another is to store them in decreasing order by
armaments, yet another is increasing order by latitude. Primarily, the dictionary component will
store based on some sort of a string key, such as the name of base and target. This dictionary is to
provide us with an easy way to see what data points we have already entered into our software
database.
14
3.1.4 Data flow dictionary
In computers, the path of data from source document to data entry to processing to final reports.
Data changes format and sequence (within a file) as it moves from program to program. In
communications, the path taken by a message from origination to destination that includes all
nodes through which the data travels.
Process
User
Hotel
System
Data
Source
15
3.2.1 Entities and Attributes
An entity relationship diagrams a logical representation of the data for an organization or for a
business area, using entities for categories of data and relationship for associations between
entities. ERD is a means of visualizing how the information a system produces is related. There
are five main components of an ERD: Entities: which are represented by rectangles. An entity is
an object or concept about which you want to store information.
Entity
A weak entity is an entity that must defined by a foreign key relationship with another entity as it
cannot be uniquely identified by its own attributes alone
Relationship which are represented by diamond shapes, show how two entities share
information in the database or relationship between entities
Relationship
16
becomes of high importance, almost every company keeps some type of database, whether it
includes its employees, its customers, or the products it sells. Database design is the process of
producing a detailed data model of database. This data model contains all the needed logical and
physical design choices and physical storage parameters needed Database design is the process of
producing a detailed data model of database. This data model contains all the needed logical and
physical design choices and physical storage parameters needed. Principally, and most correctly,
it can be thought of as the logical design of the base data structures used to store the data. In the
relational model these are the tables and views.
In an object database the entities and relationships map directly to object classes and named
relationships. However, the term database design could also be used to apply to the overall process
of designing, not just the base data structures, but also the forms and queries used as part of the
overall database application within the database management system (DBMS). The process of
doing database design generally consists of a number of steps which will be carried out by the
database designer. Usually, the designer must:
3. Superimpose a logical structure upon the data on the basis of these relationships
17
3.2.2.3 Create 3NF designs for all tables, taking care to identify all primary
and foreign keys
Managing information means taking care of it so that it works for us and is useful for the tasks we
perform. By using a DBMS, the information we collect and add to its database is no longer subject
to accidental disorganization. It becomes more accessible and integrated with the rest of our work.
Managing information using a database allows us to become strategic users of the data we have.
What is Normalization?
Normalization is the branch of relational theory that provides design insights. It is the process of
determining how much redundancy exists in a table. The goals of normalization are to:
3.2.2.4 Generate the final ERD that will include new entities identified during
normalization
3.3 Interface & Screens Design
What is Normalization?
Normalization is the branch of relational theory that provides design insights. It is the process of
determining how much redundancy exists in a table. The goals of normalization are to:
19
Normalization theory draws heavily on the theory of functional dependencies. Normalization
theory defines six normal forms (NF). Each normal form involves a set of dependency properties
that a schema must satisfy and each normal form gives guarantees about the presence and/or
absence of update anomalies. This means that higher normal forms have less redundancy, and as
a result, fewer update problems.
20
3.2.2.4 Generate the final ERD that will include new entities identified during
normalization
21
22
Chapter 4
Project implementation
4.0 Introduction
In this chapter we talk about how to coding the application Coding: set of instructions of words
and latter’s that, the application to able to do specific function, In this chapter is the chapter four
in our program so it’s main part of the function in our system so we want to show multiple codes
We used in the project of Djibouti Restaurant Management system so I want to represent step by
step in our project.
A splash screen is that image/animation that appears when you enter the application. It is like
saying 'welcome' to the user. It is the page that will keep the user busy until the app is ready.
Splash Code:
private void Form1_Load(object sender, EventArgs e)
23
{
timer1.Start();
}
}
}
24
Login Form
A Login form is used to enter authentication credentials to access a restricted page or form. The
login form contains a field for the username and another for the password. When the login form
is submitted its underlying code checks that the credentials are authentic, giving the user can
access the restricted page. If a user is not able to provide authentic credentials they will not be
able to proceed past the login form.
25
SqlCommand cmd = new SqlCommand("Select * from Users where UserName='" +
txtusername.Text + "'And Password ='" + txtPassword.Text + "'And Rolle='" +
ComboBox1.Text + "'", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
string cmbitemvalue = ComboBox1.SelectedItem.ToString();
con.Close();
if (dt.Rows.Count > 0)
{
if (ComboBox1.Text == "Admin")
{
Dashboard frm3 = new Dashboard();
frm3.Show();
this.Hide();
}
else
{
dashboardUsers dashboard = new dashboardUsers();
dashboard.Show();
this.Hide();
}
}
else
{
MessageBox.Show("Please check your UserName or Password");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
if (guna2CheckBox1.Checked)
{
txtPassword.UseSystemPasswordChar = false;
}
else
{
txtPassword.UseSystemPasswordChar = true;
}
}
}
26
}
.
Dashboard Design
27
private void btncustomer_Click(object sender, EventArgs e)
{
customers1.BringToFront();
}
Customer Form
28
Customer Code
SqlConnection con = new SqlConnection("Data Source=LAPTOP-RMNRE6NT;Initial
Catalog=HOTEL_MANAGEMENT_SYSTEM;Integrated Security=True");
SqlCommand cmd;
SqlDataAdapter da;
int ID = 0;
private void Customers_Load(object sender, EventArgs e)
{
try
{
con.Open();
DataTable dt = new DataTable();
da = new SqlDataAdapter("select * from Customer", con);
da.Fill(dt);
dgv.DataSource = dt;
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
29
}
private void Displaydata()
{
con.Open();
DataTable dt = new DataTable();
da = new SqlDataAdapter("Select * from Customer", con);
da.Fill(dt);
dgv.DataSource = dt;
con.Close();
}
private void ClearData()
{
txtid.Clear();
txtfullname.Clear();
txtAddress.Clear();
txtPhone.Clear();
txtGender.Clear();
ID = 0;
con.Open();
cmd.Parameters.AddWithValue("@C_Id", txtid.Text);
cmd.Parameters.AddWithValue("@fullname", txtfullname.Text);
cmd.Parameters.AddWithValue("Address", txtAddress.Text);
cmd.Parameters.AddWithValue("@Phone", txtPhone.Text);
cmd.Parameters.AddWithValue("@Gender", txtGender.Text);
cmd.Parameters.AddWithValue("@Date", DateTimePicker1.Value);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("Record Saved successfully");
Displaydata();
ClearData();
}
else
{
MessageBox.Show("Please provade Details");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
30
finally
{
con.Close();
}
}
cmd.ExecuteNonQuery();
con.Close();
Displaydata();
ClearData();
MessageBox.Show("Record Updated successfully");
}
else
{
MessageBox.Show("please select Record to Update");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
31
con.Close();
Displaydata();
ClearData();
MessageBox.Show("Record Deleted successfully");
}
else
{
MessageBox.Show("please select Record to Delete");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
try
{
dgv.CurrentRow.Selected = true;
txtid.Text = dgv.Rows[e.RowIndex].Cells["C_Id"].Value.ToString();
txtfullname.Text =
dgv.Rows[e.RowIndex].Cells["fullName"].Value.ToString();
32
txtAddress.Text = dgv.Rows[e.RowIndex].Cells["Address"].Value.ToString();
txtPhone.Text = dgv.Rows[e.RowIndex].Cells["Phone"].Value.ToString();
txtGender.Text = dgv.Rows[e.RowIndex].Cells["Gender"].Value.ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
33
Employee Form
Employee Code
public Employee()
{
InitializeComponent();
}
SqlConnection con = new SqlConnection("Data Source=LAPTOP-RMNRE6NT;Initial
Catalog=HOTEL_MANAGEMENT_SYSTEM;Integrated Security=True");
SqlCommand cmd;
SqlDataAdapter da;
int ID = 0;
private void Employee_Load(object sender, EventArgs e)
{
con.Open();
DataTable dt = new DataTable();
da = new SqlDataAdapter("select * from Staff", con);
da.Fill(dt);
34
dgv.DataSource = dt;
con.Close();
}
con.Open();
cmd.Parameters.AddWithValue("@Sf_id", txtsf_id.Text);
cmd.Parameters.AddWithValue("@fullname", txtfullname.Text);
cmd.Parameters.AddWithValue("@salary", txtsalary.Text);
cmd.Parameters.AddWithValue("@Phone", txtphone.Text);
cmd.Parameters.AddWithValue("@P_Phone", txtP_phone.Text);
cmd.Parameters.AddWithValue("@Level", txtLevel.Text);
cmd.Parameters.AddWithValue("@Accupation", txtaccupation.Text);
cmd.Parameters.AddWithValue("@Gender", txtGender.Text);
cmd.Parameters.AddWithValue("@Staff_Status", txtStaff_Status.Text);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("Record Saved successfully");
ClearData();
Displaydata();
}
35
else
{
MessageBox.Show("Please provade Details");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
36
{
con.Close();
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
37
{
con.Close();
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
38
private void guna2Button1_Click(object sender, EventArgs e)
{
Employee_Load(this, null);
}
}
}
Salary Form
39
Salary Code
public Salary()
{
InitializeComponent();
}
SqlConnection con = new SqlConnection("Data Source=LAPTOP-RMNRE6NT;Initial
Catalog=HOTEL_MANAGEMENT_SYSTEM;Integrated Security=True");
SqlCommand cmd;
SqlDataAdapter da;
int ID = 0;
private void displayNonTakedId()
{
try
{
if (con.State == ConnectionState.Closed)
{
con.Open();
SqlCommand cmd3 = con.CreateCommand();
cmd3.CommandType = CommandType.Text;
cmd3.CommandText = "select * from Staff where Staff_Status='" +
lblNonTaked.Text + "'";
cmd3.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd3);
da.Fill(dt);
foreach (DataRow dr in dt.Rows)
{
comboBox1.Items.Add(dr["Sf_Id"].ToString());
con.Close();
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
public void display()
{
if (con.State == ConnectionState.Closed)
{
DataTable dt = new DataTable();
da = new SqlDataAdapter("Select * from Salary", con);
da.Fill(dt);
Displaydata();
dgv.DataSource = dt;
con.Close();
40
}
private void Salary_Load(object sender, EventArgs e)
{
displayNonTakedId();
display();
Displaydata();
}
private void Displaydata()
{
if (con.State == ConnectionState.Closed)
{
con.Open();
DataTable dt = new DataTable();
da = new SqlDataAdapter("Select * from Salary", con);
da.Fill(dt);
dgv.DataSource = dt;
con.Close();
}
}
private void ClearData()
{
txts_Id.Clear();
txtfullname.Clear();
txtsalary.Clear();
txtA_Amount.Clear();
txtstaffStatus.Clear();
txtTotal.Clear();
ID = 0;
}
public void calculation()
{
double Salary, Amount, Total;
}
}
catch (Exception ex)
{
41
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("Record Saved successfully");
updateStaff();
comboBox1.Items.Clear();
displayNonTakedId();
ClearData();
Displaydata();
}
else
{
MessageBox.Show(" Please provade your Details");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
42
{
if (txts_Id.Text != "" && comboBox1.Text != "" && txtfullname.Text != ""
&& txtsalary.Text != "" && txtA_Amount.Text != "" && txtstaffStatus.Text != "" &&
txtTotal.Text != "")
{
cmd = new SqlCommand("update Salary set S_Id=@S_Id, Sf_Id=@Sf_Id,
FullName=@FullName, Salary=@Salary, Advanced_Amount=@Advanced_Amount,
Staff_Status=@Staff_Status, Total=@Total, Date=@Date where S_Id=@S_Id", con);
con.Open();
ID = Convert.ToInt32(txts_Id.Text);
cmd.Parameters.AddWithValue("@S_Id", txts_Id.Text);
cmd.Parameters.AddWithValue("@Sf_Id", comboBox1.Text);
cmd.Parameters.AddWithValue("@FullName", txtfullname.Text);
cmd.Parameters.AddWithValue("@Salary", txtsalary.Text);
cmd.Parameters.AddWithValue("@Advanced_Amount", txtA_Amount.Text);
cmd.Parameters.AddWithValue("@Staff_Status", txtstaffStatus.Text);
cmd.Parameters.AddWithValue("@Total", txtTotal.Text);
cmd.Parameters.AddWithValue("@Date", DateTimePicker1.Value.Date);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("Record Updated successfully");
updateStaff();
comboBox1.Items.Clear();
displayNonTakedId();
ClearData();
Displaydata();
}
else
{
MessageBox.Show("Please provade Details");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
43
con.Close();
ClearData();
Displaydata();
}
else
{
MessageBox.Show("please select Record to Delete");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
44
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
dgv.CurrentRow.Selected = true;
txts_Id.Text = dgv.Rows[e.RowIndex].Cells["S_Id"].Value.ToString();
comboBox1.Text = dgv.Rows[e.RowIndex].Cells["Sf_Id"].Value.ToString();
txtfullname.Text =
dgv.Rows[e.RowIndex].Cells["FullName"].Value.ToString();
txtsalary.Text = dgv.Rows[e.RowIndex].Cells["salary"].Value.ToString();
txtA_Amount.Text =
dgv.Rows[e.RowIndex].Cells["Advanced_Amount"].Value.ToString();
txtstaffStatus.Text =
dgv.Rows[e.RowIndex].Cells["Staff_Status"].Value.ToString();
txtTotal.Text = dgv.Rows[e.RowIndex].Cells["Total"].Value.ToString();
DateTimePicker1.Text =
dgv.Rows[e.RowIndex].Cells["Date"].Value.ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
45
txtsalary.Text = dr.GetValue(2).ToString();
txtstaffStatus.Text = dr.GetValue(8).ToString();
}
con.Close();
}
else
{
txtfullname.Clear();
txtsalary.Clear();
txtstaffStatus.Clear();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}
46
Chapter Five
Conclusion and Future work
5.0 Introduction
We are going to talk in this chapter about some tips that our system will need in the future. We
have made clear to the way, we had collected data for our project, and we also pointed some
things which may require future reform. We Will Be Upgrading with New Version and Design
that better than this part ,we hopping to be continuously this profession and improve our
knowledge of the IT to create main projects. We would like to create more projects that are
advanced We will upgrade with new visions and designs Now we can’t able to upgrade due to
time and our techniques when we reach our hope We will produce new versions that is the best
this one.
47
6. 6. UI User Interface
5.2 Conclusion
The system has been developed using C# and SQL Server, the system was able to process and
update the database with more easily. It helped in developing a total integrated system. Currently
they are keeping every record by written down in memo manually. At least this system will give
them relieve from exhausted life which they are dealing with their customers. Besides this
system will make them Djibouti Restaurant more reliable to its customers as all the customers’
records will be kept safely than any previous times. Moreover, they can manage their stock more
handily. The “diamond hotel” process made computerized to reduce human errors and to
increase the efficiency. The focus of this project is to lessen human efforts. The maintenance of
the records is made efficient, as all the records are stored in the SQL SERVER database, through
which data can be retrieved easily. The navigation control is provided in all the forms to navigate
through the large amount of records. The editing is also made simpler. The user must just type in
the required field and press the update button to update the desired field.
48
References
Books
1. Fundamentals-of-Computer-Programming-with-CSharp-Nakov-eBook-v2013
2. Ullman the Complete Book
3. Database-Design-2nd-Edition.
Websites
49