Diamond Hotel

You might also like

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

Diamond Hotel Management System

A Research Paper

Submitted for the partial fulfillment of the requirements for the award of the
Diploma in

Information Communication Technology (ICT)

Under the Guidance of Mahomed “Aamiin”

Submitted By

Name
1) Mahomoud abdi sead 3) Abdirahman sead abdilahi
2) Abdirisak ramadan ali

DEPARTMENT OF ICT
Tisqaad College

December 20, 2022 – 2018

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

In partial fulfillment of the requirements for the award of Diploma. (ICT)

(Mahomed “Aamin) (Abdirisak mahomed)


Advisor Head of the Department

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………….…….

Abdirisak ramadan ali


Signature…………………….

Date: ………………….

This thesis has been submitted with my approval as supervisor:

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 Organizational background


Like we said the Company’s founders opened their first hotel but after a few years they faced low
financial factors so they began to struggle with the situations and they were in that situation for a
long time, after all the struggling they got up and they finally got rid of all the problems by using
different ways, they pay off attention in order to make their situation good.

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.

• Sustainability becomes: We always source ingredients from sustainable, local suppliers.

1.1.4 Organization Structure


An organizational structure is a system that outlines how certain activities are directed in order to
achieve the goals of an organization. These activities can include rules, roles, and responsibilities.

Manager

Employee Cashier Customer

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.

• All business data is documents and manuals.


• Also sometimes data was loss.

1.3 Proposed Solution


All of these problems will be solved by setting up a business system that helps with data storage,
and we will use it in SQL and visual studio for programming.

• 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.

1.4 The project goals and objectives


1.4.1 Project Goals
• Registration of all business sales.
• Gain experience of what we are doing.
• Managing all activities around the hotel that increases productivity and

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

Business will be shown at any time needed to be done.


3
1.4.2 Project objectives

Customer-Oriented Marketing Strategy.

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.

To analyze the influence of advertising toward buying decisions of Restaurants.

1.5 Theoretical Background


In 1988, Microsoft released its first version of SQL Server. It was designed for the OS/2 platform
and was developed jointly by Microsoft and Sybase. During the early 1990s, Microsoft began to
develop a new version of SQL Server for the NT platform. While it was under development,
Microsoft decided that SQL Server should be tightly coupled with the NT operating system. In
1992, Microsoft assumed core responsibility for the future of SQL Server for NT. In 1993,
Windows NT 3.1 and SQL Server 4.2 for NT were released. Microsoft's philosophy of combining
a high-performance database with an easy-to-use interface proved to be very successful. Microsoft
quickly became the second most popular vendor of high-end relational database software. In 1994,
Microsoft and Sybase formally ended their partnership. In 1995, Microsoft released version 6.0 of
SQL Server. This release was a major rewrite of SQL Server's core technology.

Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It is


used to develop computer programs, as well as websites, web apps, web services and mobile apps.
Visual Studio uses Microsoft software development platforms such as Windows API, Windows
Forms, Windows Presentation Foundation, Windows Store and Microsoft Silverlight. It can
produce both native code and managed code. The most basic edition of Visual Studio, the
Community edition, is available free of charge. The slogan for Visual Studio Community edition
is Free, fully-featured IDE for students, open-source and individual developers.

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.

1.6 Project Management


1.6.1 Total Cost
In order to do all of the above we need tools that are used for this type of business and the like to
store data and information in the workplace.

NO NAME COST RAM


1 Personal Computer 300$ 4 GB

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.

2.1 Fact Finding


The facts we were looking for were, that this project was needed and would be supported.

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

Do you use a computer? Yes.

Do you have any system already? No, but we need it.

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

2.2.1 Functional requirement system


It will describe what the software should do and also define the internal working of software and
also it is a requirement that specifies criteria that can be used to judge the Operation of a system,
rather than specific behaviors. They are contrasted with functional Requirements that define
specific behavior or functions. On the other side: The functional requirements document is a formal
statement of an application’s functional Requirements. It serves the same purpose as a contract.
The developers agree to provide the Capabilities specified. The client agrees to find the product
satisfactory if it provides the Capabilities specified in the Functional requirements. The system
should add the details along with automatically generated registration number of newly admitted
customer to the database.
1. All Registrations can be completed automatically as you enter data.

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.

4. Searching and retrieving data is much easier.

5. Validation rules can be used in order to guarantee better verification.

6. Addition of new customer, modification of keeping the customer treatment history will be
simple.

2.2.2 Non-functional requirement


Non-functional requirements (also known as quality requirements) are generally more difficult to
express in a measurable way, making them more difficult to analyze. In particular, NFRs tend to
be properties of a system as a whole, and hence cannot be verified for individual components.
Recent work by both researchers and practitioners has investigated how to model NFRs and to
express them in a form that is measurable or testable. There also is a growing body of research
concerned with particular kinds of NFRs, such as safety, security, reliability, and usability.

2.3 System DFDs


A data flow diagram (DFD) is a graphical representation of the “flow” of data through an
information system, modelling its process aspects. A data flow diagram id often used as a
preliminary step to create an overview of the system without going into great detail, which can
later be elaborated.

2.3.1 Context diagram


DFD Level 0 is also called a Context Diagram. It’s a basic overview of the whole system or process being
analyzed or modeled. It’s designed to be an at-a-glance view, showing the system as a single high-level

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.

2.3.2 Level zero diagram


DFD Level 0 is also called a Context Diagram. It's a basic overview of the whole system or process being
analyzed or modeled. It's designed to be an at-a-glance view, showing the system as a single highlevel

Customer Kitchen

Customer Kitchen

Customer Order 1.0 Food Order


Customer Order 0
Receipt Receive and
Receipt Golden
Transform Food Order
Customer
Food Order
Hotel

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

Transaction data Inventory data

2.0 Make 3.0 Update


Transactions inventory
in POS
and change

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.

3.1 Data dictionary


A data dictionary is the collection of descriptions of the data objects or items in a data model for
the benefits of programmers and others who need to refer them. A first step is analyzing a system
of objects with which users interact to identify each objects and its relationship to other objects.
Using Data Dictionary for the advantage of completeness helps the data programmer to know when
data is clear, complete, and well defined. It does so by informing as to what completeness is defined
as in any instance in question and by detailing the steps that are necessary to take to achieve
completeness.

3.1.1 Data item dictionary


A Data Dictionary is a collection of names, definitions, and attributes about data elements that
are being used or captured in a database, information system, or part of a research project. A Data
Dictionary also provides metadata about data elements.

12
Customer table
Entity Attribute Data type Primary key

Customer Customer _Id Int Not null

Customer F Name Varchar(30) Not null

Customer L Name Varchar(30) Not null

Customer Phone Varchar(14) Not null

Customer Payment _Id Int Not null

Customer Item_ Id Int Not null

Payment table
Entity Attribute Data type Primary key

Payment Payment_ Id Int Not null

Payment Customer_ Id Int Not null

Payment Order_ Id Int Not null

Payment Payment date Date Not null

Payment Amount Int Not null

Payment Payment type Varchar(30) Not null

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.

3.1.3 Data store dictionary


A data store is a repository for persistently storing and managing collections of data which include
not just repositories like databases, but also simpler store types such as simple files, emails etc. A
database is a series of bytes that is managed by a database management system (DBMS). A file is
a series of bytes that is managed by a file system. Thus, any database or file is a series of bytes
that, once stored, is called a data store.

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.

3.1.Function description dictionary


5 Employee
Customer

Process

User
Hotel
System

Data
Source

3.2 Data design


Data design is the first design activity, which results in less complex, modular and efficient
program structure. ... The data objects, attributes, and relationships depicted in entity relationship
diagrams and the information stored in data dictionary provide a base for data design activity.

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

3.2.2 Database design


A database is a collection of information that is organized so that it can easily be accessed,
managed, and updated. In one view, databases can be classified according to types of content
bibliographic, full-text, numeric, and images. A database is a list or a group of lists of objects
organized to make the list(s) and their values easy to create and manage. In the computer world,
this suggests, rightly, that the list(s) and (their) values are stored in a machine. As information

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:

1. Determine the data to be stored in the database

2. Determine the relationships between the different data elements.

3. Superimpose a logical structure upon the data on the basis of these relationships

3.2.2.1 Create an initial ERD


The entity relationship (ER) data model has existed for over 35 years. It is well suited to data
modelling for use with databases because it is fairly abstract and is easy to discuss and explain.
ER models are readily translated to relations. ER models, also called an ER schema, are
represented by ER diagrams. ER modelling is based on two concepts:

• Entities, defined as tables that hold specific information (data)

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:

• Be able to characterize the level of redundancy in a relational schema.

• Provide mechanisms for transforming schemas in order to remove redundancy.

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.

First Normal Form (1NF)


As per First Normal Form, no two Rows of data must contain repeating group of information i.e.
each set of columns must have a unique value, such that multiple columns cannot be used to fetch
the same row. Each table should be organized into rows, and each row should have a primary key
that distinguishes it as unique. The Primary key is usually a single column, but sometimes more
than one column can be combined to create a single primary key. For example, consider a table
which is not in First normal form in First. Normal Form, any row must not have a column in which
more than one value is saved, like separated with commas. Rather than that, we must separate such
data into multiple rows
Second Normal Form (2NF)
For the second normal form, the relation must first be in 1NF. The relation is automatically in
2NF if, and only if, the PK comprises a single attribute. If the relation has a composite PK, then
18
each non-key attribute must be fully dependent on the entire PK and not on a subset of the PK (i.e.,
there must be no partial dependency or augmentation).

Third Normal Form (3NF)


A table is in Third Normal Form if it is in 2NF and has no transitive dependencies. A transitive
Dependency is one in which a first column determines a second column, and that second column
in turn determines a third column. Most database designers don't bother going any further, but
there are more normal forms should you be interested.

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:

• Be able to characterize the level of redundancy in a relational schema.

• Provide mechanisms for transforming schemas in order to remove redundancy.

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.

First Normal Form (1NF)


As per First Normal Form, no two Rows of data must contain repeating group of information i.e.
each set of columns must have a unique value, such that multiple columns cannot be used to fetch
the same row. Each table should be organized into rows, and each row should have a primary key
that distinguishes it as unique. The Primary key is usually a single column, but sometimes more
than one column can be combined to create a single primary key. For example, consider a table
which is not in First normal form in First. Normal Form, any row must not have a column in which
more than one value is saved, like separated with commas. Rather than that, we must separate such
data into multiple rows
Second Normal Form (2NF)
For the second normal form, the relation must first be in 1NF. The relation is automatically in
2NF if, and only if, the PK comprises a single attribute. If the relation has a composite PK, then
each non-key attribute must be fully dependent on the entire PK and not on a subset of the PK (i.e.,
there must be no partial dependency or augmentation).

Third Normal Form (3NF)


A table is in Third Normal Form if it is in 2NF and has no transitive dependencies. A transitive
Dependency is one in which a first column determines a second column, and that second column
in turn determines a third column. Most database designers don't bother going any further, but
there are more normal forms should you be interested.

20
3.2.2.4 Generate the final ERD that will include new entities identified during
normalization

3.3 Interface & Screens Design

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.

4.1 Application Development


4.1.1 Modules
Splash Form

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();
}

private void pictureBox1_Click(object sender, EventArgs e)


{

}
}

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.

Login form Code:


private void BTNLOGIN_Click(object sender, EventArgs e)
{
try
{

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();
}
}

private void pictureBox3_Click(object sender, EventArgs e)


{
Close();
}

private void guna2CheckBox1_CheckedChanged(object sender, EventArgs e)


{

if (guna2CheckBox1.Checked)
{
txtPassword.UseSystemPasswordChar = false;
}
else
{
txtPassword.UseSystemPasswordChar = true;
}
}
}

26
}
.

Dashboard Design

Dashboard form Codes:


public partial class dashboardUsers : Form
{
public dashboardUsers()
{
InitializeComponent();
}

private void pictureBox1_Click(object sender, EventArgs e)


{
Close();
}

private void btnRooms_Click(object sender, EventArgs e)


{
rooms1.BringToFront();
}

27
private void btncustomer_Click(object sender, EventArgs e)
{
customers1.BringToFront();
}

private void btnbooking_Click(object sender, EventArgs e)


{
booking1.BringToFront();
}

private void btnPayment_Click(object sender, EventArgs e)


{
payment1.BringToFront();
}

private void button2_Click(object sender, EventArgs e)


{
requirements1.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;

private void btnSave_Click(object sender, EventArgs e)


{
try
{
if (txtid.Text != "" && txtfullname.Text != "" && txtAddress.Text != ""
&& txtPhone.Text != "" && txtGender.Text != "")
{
cmd = new SqlCommand("insert into Customer
values(@C_Id,@fullName,@Address,@Phone,@Gender,@Date)", con);

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();
}
}

private void btnUpdate_Click(object sender, EventArgs e)


{
try
{
if (txtid.Text != "" && txtfullname.Text != "" && txtAddress.Text != ""
&& txtPhone.Text != "" && txtGender.Text != "")
{
cmd = new SqlCommand("update Customer set C_Id=@C_Id,
FullName=@FullName, Address=@Address, Phone=@Phone, Gender=@Gender, Date=@Date where
C_Id=@C_Id", con);
con.Open();
ID = Convert.ToInt32(txtid.Text);
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();
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();
}
}

private void btnDelete_Click(object sender, EventArgs e)


{
try
{
if (txtid.Text != "")
{
cmd = new SqlCommand("Delete Customer where C_Id =@C_Id", con);
con.Open();
ID = Convert.ToInt32(txtid.Text);
cmd.Parameters.AddWithValue("@C_Id", ID);
cmd.ExecuteNonQuery();

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();
}
}

private void btnSearch_Click(object sender, EventArgs e)


{
try
{
con.Open();
DataTable dt = new DataTable();
da = new SqlDataAdapter("Select * from Customer where C_Id=" +
txtsearch.Text, con);
da.Fill(dt);
dgv.DataSource = dt;
con.Close();

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

private void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e)


{

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();
}
}

private void guna2Button1_Click(object sender, EventArgs e)


{
try
{
//con.Open();
DataTable dt = new DataTable();
da = new SqlDataAdapter("Select * from Customer where FullName LIKE '" +
txtsearchname.Text + "%'", con);
da.Fill(dt);
dgv.DataSource = dt;
con.Close();

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

private void btnRefresh_Click(object sender, EventArgs e)


{
Customers_Load(this, null);
}
}
}

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();
}

private void Displaydata()


{
con.Open();
DataTable dt = new DataTable();
da = new SqlDataAdapter("Select * from Staff", con);
da.Fill(dt);
dgv.DataSource = dt;
con.Close();
}
private void ClearData()
{
txtsf_id.Clear();
txtfullname.Clear();
txtGender.Clear();
txtaccupation.Clear();
txtphone.Clear();
txtP_phone.Clear();
txtLevel.Clear();
txtsalary.Clear();
txtStaff_Status.Clear();
ID = 0;
}

private void btnSave_Click(object sender, EventArgs e)


{
try
{
if (txtsf_id.Text != "" && txtfullname.Text != "" && txtsalary.Text != ""
&& txtphone.Text != "" && txtP_phone.Text != "" && txtLevel.Text != "" &&
txtaccupation.Text != "" && txtGender.Text != "" && txtStaff_Status.Text != "")
{
cmd = new SqlCommand("insert into Staff values
(@Sf_Id,@fullname,@salary,@Phone,@P_Phone,@Level,@Accupation,@Gender,@Staff_Status)",
con);

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();
}
}

private void btnUpdate_Click(object sender, EventArgs e)


{
try
{
if (txtsf_id.Text != "" && txtfullname.Text != "" && txtsalary.Text != ""
&& txtphone.Text != "" && txtP_phone.Text != "" && txtLevel.Text != "" &&
txtaccupation.Text != "" && txtGender.Text != "" && txtStaff_Status.Text != "")
{
cmd = new SqlCommand("update Staff set Sf_Id=@Sf_Id,
FullName=@FullName, Salary=@Salary, Phone=@Phone, P_Phone=@P_Phone, Level=@Level,
Accupation=@Accupation, Gender=@Gender, Staff_Status=@Staff_Status where Sf_Id=@Sf_Id",
con);
con.Open();
ID = Convert.ToInt32(txtsf_id.Text);
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 Updated successfully");
ClearData();
Displaydata();
}
else
{
MessageBox.Show("Please provade Details");
}

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

36
{
con.Close();
}
}

private void btnDelete_Click(object sender, EventArgs e)


{
try
{
if (txtsf_id.Text != "")
{
cmd = new SqlCommand("Delete Staff where Sf_id=@Sf_id", con);
con.Open();
ID = Convert.ToInt32(txtsf_id.Text);
cmd.Parameters.AddWithValue("@Sf_id", ID);
cmd.ExecuteNonQuery();

MessageBox.Show("Record Deleted successfully");


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();
}
}

private void btnSearch_Click(object sender, EventArgs e)


{
try
{
con.Open();
DataTable dt = new DataTable();
da = new SqlDataAdapter("Select * from Staff where Sf_id=" +
txtsearch.Text, con);
da.Fill(dt);
dgv.DataSource = dt;
con.Close();

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

37
{
con.Close();
}
}

private void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e)


{
try
{
dgv.CurrentRow.Selected = true;
txtsf_id.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();
txtphone.Text = dgv.Rows[e.RowIndex].Cells["Phone"].Value.ToString();
txtP_phone.Text = dgv.Rows[e.RowIndex].Cells["P_Phone"].Value.ToString();
txtLevel.Text = dgv.Rows[e.RowIndex].Cells["Level"].Value.ToString();
txtaccupation.Text =
dgv.Rows[e.RowIndex].Cells["Accupation"].Value.ToString();
txtGender.Text = dgv.Rows[e.RowIndex].Cells["gender"].Value.ToString();
txtStaff_Status.Text =
dgv.Rows[e.RowIndex].Cells["Staff_Status"].Value.ToString();

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

private void guna2Button2_Click(object sender, EventArgs e)


{
try
{
//con.Open();
DataTable dt = new DataTable();
da = new SqlDataAdapter("Select * from Staff where FullName LIKE '" +
txtsearchname.Text + "%'", con);
da.Fill(dt);
dgv.DataSource = dt;
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;

double.TryParse(txtsalary.Text, out Salary);


double.TryParse(txtA_Amount.Text, out Amount);
Total = Salary - Amount;
txtTotal.Text = Total.ToString();
}

private void updateStaff()


{
try
{
if (con.State == ConnectionState.Closed)
{
con.Open();
string Update = "Update Staff set Staff_status='" +
txtstaffStatus.Text + "' where Sf_Id=" + comboBox1.Text + "";
SqlCommand cmd = new SqlCommand(Update, con);
cmd.ExecuteNonQuery();
displayNonTakedId();
con.Close();

}
}
catch (Exception ex)
{

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

private void btnSave_Click(object sender, EventArgs e)


{
try
{
if (txts_Id.Text != "" && comboBox1.Text != "" && txtfullname.Text != ""
&& txtsalary.Text != "" && txtA_Amount.Text != "" && txtstaffStatus.Text != "" &&
txtTotal.Text != "")
{
cmd = new SqlCommand("insert into Salary values
(@S_Id,@Sf_Id,@FullName,@Salary,@Advanced_Amount,@Staff_Status,@Total,@Date)", con);
con.Open();
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 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();
}
}

private void btnUpdate_Click(object sender, EventArgs e)


{
try

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();
}
}

private void btnDelete_Click(object sender, EventArgs e)


{
try
{
if (txts_Id.Text != "")
{
cmd = new SqlCommand("Delete Salary where S_Id=@S_Id", con);
con.Open();
ID = Convert.ToInt32(txts_Id.Text);
cmd.Parameters.AddWithValue("@S_Id", ID);
cmd.ExecuteNonQuery();

MessageBox.Show("Record Deleted successfully");

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();
}
}

private void btnSearch_Click(object sender, EventArgs e)


{
try
{
if (con.State == ConnectionState.Closed)
{
con.Open();
DataTable dt = new DataTable();
da = new SqlDataAdapter("Select * from Salary where S_Id=" +
txtsearchId.Text, con);
da.Fill(dt);
dgv.DataSource = dt;
con.Close();

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

private void guna2Button1_Click(object sender, EventArgs e)


{
try
{
//con.Open();
DataTable dt = new DataTable();
da = new SqlDataAdapter("Select * from Salary where FullName LIKE '" +
txtSearchName.Text + "%'", con);
da.Fill(dt);
dgv.DataSource = dt;

44
con.Close();

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

private void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e)


{
try
{

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();
}
}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)


{
try
{
if (comboBox1.Text != "")
{
con.Open();
string select = "select * from Staff where Sf_Id=" + comboBox1.Text +
"";
SqlCommand cmd = new SqlCommand(select, con);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
txtfullname.Text = dr.GetValue(1).ToString();

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();
}
}

private void txtsalary_TextChanged(object sender, EventArgs e)


{
calculation();
}

private void txtA_Amount_TextChanged(object sender, EventArgs e)


{
calculation();
}

private void txtstaffStatus_TextChanged(object sender, EventArgs e)


{

private void txtTotal_TextChanged(object sender, EventArgs e)


{
calculation();
}

private void guna2Button3_Click(object sender, EventArgs e)


{
Report_Salary cc = new Report_Salary();
cc.Show();
}

private void guna2Button2_Click(object sender, EventArgs e)


{
Salary_Load(this, null);
}
}
}

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.

5.1 Future work


It may have not attractiveness Functional and Graphical that attractive with the user, for the
future will update it and we will add more additional interfaces that make the software more
attractive and Functional to improve the Software Functionality. We will be upgrading with new
visions and design that better than this part now we can’t able to Upgrading due to time and our
techniques when we reach our hope we will produce new versions. That is the best this one this
software will make more update in reality for all that reasons it made.to make an update placed
and make advanced this software works only offline It may have not Attractiveness graphical
interface that attractive with the user, for the future will update it and We will add more
additional interfaces that make the software more attractive.

The interfaces that will update is:-


1. Graphic interface
2. Labels and their interfaces
3. Controls and their interface structure
4. 4. Colors and user interfaces
5. 5. Add New advanced Features

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

https://www.Code Charge Studio (2021, June 28)


http://docs.codecharge.com/studio50/html/index.html?http://docs.codecharge.com/studio50/ht
ml/UserGuide/Forms/LoginForm.html?toc
https://www.scribbr.com/ (2021, May 10
https://www.scribbr.com/research-
process/problem-statement/

49

You might also like