You are on page 1of 44

COFFEE SHOP MANAGEMENT SYSTEM

BY

Muhammad Atique
2016-ag-8366
BSCS 6th Semester
Bachelor of Computer Science University of
Agriculture
Sub Campus Burewala-Vehari

A Documentation

Approved By
[Major Professor]
Eng. MR Shakeel
TABLE OF CONTENTS

ABSTRACT

DECLARATION OF THE STUDENT

CERTIFICATE ISSUED BY THE SUPERVISOR

ACKNOWLEDGEMENT

1. Introduction

1.1 About Project

1.2 Objectives

1.3 Purpose

1.4 Project Overview

2. Problem Selection

2.1 Existing System

2.2 Proposed System

3 Functional requirements

4 Non Functional requirements

5 System Analysis
5.1 SDLC

5.2 USE CASE DIAGRAM

6 System Design

7 System Testing and Implementation

7.2 Types of Testing


7.2.1 Black Box Testing
7.2.2 White Box Testing

8 Screen shots

8.1 Coding

9 Conclusion
ABSTRACT
The objective of the project is to design a System application which enables the
Manager to generate bills save time. The project has been designed in C#.NET technology
and consists of a SQL server which acts as the database for the project.
My motivation for the project came from my enthusiasm and strong urge to learn C# and
.NET which is one of the fastest growing technologies in today’s world. The Coffee
Management project mainly consists of two types of users. The customers who access the
information provided by the Application and the administrator who modifies and updates the
information. All the data needed for the application is stored in the form of tables in the SQL
server 2008. The report contains the details of all the tasks carried out during the entire
software development life cycle of the Coffee Shop Management System. This document
depicts all the details of the project starting from the project design to testing.
Acknowledgements
I would like to thank Engr. MR Shakeel my major professor who has helped me and guided
me through the entire life cycle of the project.
I would also like to specially thank my parents for their constant moral support and
encouragement throughout the project. It is they who have helped me achieve all my dreams
through their blessings throughout my life.
Dedication
I would like to dedicate the project Coffee Shop Management System to My Family and
Teacher, Specially for those who help me to reach this position.
Introduction
The objective of the project is to design a System application which enables the Manager to
generate bills save time. It should speedup the activities taking place in cafe. The billing
system also enhance and error free.
1.1 About Project

The project named “Coffee Shop Management System” is written in C#, mainly because of
it’s suitability for this type of application. Its user friendly nature and in-built
documentation, complication, error detection, binding facilities and interaction with other
software packages make it most powerful tool for software development. More over. C#
consists of all the technologies that help in creating and running robust, scalable and
distributed packages.C# is a general-purpose object-oriented programming language, and is
intended to be an improved C with object capabilities

1.2 Objectives of the Project

> To provide some amount of automation in Coffee Shop management.


> To help Coffee Shop management in making their business more efficient.
> An added attraction for their potential customers.
> It will also show the attitute of the management that they are aware to the newly introduced
technology and ready to adopt them.

1.3 Purpose of the project

• Electronically handling of Bill generation to enhance the accuracy,

flexibility, reliability and to remove the human's error.


• To provide, efficient, accurate, reliable, fast, and robust structure that can handle
any number of customer transactions.

• Need of Computer station

A few factors that directs us to develop a new system are given below

1) Faster System

2) Accuracy
3) Reliability

4) Informative

1.5 PROJECT OVERVIEW

> Database and database systems have become an essential component of everyday life

in modern society. In the course of activities of a day, most of us encounter several

activities that involve some interaction with the database. For example, if we go to

the bank to deposit or withdraw funds or if we make a Hotel or Airline Reservation,

chances are that our activities will involve someone accessing a database.
> The above interactions are examples of what we may call traditional database applications,
where most of the application that is stored and accessed is either textual

or numeric. In our project we will concentrate on this aspect of computer application.

> There are several ways to implement databases. Some of them are file handling mechanism,
relational database, object-relational database or object-oriented

databases. In our project we will relational database feature provided by C# Language.

> Facility to view the list of Team


2. PROBLEM SELECTION

2.1 Existing System:

The system is very time consuming and lazy. This system is more prone to errors and sometimes the
approach to various problems is unstructured.

If any old data or information is to be fetched then it is a great problem for user to get the
information in short span of time as to get information from files is not an easy task.

As everything is done manually, so if any record is misplaced then agency has to take full
responsibility.

3.2 FUNCTIONAL REQUIREMENTS


The functional requirements of the Coffee Shop Management System are divided among the
Employ and the administrator of the application.
These functional requirements can be explained in detail as follows:
1.1 Use Case name: Employ Registration

> Description: This use case describes the scenario where the user registers with the
application by providing all the necessary details of an Employ.

1.2 Use Case name: Employ Login

> Description: This use case describes the scenario where the user logs into the

application, with the username and password he has provided while registering with the
system.

1.5 Use Case name: Bill Generation

> Description: This use case describes the scenario where the admin/employ generate bill.
1.1 Use Case name: Login/Logout

> Description: This use case describes the scenario where the administrator of the
application, logs into the system and logs out after the work is done.

1.2 Use Case name: Add/Delete or Modify Customer information

> Description: This use case describes the scenario where the administrator adds, deletes
or modifies customer information in the system database
3.3 Nonfunctional Requirements
1 Performance Requirements
> The system shall accommodate 400 users during the peak usage time window of 4:00pm
to 10:00pm local time

2 Security Requirements
> Users shall be required to log in to the system for their own information and modification
with e-mail address and password.

> The system shall permit only authorized members who are on the list of authorized Menu
Managers to do administrator’s task.

3.4 EXTERNAL INTERFACES


The different types of interfaces that we would come across while developing the Coffee
Management system application are as follows:
• User Interface
• Hardware Interface
• Software Interface
3.4.1 USER INTERFACE
There are two types of users for the Airline Reservation System project. One is the customer
and the other is the administrator. Both the customer and administrator user interface
Figure representing the sample Administrator Interface 3.4.3 SOFTWARE INTERFACE
The application should run on a Windows 8 Operating System. Since the application needs a
database to store all the details in MySQL would be used.
Visual Studio.NET 2013 would be used for creating the application. All the coding will be done in

C#.

5. SYSTEM ANALYSIS

The analysis model must achieve three primary objectives:-


1. To describe the requirements of the customer.
2. To establish a basis for the creation of a software design.
3. To define a set of requirements that can be validated once software is built.
An Overview to system analysis
The system analysis phase is considered to be one of the most important phases in the system
development life cycle. It is immensely important that the software developer make through
study of the existing system. Thorough study of the system is made and need i.e. features that
are critical to system success and users wants (i.e. features that would be good but not
essential) are brought out. The study will enable the developer to know the intricacies of the
existing system.
Requirement analysis is done in order to understand the problem which the S/W system is to
solve e.g., the problem could be automating the existing manual system or developing a
completely new automated system or a combination of the two. For large systems having a
large number of features and the need to perform many different tasks, understanding the
requirement of the system is a major task. The emphasis in requirement analysis is on
identifying what is needed from the system, and not how the system achieves its goal.
The main objective behind any business organization is to maximize its profit besides
maintaining quality and strategic norms. This can be achieved by improving the efficiency of
the system by providing more facilities using automation, by adopting faster data access,
proper communication. , whereas the main objective behind automation is not only to
maximize profit but also to take care of passenger's interest by providing them better facilities.
The most important objective behind automation is to minimize Paper Work. Paper
Work/Registers are replaced by a Centralized Data Bank, which is well equipped to store /
provide information as and when required. Data Bank also helps speed up the communication
between various depts. outside agencies, as there is no need of making request against
different departments for a specific data and to wait for it for a long period. This also
improves the efficiency as it saves time and human resources.
By making the manual system computerized, we can ensure complete utilization of our
existing resources. Automation helps in generating the reports / information in a consistent
way, which saves time and labour if done manually.
In this project we have used Rapid Application Development (RAD) model. RAD is an
incremental software development process model that emphasizes an extremely short
development cycle. The following phases are encompassed:
> Business modeling: All the information about the business functioning of the Coffee Shop Management

System is collected, how the data and information is flow from one end to another end using the following

questions: What information drives the department process? What information is generated? Who generates

it? Where does the information go? Who process it?

> Data modeling: The information collected in Business modeling phase is refined into a set of data

objects that are needed to support the project. The attributes of each object are identified and the

relationships between these objects defined.

> Process modeling: Processing descriptions and functions like adding, modifying, deleting records,

printing reports, providing information, file handling etc. are created.

> Application generation: The fourth generation techniques are used to generate application, like reusing

the predefined functions or creating reusable components.

> Testing: Most of the functions are already tested, as they are predefined functions. However, new

components or functions are also tested after application generation.


It is the interdisciplinary part of science, dealing with analysis of sets of interacting entities,
the systems often prior to their automation as computer systems, and the interactions within
those systems. This field is closely related to operations results It is also "An explicit formal
inquiry carried out to help someone, referred to as the decision maker, identify a better course
of action and make a better decision than he might have otherwise made."
Systems analysis researchers apply mathematical methodology to the analysis of the systems
involved trying to form a detailed overall picture.
The development of a computer-based information system often comprises the use of a
systems analyst. When a computer-based information system is developed, systems using
computer hardware/software), what the system would be used for etc. analysis would
constitute the following steps:
> The development of a feasibility study, involving determining whether a project is
economically, socially, technologically and organizationally feasible.
> Conducting fact-finding measures, designed to ascertain the requirements of the
system's end-users. These typically span interviews, questionnaires, or visual
observations of work on the existing system.
> Gauging how the end-users would operate the system.
> It refers to the process of examining a business situation with the intent of improving it through
better procedures and methods. Systems development can generally be thought of as having two
major components: Systems Analysis and Systems Design.
> Systems design is the process of planning a new system or replace or complement an existing
system. But before this planning can be done, we must thoroughly understand the existing system
and determine how computers can best be used to make its operation more effective. Systems
analysis, then, is the process of gathering and interpreting facts, diagnosing problems and using the
information to recommend improvement to the system. In brief, we can say that analysis specifies
what the system should do. Design states how to accomplish the objective.
> Analysis is a detailed study of the various operations performed by a system and their relationships
within and outside of the system. A key question is: What must be done to solve the problem? One
aspect of analysis is defining the boundaries of the system and determining whether or not a
candidate system should consider other related systems. During analysis, data are collected on the
available files, decision points and transactions handled by the present system. There are some
logical system models and tools that are used in analysis. Data flow diagrams, interviews, on-site
observations, and questionnaires are examples. The interview is a commonly used tool in analysis.
It requires special skills and sensitivity to the subjects being interview. Bias in data collection and
interpretation can be a problem. Training, experience, and common sense are required for
collection of the information needed to do the analysis. Once analysis is completed, the analyst has
a firm understanding what is to be done. The next step is to decide how the problem might solve.
Thus, in systems design, we move from the logical to the physical aspects of the life cycle.

> The decision to acquire computer hardware or software must be handled in the same way as any
other business decision. The variety of sizes and types of computing resources available puts a
burden on the analyst who must select suitable hardware, software or services and advise the top
management accordingly.
> Today, selecting a system is a serious and time-consuming business. The time spent on the
selection process is a function of the applications and whether the system is a basic
micro- computer or a mainframe. In either case, planning system selection and
acquiring experienced help where necessary pay off in the long run.
There are various important factors, which should be considered prior to system

selection. They are:

> Define system capabilities that make sense for the business.

> Specify the magnitude of the problem, i.e., clarify whether selection entails a few peripherals or a major

decision concerning the mainframe.

> Assess the competence of the in-house staff.

> Hardware and software should be considered as a package.

> Develop a time frame for the selection process.

> Provide user indoctrination.

This is crucial, especially for first-time users. Selling the system to the user staff, provide adequate training

and creating an environment conductive to implementation are prerequisites for system acquisition.

The selection process should be viewed as a project and a project team should be formed with the help of

management. The selection process consists of several steps, which are discussed below:

> Requirements analysis: The first step in selection understands the user's requirement

within the framework of the organization's objectives and the environment in which the system is

being installed.

> System specifications: System specifications must be clearly defined. These specifications

must reflect the actual applications to be handled by the system and include system objectives,

flowcharts, input-output requirements, file structure and cost.


> Vendor selection: This step determines the vendor with the best combination of
reputation, reliability, service record, training, delivery time, lease/finance terms. The

selected vendors are invited to give a presentation of their system. The system chosen goes through
contract negotiations before implementation.

5.1SDLC

In this project we have followed the Waterfall model.

The waterfall model is the most familiar model. This model has five phases: requirements

analysis and specifications, design, implementation and unit testing, integration and system

testing, and operation and maintenance.

1. Requirements Analysis and Specification Phase: The goal of this phase is to understand the exact

requirements of the customer and to document them properly. This activity is usually executed together

with the customer, as the goal is to document all functions, performance and interfacing requirements for

the software. The requirements describes the "what" of a system, not the "how".

2. Design phase: The goal of this is to transform the requirements specification into a structure that is

suitable for implementation in some programming language.

3. Implementation and Unit Testing Phase: During testing, the major activities are centered around the

examination and modification of the code. Initially, small modules are tested in isolation from the rest of

the software product. There are problems associated with testing a module in isolation. How do we run a

module without anything to call it, to be called by it or, possibly, to output intermediate values obtained

during execution? Such problems are solved in this phase and modules are tested after writing some

overhead code.

4. Integration and System Testing Phase: The purpose of unit testing is to determine that each independent

module is correctly implemented. This gives little chance to determine that the interface between
modules is also correct, and for this reason integration testing is performed. System testing involves the

testing of the entire system whereas software is a part of the system. This is essential to build confidence

in the developers before software is delivered to the customer or released in the market.

5. Operation and Maintenance Phase: Software maintenance is a task that every development group has to

face, when the software is delivered to the customer's site, installed and is operational. Therefore, release of

software inaugurates the operation and maintenance phase of the life cycle. The time spent and effort

required to keep the software operational after release is very significant.


USE CASE DIAGRAM
6. SYSTEM DESIGN

The systems objectives outlined during the feasibility study serve as the basis from which the
work of system design is initiated. Much of the activities involved at this stage is of technical
nature requiring a certain degree of experience in designing systems, sound knowledge of
computer related technology and thorough understanding of computers available in the market
and the various facilities provided by the vendors. Nevertheless, a system cannot be designed
in isolation without the active involvement of the user. The user has a vital role to play at this
stage too. As we know that data collected during feasibility study will be utilized
systematically during the system design. It should, however, be kept in mind that detailed
study of the existing system is not necessarily over with the completion of the feasibility
study. Depending on the plan of feasibility study, the level of detailed study will vary and the
system design stage will also vary in the amount of investigation that still needs to be done.
This investigation is generally an urgent activity during the system design as the designer
needs to study minute’s details in all aspects of the system. Sometimes, but rarely, this
investigation may form a separate stage between Feasibility Study and Computer System
Design. Designing a new system is a creative process, which calls for logical as well as lateral
thinking. The logical approach involves systematic moves towards the end product keeping in
mind the capabilities of the personnel and the equipment at each decision making step. Lateral
thought implies encompassing of ideas beyond the usual functions and equipment. This is to
ensure that no efforts are being made to fit previous solutions into new situations.

7. SYSTEM TESTING
Software testing is the process of executing a program with the intention of finding errors in
the code. It is the process of exercising or evaluating a system or system component by
manual or by automatic means to verify that it satisfies specified requirements or to identify
differences between expected and actual results.
The objective of testing is to show incorrectness and testing is considered to succeed when an
error is detected. An error is a conceptual mistake made by either the programmer or the
designer or a discrepancy between a computed value and a theoretically correct value. A fault
is a specific manifestation of an error. An error may be cause of several faults. A failure is the
inability of a system or component to perform its required function within the specified limits.
A failure may be produced when a fault is executed or exercised.
Other activities that are often associated with software are static analysis and dynamic
analysis. Static analysis investigates the source code of software, looking for problems and
gathering metrics without actually executing the code. Dynamic analysis looks at the behavior
of software while it is executing, to provide information such as execution traces, timing
profiles and test coverage information.

7.1 Levels of testing


7.1.1 Unit Testing or Module Testing
The starting point of testing is Unit testing. In this, a module is tested separately at each step.
This helps to detect syntax and logical errors in the program and is performed by the coder
himself /herself during coding.
7.1.2 Integration Testing
The modules, which are tested in the Unit Testing, are integrated to build the overall system. It
is observed that many errors crop up when the modules are joined together. Integration testing
uncovers these errors while integrating the modules. It helps in establishing confidence
(correctness) in the complete, assembled system. It tests the System Design. It focus on
control, communication, interfaces, performance (other system qualities). It make use of stubs,
testbeds, data generators. It is the phase of software testing in which individual software
modules are combined and tested as a group. It follows unit testing and precedes system
testing. Integration testing takes as its input modules that have been unit tested, groups them in
larger aggregates, applies tests defined in an integration test plan to those aggregates, and
delivers as its output the integrated system ready for system testing.
Integration testing concentrates entirely on module interactions, assuming that the details
within each module are accurate. Module and Integration testing can be combined, verifying
the details of each module's implementation in an integration context. Many projects
compromise, combining module testing with the lowest level of subsystem integration testing,
and then performing pure integration testing at higher levels. Each of these views of
integration testing may be appropriate for any given project, so an integration testing method
should be flexible enough to accommodate them all.
The System testing is bringing together of all programs that a system comprises for testing
purposes. System testing is testing conducted on a complete, integrated system to evaluate the
system's compliance with its specified requirements. System testing falls within the scope of
black box testing, and as such, should require no knowledge of the inner design of the code or
logic. Programs are typically integrated in a top-down, incremental fashion. It is a series of
different tests whose primary purpose is to fully exercise the computer-based system. It
includes the following tests: -
7.2 Types of testing

7.2.1 Black Box Testing


It is also known as Functional Testing. It tests the overall functional requirements of product.
Inputs are supplied to product and outputs are verified. If the outputs obtained are the same as
the expected ones then the product meets the functional requirements. In this, the internal
procedures are not considered. In this the tester would only know the "legal" inputs and what
the expected outputs should be, but not how the program actually arrives at those outputs. This
Testing is more effective on larger units of code. In this test’s are done from user point of
view.
7.2.2 White Box Testing
It is also known as Structure Testing. It focuses on the internal functioning of the product. It
tests the loops of the Procedure, Decision points, Execution paths etc.
White box testing uses specific knowledge of programming code to examine outputs. The test
is accurate only if the tester knows what the program is supposed to do. He or she can then see
if the program diverges from its intended goal. White box testing does not account for errors
caused by omission, and all visible code must also be readable. As the knowledge of internal
coding structure is prerequisite, it becomes very easy to find out which type of input/data can
help in testing the application effectively. The other advantage of white box testing is that it
helps in optimizing the code. It helps in removing the extra lines of code, which can bring in
hidden defects.
Coding

Mian
using System;
using System.Collections.Generic;
using System.ComponentModel; using
System.Data; using System.Drawing;
using System.Linq; using
System.Text; using
System.Threading.Tasks; using
System.Windows.Forms;
namespace CafeManagement {
public partial class Main : Form {
public Main()
{
InitializeComponent();
}
private void placeOrderToolStripMenuItem_Click(object sender, EventArgs e)
{
Form1 frm = new Form1(); frm.ShowDialog();
this.Close();
}
private void userListToolStripMenuItem_Click(object sender, EventArgs e)
{
Employes_List user_List = new Employes_List();
user_List.Show();
this.Close();
}
private void updateToolStripMenuItem_Click(object sender, EventArgs e)
{
Update_Employes updateUser = new Update_Employes();
updateUser.ShowDialog();
this.Close();
}
private void registrationToolStripMenuItem1_Click(object sender, EventArgs e) {
Registration frmreg = new Registration();
frmreg.ShowDialog();
this.Close();
}
private void logoutToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Hide();
Login frm2 = new Login(); frm2.Show();

}
}
}

LOGIN using System;


using System.Collections.Generic;
using System.ComponentModel;
using System.Data; using
System.Drawing; using
System.Linq; using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace CafeManagement {
public partial class Login : Form {
public Login()
{
InitializeComponent();
}

private void btnlogin_Click(object sender, EventArgs e) {


string connectionstring;
SqlConnection con;

try
{
if (string.IsNullOrEmpty(txtemail.Text))
{
MessageBox.Show("Please enter your Username..."); txtemail.Focus();
}
if (string.IsNullOrEmpty(txtpassword.Text))
{
MessageBox.Show("Please enter your Password...");
txtpassword.Focus();
}
else

{
connectionstring = "Data Source=ATIQUE261; user id=sa;
password=angel; Initial Catalog=Atique";
con = new SqlConnection(connectionstring); con.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM login WHERE
username='" + txtemail.Text + "' AND password='" + txtpassword.Text + .... , con);
SqlDataReader dr = cmd.ExecuteReader();

if (dr.HasRows == true)
{

MessageBox.Show("login Successfully..."); Main frm_main = new


Main(); frm_main.ShowDialog(); this.Close();
}

else
{

MessageBox.Show("Data Not Valid ....");


}
}

}
catch (Exception ex)
{
MessageBox.Show("Error " + "\r\n" + ex.Message);
}
}
}

}
Main Frame
using System;
using System.Collections.Generic;
using System.ComponentModel; using
System.Data; using System.Drawing;
using System.Linq; using
System.Text; using
System.Threading.Tasks; using
System.Windows.Forms;

namespace CafeManagement {
public partial class Main : Form {
public Main()
{
InitializeComponent();
}
private void placeOrderToolStripMenuItem_Click(object sender, EventArgs e)
{
Form1 frm = new Form1(); frm.ShowDialog();
this.Close();
}
private void userListToolStripMenuItem_Click(object sender, EventArgs e)
{
Employes_List user_List = new Employes_List();
user_List.Show();
this.Close();
}
private void updateToolStripMenuItem_Click(object sender, EventArgs e)
{
Update_Employes updateUser = new Update_Employes();
updateUser.ShowDialog();
this.Close();
}
private void registrationToolStripMenuItem1_Click(object sender, EventArgs e) {
Registration frmreg = new Registration();
frmreg.ShowDialog();
this.Close();
}
private void logoutToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Hide();
Login frm2 = new Login(); frm2.Show();
} private void registrationToolStripMenuItem_Click(object sender, EventArgs e)
{

}
}
}
Place order
using System;
using System.Collections.Generic;
using System.ComponentModel; using
System.Data; using System.Drawing;
using System.Linq; using System.Text;
using System.Threading.Tasks; using
System.Windows.Forms;

namespace CafeManagement {
public partial class Form1 : Form {
public Form1()
{
InitializeComponent();

private void button3_Click(object sender, EventArgs e) { //btnReset


rtfReceipt.Clear(); txtLatte.Text =
"0"; txtEspresso.Text = "0";
txtMocha.Text = "0";
txtValeCoffee.Text = "0";
txtCappu.Text = "0";
txtAfricanCoffee.Text = "0";
txtMilkTea.Text = "0";
txtChineseTea.Text = "0";
txtCoffeCake.Text = "0";
txtRedValvetCake.Text = "0";
txtBlackForestCake.Text = "0";
txtBostonCream.Text = "0";
txtLagosChoco.Text = "0";
txtKillburnChoco.Text = "0";
txtCheeseCake.Text = "0";
txtRainbowCake.Text = "0";
lblCakeCost.Text = "0";
lblDrinkCost.Text = "0";
lblSvcCharge.Text = "1.75";
lblTax.Text = "0"; lblSubTotal.Text
= "0"; lblTotal.Text = "0";
chkLatte.Checked = false;
chkEspresso.Checked = false;
chkMocha.Checked = false;
chkValeCoffee.Checked = false;
chkCappucino.Checked = false;
chkAfricanCoffe.Checked = false;
chkMilkTea.Checked = false;
chkChineseTea.Checked = false;
chkRedValvet.Checked = false;
chkCoffe.Checked = false;
chkBlackForest.Checked = false;
chkBostonCream.Checked = false;
checkBox13.Checked = false;
chkKilburnChoco.Checked = false;
chkCheese.Checked = false;
chkRainbowCake.Checked = false;
}

private void button2_Click(object sender, EventArgs e)


{
//btnReceipt
rtfReceipt.Clear();

// rtfReceipt.AppendText(Environment.NewLine);
rtfReceipt.AppendText(" --------------------------------------------------
-------------- " + Environment.NewLine);
rtfReceipt.AppendText("\t\t" + "Aati Coffe Shop" + Environment.NewLine);
rtfReceipt.AppendText(" --------------------------------------------------
-------------- " + Environment.NewLine);
rtfReceipt.AppendText("Coffee Latte \t\t\t\t" + txtLatte.Text +
Environment.NewLine);
rtfReceipt.AppendText("Coffee Espresso\t\t\t" + txtEspresso.Text +
Environment.NewLine);
rtfReceipt.AppendText("Coffee Mocha \t\t\t\t" + txtMocha.Text +
Environment.NewLine);
rtfReceipt.AppendText("Hot Coffee \t\t\t" + txtValeCoffee.Text +
Environment.NewLine);
rtfReceipt.AppendText("Capuucino \t\t\t" + txtCappu.Text +
Environment.NewLine);
rtfReceipt.AppendText("Cold Coffee \t\t\t" + txtAfricanCoffee.Text +
Environment.NewLine);
rtfReceipt.AppendText("Milk Tea \t\t\t" + txtMilkTea.Text +
Environment.NewLine);
rtfReceipt.AppendText("Chinese Tea \t\t\t" + txtChineseTea.Text +
Environment.NewLine);
rtfReceipt.AppendText("Coffee Cake \t\t\t" + txtCoffeCake.Text +
Environment.NewLine);
rtfReceipt.AppendText("Vanila Flaver Cake \t\t" + txtRedValvetCake.Text +
Environment.NewLine);
rtfReceipt.AppendText("Black Forest Cake \t\t" + txtBlackForestCake.Text +
Environment.NewLine);
rtfReceipt.AppendText("Cream Cake \t\t" + txtBostonCream.Text +
Environment.NewLine);
rtfReceipt.AppendText("Chocolate Cake \t\t" + txtLagosChoco.Text +
Environment.NewLine);
rtfReceipt.AppendText("White Chocolate Cake \t\t" + txtKillburnChoco.Text +
Environment.NewLine);
rtfReceipt.AppendText("Cheese Cake \t\t\t" + txtCheeseCake.Text +
Environment.NewLine);
rtfReceipt.AppendText("Cake Bake \t\t\t" + txtRainbowCake.Text +
Environment.NewLine);
rtfReceipt.AppendText(" -----------------------------------------------
-------------- " + Environment.NewLine);
rtfReceipt.AppendText("Service Charge \t\t" + lblSvcCharge.Text +
Environment.NewLine);
rtfReceipt.AppendText(" -----------------------------------------------
-------------- " + Environment.NewLine);
rtfReceipt.AppendText("Tax \t\t\t\t" + lblTax.Text + Environment.NewLine);
rtfReceipt.AppendText("Sub Total \t\t\t" + lblSubTotal.Text +
Environment.NewLine);
rtfReceipt.AppendText("Total Cost \t\t\t" + lblTotal.Text +
Environment.NewLine);
rtfReceipt.AppendText(" -----------------------------------------------
-------------- " + Environment.NewLine);
rtfReceipt.AppendText(lblTimer.Text + "\t" + lblDate.Text);

private void button1_Click(object sender, EventArgs e)


{ //btnTotal
double lat, mocha, espr, vale, cappu, afri, mTea, cTea; double cCake,
rValvet, bFor, bCream, lChoco, kChoco, cheese, rain; double tax; tax = .99;

lat = 50.50; mocha = 49.99; espr = 80.50; vale = 100.00; cappu = 150.00;
afri = 160.00; mTea =145.00; cTea = 110.50; //coffee pries
cCake = 190.00; rValvet = 240.00; bFor = 220.00; bCream = 180.00; lChoco =
299.99; kChoco = 260.00; cheese = 360.00; rain = 250; //cake prices

//Coffee
double latteeCof = Convert.ToDouble(txtLatte.Text); double
mochaCof = Convert.ToDouble(txtMocha.Text); double espressoCof =
Convert.ToDouble(txtEspresso.Text); double valeCoffee =
Convert.ToDouble(txtValeCoffee.Text); double cappCof =
Convert.ToDouble(txtCappu.Text); double afriCof =
Convert.ToDouble(txtAfricanCoffee.Text); double miTea =
Convert.ToDouble(txtMilkTea.Text); double cineseTea =
Convert.ToDouble(txtChineseTea.Text);
//Cakes
double cofCake = Convert.ToDouble(txtCoffeCake.Text); double redValvet =
Convert.ToDouble(txtRedValvetCake.Text); double bForest =
Convert.ToDouble(txtBlackForestCake.Text); double bostonCream =
Convert.ToDouble(txtBostonCream.Text); double lagosChoco =
Convert.ToDouble(txtLagosChoco.Text); double kilbChoco =
Convert.ToDouble(txtKillburnChoco.Text); double cheeseCak =
Convert.ToDouble(txtCheeseCake.Text); double rainbow =
Convert.ToDouble(txtRainbowCake.Text);

Cafe eat_in_cafe = new Cafe(latteeCof, mochaCof, espressoCof, valeCoffee,


cappCof, afriCof, miTea, cineseTea,
cofCake, redValvet, bForest, bostonCream, lagosChoco, kilbChoco,
cheeseCak, rainbow);
double drinkCosts = (latteeCof * lat) + (mochaCof * mocha) + (espressoCof *
espr) + (valeCoffee * vale) + (cappCof * cappu) + (afriCof * afri)
+ (miTea * mTea) + (cineseTea * cTea);
lblDrinkCost.Text = Convert.ToString(drinkCosts);
double cakeCosts = (cofCake * cCake) + (redValvet * rValvet) +
(bForest * bFor) + (bostonCream * bCream) + (lagosChoco * lChoco) + (kilbChoco *
kChoco) + (cheeseCak * cheese) + (rainbow * rain);
lblCakeCost.Text = Convert.ToString(cakeCosts);

double svcCharge = Convert.ToDouble(lblSvcCharge.Text);

lblSubTotal.Text = Convert.ToString(cakeCosts + drinkCosts +


svcCharge);
lblTax.Text = Convert.ToString(((cakeCosts + drinkCosts + svcCharge) *
tax) / 100);
double totalAftTax = Convert.ToDouble(lblTax.Text); lblTotal.Text =
Convert.ToString(cakeCosts + drinkCosts + svcCharge + totalAftTax);

lblDrinkCost.Text = String.Format("{0:C}" ,drinkCosts); lblCakeCost.Text =


String.Format("{0:C}", cakeCosts); lblSvcCharge.Text =
String.Format("{0:C}", svcCharge); lblSubTotal.Text = String.Format("{0:C}",
(cakeCosts + drinkCosts +
svcCharge));
lblTax.Text = String.Format("{0:C}", totalAftTax); lblTotal.Text =
String.Format("{0:C}", (cakeCosts + drinkCosts + svcCharge + totalAftTax));
}

private void btnExit_Click(object sender, EventArgs e)


{
Application.Exit();
}

private void Form1_Load(object sender, EventArgs e)


{

lblDate.Text = DateTime.Now.ToShortDateString(); timer1.Start();

txtLatte.Text = "0"; txtEspresso.Text = "0"; txtMocha.Text = "0";


txtValeCoffee.Text = "0"; txtCappu.Text = "0"; txtAfricanCoffee.Text = "0";
txtMilkTea.Text = "0"; txtChineseTea.Text = "0"; txtCoffeCake.Text = "0";
txtRedValvetCake.Text = "0"; txtBlackForestCake.Text = "0";
txtBostonCream.Text = "0"; txtLagosChoco.Text = "0"; txtKillburnChoco.Text =
"0"; txtCheeseCake.Text = "0"; txtRainbowCake.Text = "0"; lblCakeCost.Text =
"0";
lblDrinkCost.Text = "0";
lblSvcCharge.Text = "75";
lblSubTotal.Text = "0";
lblTax.Text = "0";
lblTotal.Text = "0";

txtLatte.Enabled = false;
txtEspresso.Enabled = false; ;
txtMocha.Enabled = false;
txtValeCoffee.Enabled = false;
txtCappu.Enabled = false;
txtAfricanCoffee.Enabled = false;
txtMilkTea.Enabled = false;
txtChineseTea.Enabled = false;
txtCoffeCake.Enabled = false;
txtRedValvetCake.Enabled = false;
txtBlackForestCake.Enabled = false;
txtBostonCream.Enabled = false;
txtLagosChoco.Enabled = false;
txtKillburnChoco.Enabled = false;
txtCheeseCake.Enabled = false;
txtRainbowCake.Enabled = false;

chkLatte.Checked = false;
chkEspresso.Checked = false;
chkMocha.Checked = false;
chkValeCoffee.Checked = false;
chkCappucino.Checked = false;
chkAfricanCoffe.Checked = false;
chkMilkTea.Checked = false;
chkChineseTea.Checked = false;
chkRedValvet.Checked = false;
chkCoffe.Checked = false;
chkBlackForest.Checked = false;
chkBostonCream.Checked = false;
checkBox13.Checked = false;
chkKilburnChoco.Checked = false;
chkCheese.Checked = false;
chkRainbowCake.Checked = false;

rtfReceipt.Clear();

private void chkLatte_CheckedChanged(object sender, EventArgs e) {


if (chkLatte.Checked==true)
{
txtLatte.Enabled = true;
}
else
{
txtLatte.Enabled = false;
txtLatte.Text = "0";
}
}

private void txtLatte_Click(object sender, EventArgs e)


{
} txtLatte.Text = "";
txtLatte.Focus();
}
private void chkEspresso_CheckedChanged(object sender, EventArgs e)
{
if (chkEspresso.Checked == true)
{
txtEspresso.Enabled = true;
}
else
{
txtEspresso.Enabled = false;
txtEspresso.Text = "0";
}
}

private void txtEspresso_Click(object sender, EventArgs e)


{

txtEspresso.Text = "";
txtEspresso.Focus();
}

private void chkMocha_CheckedChanged(object sender, EventArgs e)


{

if (chkMocha.Checked == true)
{
txtMocha.Enabled = true;
}
else
{
txtMocha.Enabled = false;
txtMocha.Text = "0";
}
}

private void txtMocha_Click(object sender, EventArgs e)


{

txtMocha.Text = "";
txtMocha.Focus();
}

private void chkValeCoffee_CheckedChanged(object sender, EventArgs e) {

if (chkValeCoffee.Checked == true)
{
txtValeCoffee.Enabled = true;
}
else
{
txtValeCoffee.Enabled = false;
txtValeCoffee.Text = "0";
}
}

private void txtValeCoffee_Click(object sender, EventArgs e)


{

txtValeCoffee.Text = "";
txtValeCoffee.Focus();
private void chkCappucino_CheckedChanged(object sender, EventArgs e)
{
if (chkCappucino.Checked == true)
{
txtCappu.Enabled = true;
}
else
{
txtCappu.Enabled = false;
txtCappu.Text = "0";
}
}

private void txtCappu_Click(object sender, EventArgs e)


{

txtCappu.Text = ""; txtCappu.Focus();


}

private void chkAfricanCoffe_CheckedChanged(object sender, EventArgs e) {

if (chkAfricanCoffe.Checked == true)
{
txtAfricanCoffee.Enabled = true;
}
else
{
txtAfricanCoffee.Enabled = false;
txtAfricanCoffee.Text = "0";
}
}

private void txtAfricanCoffee_Click(object sender, EventArgs e)


{

txtAfricanCoffee.Text = "";
txtAfricanCoffee.Focus();
}

private void chkMilkTea_CheckedChanged(object sender, EventArgs e)


{

if (chkMilkTea.Checked == true)
{
txtMilkTea.Enabled = true;
}
else
{
txtMilkTea.Enabled = false;
txtMilkTea.Text = "0";
}
}

private void txtMilkTea_Click(object sender, EventArgs e)


{

txtMilkTea.Text = "";
}

txtMilkTea.Focus();
private void chkChineseTea_CheckedChanged(object sender, EventArgs e) {
if (chkChineseTea.Checked == true)
{
txtChineseTea.Enabled = true;
}
else
{
txtChineseTea.Enabled = false;
txtChineseTea.Text = "0";
}
}

private void txtChineseTea_Click(object sender, EventArgs e)


{

txtChineseTea.Text = "";
txtChineseTea.Focus();
}

private void chkCoffe_CheckedChanged(object sender, EventArgs e)


{

if (chkCoffe.Checked == true)
{
txtCoffeCake.Enabled = true;
}
else
{
txtCoffeCake.Enabled = false;
txtCoffeCake.Text = "0";
}
}

private void txtCoffeCake_Click(object sender, EventArgs e)


{

txtCoffeCake.Text = "";
txtCoffeCake.Focus();
}

private void chkRedValvet_CheckedChanged(object sender, EventArgs e)


{

if (chkRedValvet.Checked == true)
{
txtRedValvetCake.Enabled = true;
}
else
{
txtRedValvetCake.Enabled = false;
txtRedValvetCake.Text = "0";
}
}

private void txtRedValvetCake_Click(object sender, EventArgs e)


{

txtRedValvetCake.Text = "";
txtRedValvetCake.Focus();
} private void chkBlackForest_CheckedChanged(object sender, EventArgs e)
{

if (chkBlackForest.Checked == true)
{
txtBlackForestCake.Enabled = true;
}
else
{
txtBlackForestCake.Enabled = false;
txtBlackForestCake.Text = "0";
}
}

private void txtBlackForestCake_Click(object sender, EventArgs e)


{

txtBlackForestCake.Text = "";
txtBlackForestCake.Focus();
}

private void chkBostonCream_CheckedChanged(object sender, EventArgs e)


{

if (chkBostonCream.Checked == true)
{
txtBostonCream.Enabled = true;
}
else
{
txtBostonCream.Enabled = false;
txtBostonCream.Text = "0";
}
}

private void txtBostonCream_Click(object sender, EventArgs e)


{

txtBostonCream.Text = "";
txtBostonCream.Focus();
}

private void checkBox13_CheckedChanged(object sender, EventArgs e)


{

if (checkBox13.Checked == true)
{
txtLagosChoco.Enabled = true;
}
else
{
txtLagosChoco.Enabled = false;
txtLagosChoco.Text = "0";
}
}

private void chkKilburnChoco_CheckedChanged(object sender, EventArgs e)


{private void txtLagosChoco_Click(object sender, EventArgs e)
{
txtLagosChoco.Text = "";
txtLagosChoco.Focus();
}

if (chkKilburnChoco.Checked == true)
} {
txtKillburnChoco.Enabled = true;
}
else
{
txtKillburnChoco.Enabled = false;
txtKillburnChoco.Text = "0";
}
} private void txtKillburnChoco_Click(object sender, EventArgs e)
{

txtKillburnChoco.Text = "";
txtKillburnChoco.Focus();
}

private void chkCheese_CheckedChanged(object sender, EventArgs e) {

if (chkCheese.Checked == true)
{
txtCheeseCake.Enabled = true;
}
else
{
txtCheeseCake.Enabled = false;
txtCheeseCake.Text = "0";
}
} private void txtCheeseCake_Click(object sender, EventArgs e)
{

txtCheeseCake.Text = ""; txtCheeseCake.Focus();


}

private void chkRainbowCake_CheckedChanged(object sender, EventArgs e) {

if (chkRainbowCake.Checked == true)
{
txtRainbowCake.Enabled = true;
}
else
{
txtRainbowCake.Enabled = false;
txtRainbowCake.Text = "0";
}
}

private void txtRainbowCake_Click(object sender, EventArgs e)


{

txtRainbowCake.Text = ""; txtRainbowCake.Focus();


}

lblTimer.Text = DateTime.Now.ToLongTimeString();
private void printDocument1_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawString(rtfReceipt.Text, new Font("Arial", 14,
FontStyle.Regular), Brushes.Black, 120, 120);
}

private void button4_Click(object sender, EventArgs e) {

printPreviewDialog1.Document = printDocument1;
printPreviewDialog1.ShowDialog();
}

}
}

Screen Shots of Running Project:


l
pp
Conclusion
This Documentation is very useful to focus on our project requirement and aspects. Since it is
gesture recognition software we expect good result for this project in term of usability,
availability, scalability, reliability and maintenance.

You might also like