Design and implementation of restaurant ordering system based on C#


Based on the in-depth study of the work flow of small and medium-sized catering enterprises, the analysis of various factors restricting the work efficiency of catering enterprises found that the main factor affecting the efficiency is the phenomenon of commonly using manual registration of recipes. This system uses computer systems to realize the work flow of catering enterprises It adopts object-oriented development method and C# language, relies on Visual studio2010 as a development tool, and uses Sql Server 2005 network database to store data. Realized the four major functions of customer ordering, chef catering, cash register management, and system settings, and solved the problems of slow customer ordering, unclear waiter registration, missing chef catering, untimely and unintuitive recipe updates, and chaotic member management in catering companies Phenomenon.

Key words: restaurant order; object-oriented development method; C#

Contents
Abstract I
Chapter 1 Introduction 1
1.1 Practical background and theoretical background 1
1.2 Research purpose and significance 2
1.2.1 Purpose 2
1.2.2 Significance 3
Chapter 2 System requirements analysis 4
1. Introduction 4
1.1 Purpose of writing 4
1.2 Project background 4
2. Definition of terms 5
3. Reference materials 5
4. Current catering enterprise workflow 5
5. Workflow of the proposed system 6
6. Product functions 7
7. Software requirements description 7
8. System Use Case Diagram 8
9. Software Interface 9
Chapter 3 System Design 10
1. System Deployment Diagram Design 10
2. Database Design 11
2.1 Naming Convention 11
2.2 Security Design 11
2.3 Conceptual Design 11
2.4 Physical Design 13
2.5 Functional Design 15
3. System Module Design 16
4. System Architecture Design 17
5. Client System Directory Structure 17
6. System Class Diagram Design 18
7. Main Module Design 22
7.1 Login Module Design 22
7.2 Order Module Design 24
Chapter 4 System Implementation 27
1: System Coding Specifications 27
1.1: Type Naming 27
1.2, Method and Attribute Naming 28
1.3, Variables and Constants 28
1.4, Labels 29
1.5, Namespace 29
1.6, Notes 30
2: Module Function Realization 30
2.1 Login Module Realization 30
2.2 The main code of ordering module 31
2.3 Cash register module code implementation 33
2.4 Catering module code implementation 35
2.5 System management module implementation 35
Chapter 5 System testing 37
1 Introduction 37
1.1 Purpose of writing 37
1.2 Project background 37
1.3 System introduction 37
1.4 Terms and Abbreviations 38
1.5 References 38
2 Test Overview 38
2.1 Test Case Design 38
2.2 Test Environment and Configuration 38
2.3 Test Methods (and Tools) 39
3 Test Results and Defect Analysis 39
3.1 Test Execution and Records 39
Conclusion 45
Literature 46
Thanks 49

Chapter 1 Introduction
1.1 Practical background and theoretical background
1.1.1 Practical background
After more than 30 years of reform, opening up and development in China's catering market, it can be said that our country is ushering in a period of great development of the catering industry. The market potential is huge and the prospect is very promising. broad. According to the 2009 Catering Industry Development Report released by the China Cuisine Association, even in 2009, when the economy was hit hard, the retail sales of the catering industry in the whole society reached 1,799.8 billion yuan, a year-on-year increase of 16.8%. Among them, the monthly retail sales exceeded 130 billion yuan, and the growth rate was stable at 14.4% to 21.6%. Among all kinds of consumption expenditures, the growth rate is the highest, second only to transportation and communication expenditures. And it is expected that the catering market will continue to grow in 2012, and the turnover will reach 2 trillion yuan.
At the same time, the quality and connotation of the development of my country's catering industry have also undergone major changes. The business field and market space of the industry continue to expand, the business level and enterprise management level continue to improve, the business forms are becoming more and more diversified, the characteristics of diversification of investment entities and consumer demand are more prominent, the number of outlets and personnel teams continue to expand; the catering market is more prosperous, and consumption The trend of personalization and specialization is obvious, and the pursuit of healthy nutrition and chain scale development have become the themes. The pace of development of collectivization, branding, industrialization and internationalization is accelerating, and the process of catering modernization is constantly advancing.
In recent years, the development of China's catering industry has maintained strong and rapid growth. At the same time, we have also seen the common problems in the catering industry. The development of catering enterprises has always been in the state of self-exploration, self-operation, self-accumulation and self-improvement, and the characteristics of low profit, heavy load, small support and difficult development are prominent. Catering enterprises have very insufficient conditions in the development of product standardization technology and equipment, the establishment of chain management system, the cultivation of professional talents, the absorption of capital investment, theoretical guidance and information exchange, etc., there are difficulties in technology development and equipment matching, management and talents, Constrained by deep-seated factors such as difficulty in distribution channels and development funds, difficulties in communication and cooperation, and weak industry platforms and basic support, it has a greater impact on the development of enterprises.

1.2 Purpose and Significance of the Research
1.2.1 Purpose
In our country with a highly developed "food culture", the catering industry has undoubtedly become the largest traditional industry. However, it is this industry with a long history and a large scale that is also one of the industries with the slowest and lowest degree of informatization. So far, the operation mode of most catering enterprises still stays in the situation of "a piece of paper, a pen, the manager screams loudly, and the employees run away"; and the accounting work is still based on a pen or an abacus. , or in the best case, a calculator for addition, subtraction, multiplication and division is still based on human brain calculations, which is not only a huge workload, but also extremely error-prone. The author once saw a food stall with a very good business. The waiter rushed in and out between the outdoor table, the lobby bar and the kitchen, while the manager was sweating profusely with a calculator. It was a spectacular scene. Not to mention the meaning of this kind of repetitive and monotonous labor day after day, the conflicts and disputes with customers caused by mistakes in consumption calculations alone are innumerable.
In fact, human civilization has entered the era of electronic information, and most repetitive, monotonous, and programmable tasks can already be completed by computers. In the face of complex and huge computing tasks, the efficiency and accuracy of computers are beyond the reach of the human brain. As a traditional industry, the catering industry, like many other traditional industries, can also introduce information transformation.
The content of the informatization transformation of the catering industry mainly includes: changing from traditional pen and paper ordering to electronic ordering; replacing traditional manual calculation, statistics, and management with computers for calculation, statistics, and management; replacing modern electronic Technology, wireless technology, computer technology and network technology are introduced into the catering industry to replace some manual operations, speed up the operation efficiency of catering enterprises, improve the management level of catering enterprises, and make the operation of catering enterprises more standardized, scientific and efficient.
In the informatization transformation of catering enterprises, the wireless ordering (ordering) system has become its core content, and it is also the only way for catering enterprises to carry out informatization transformation.
Therefore, the purpose of this paper is to replace the traditional paper and pen for electronic ordering (ordering) through the informatization transformation of catering enterprises and the use of wireless technology, so as to realize the instant transmission of information over a long distance. Of course, the wireless ordering (ordering) system can not only order food, but also realize powerful statistical and management functions through the supporting catering management software, so that catering enterprises can truly realize informationization.
1.2.2 Significance
Informatization is the only way to effectively improve the grade and management level of catering enterprises, achieve scientific management, scientific decision-making, efficient operation, and reduce costs. The use of wireless ordering (ordering) system to replace traditional manual ordering, and the use of catering management software to replace traditional manual statistics and extensive management are the core contents of informatization.
Catering companies introduce a set of wireless ordering (ordering) system, the cost is about 10,000 yuan (depending on the configuration), which is equivalent to a waiter's salary for one year, but the convenience and management level upgrade brought is unparalleled. The greatly improved operating efficiency and labor cost savings brought by the wireless ordering (ordering) system far exceed its investment cost. It can be said to be the best choice for the informatization of catering enterprises.

Chapter 2 System Requirements Analysis
2.1 Introduction
2.1.1 Purpose of Writing
This document is the project requirements specification of the restaurant ordering system. It briefly reviews the restaurant ordering system, analyzes the current business process, and summarizes the basic characteristics of this type of management system. Overall function, summarize and extract all requirements as completely as possible. This document has very important guiding significance for project developers, designers and system implementers.
2.1.2 Project Background
China is a world-renowned gourmet country, with five thousand years of food culture and a huge catering market. With the transformation of people's living standards and lifestyles, the catering industry has a huge investment market, known as China's However, it should also be noted that the catering industry is not only facing huge opportunities for development, but also facing unprecedented challenges and tests.
With the continuous development of the catering industry, the operation and management are also gradually moving towards electronicization. The internal affairs of the catering industry are managed through the computer information system, which makes the operation more simple and efficient. Focusing on finance, reduce the labor intensity of front-line operators, save the shift time of business personnel, and strengthen financial audit management. Provide a variety of functions of ordering, settlement, and statistical reports, and provide direct printing of order data at the front desk for each kitchen. In catering operations, the traditional paper production process cannot meet the requirements of modern customers in terms of information entertainment and service security. The use of this system enables restaurant managers to manage business and entertainment conveniently, and greatly increases the cost control and sales of each store. 2.2
Definitions
The speed at which tables are full and empty. A high turnover rate means that more diners ate and left, while a low turnover rate means that the same diners are using the table for an extended period of time, or that the table seats are empty.
2.3 The current workflow of catering enterprises
Currently, small and medium-sized catering enterprises adopt the most manual bookkeeping method, and its business process is shown in Figure 2.1

Figure 2.1 Introduction to manual business process analysis
flow chart: After the customer arrives at the restaurant and is guided to the seat by the usher, the customer will take the recipe and register the food ordered by the customer. After the completion, the recipe will be sung and confirmed by the customer. The catering staff, the catering staff will prepare all the drinks, drinks, desserts and other food for the guests according to the recipes submitted by the waiters in the lobby. The chef will quickly process delicious food in the order of cooling first and then hot according to the recipes provided by the waiters in the lobby. Make friends with the delivery staff in time Deliver to designated table. After the guests have finished eating, the waiter or the customer goes to the cashier to go through the settlement procedures. If the customer has a membership card, the cashier should give corresponding discounts. Sometimes, there will inevitably be competition for recipes, serving wrong dishes, missing dishes, forgetting to serve dishes, and calculation errors, which will cause customer dissatisfaction at least, and disputes at worst. Therefore, it is necessary to adopt a new working mode to avoid the above-mentioned the occurrence of the situation.
The workflow of the proposed system in 2.5 is
based on the various disadvantages brought about by the manual operation of traditional catering enterprises. A new system that uses computers to manage information—the restaurant ordering system came into being. The workflow of the system is shown in the figure 2.2 as shown

Figure 2.2 Automated ordering system
2.6 System function modules
According to the business flow chart of the proposed system, the function module diagram of the new system is analyzed as shown in 2.3

Figure 2.3 Functional module diagram
Combined with the above functional module diagram, the system requirements are described as follows:
2.7 Software requirements analysis
1. User login
The system must provide user name and password, role verification function, and open different subsystems according to different roles.
2. Customers order food.
Customers choose different food and quantity according to different service categories (special offer, cold dish, hot dish, soup, wine, beverage). The system calculates the total price according to different food, which is convenient for customers to control the total price. If the input error is entered into the system Provides a delete function. .
3 . Catering Management
Chef configures food in chronological order according to the latest catering information, and submits it to the settlement management subsystem after completion.
4. Settlement management
The system automatically calculates the total price according to the table number. If the membership card system automatically verifies the card number and membership identity, it calculates the corresponding discount and actual payment amount.
5. System Management The system provides functions
for uploading recipe pictures, modifying recipe prices, registering users, deleting users, member registration, member management, browsing customer messages, and customer satisfaction statistics. The functions are clearly designed, and the specific use cases are: as shown in Figure 2.4 for the login use case, as shown in Figure 2.5 for the ordering use case, as shown in Figure 2.6 for the catering use case, as shown in Figure 2.7 for the checkout use case, and as shown in Figure 2.8 for the management use case

Figure 2.4 Login use case

Figure 2.5 Ordering use case

Figure 2.6 Catering use case

Figure 2.7 Settlement use case

Figure 2.8 System Settings Use Case

2.9 Software Interface
Various APIs provided by the Windows operating system [10];
Chapter 3 System Design
3.1 System Deployment Diagram Design
The system deployment diagram refers to the spatial deployment of the physical structure and software structure of the system. /S [11] structure, this structure is based on the structure of client and server, the reason is that the application scenarios of this system are small and medium-sized restaurants and restaurants, and currently the first phase of the project does not provide web services, and it is only used in the internal office of the enterprise. Therefore, it is scientific and reasonable to adopt the C/S structure. The specific structure is shown in Figure 3.1
Figure 3.1 System Deployment Diagram
The server in the above figure is the basis for the operation of the entire system, responsible for data transmission and storage of all clients, using SqlServer2005 server, the network transmission uses WiFi (802.11) technology, the client uses IPAD is displayed as a terminal , but currently a virtual
Win7 system needs to be installed Database login account dining 2: Create the owner user of the database db_dining Dining 3: Configure account mapping: dining-dining 3.2.3 Concept design After analyzing the requirements of the system, it is found that the system has the following entities: as shown in Figure 3.2-3.8 and The relationship between them is shown in Figure 3.9









Figure 3.2 User Entity - Attributes

Figure 3.3 Opinion Entity - Attributes

Figure 3.4 Membership Entity - Attributes

Figure 3.5 Meal list entity-attribute

Figure 3.6 Meal List Detail Entity-Attribute

Figure 3.7 Recipe Entity - Attributes

Figure 3.8 Entity-Relationship Diagram
3.2.4 Physical Design
Physical design is the physical realization of database entities, and the diagrams below correspond to each entity in the conceptual design.
1: T_CAIPU table, as shown in Figure 3.9

Figure 3.9 Recipe Table
2: T_CanMingXi, as shown in Figure 3.10

Figure 3.10 Meal List
3: T_CanDan, as shown in Figure 3.11

Figure 3.11 Meal Table
4: T_Member, as shown in Figure 3.12

Figure 3.12 Member Table
5: T_User, as shown in Figure 3.13

Figure 3.13 User Table
6: T_YiJian, as shown in Figure 3.14

Figure 3.14 Opinion Table
3.2.5 Function Design
1: F_CaiJinEById, as shown in Figure 3.15

Figure 3.15 Calculate Price Function
2: F_CaiMingById, as shown in Figure 3.16

Figure 3.16 Find dish name function
3: F_MemberLeavlByID, as shown in Figure 3.17

Figure 3.17 Member level function
4: F_MemberNameByID, as shown in Figure 3.18

Figure 3.18 Member name function
3.3 System module design
Based on the analysis of system requirements, a total of eight modules are designed, which are the following eight modules [11]. 3.3.1 System login module
In this module, it mainly realizes the verification of user identity and the check of role, and logs in to different subsystems according to different user identities.
3.3.2 System ordering module
This module is the main module of the system. In this module, it mainly implements the functions of ordering dishes and drinks. According to the classification of food, the interface is divided into specials, cold dishes, hot dishes, soups, and drinks. , a different area for drinks and an area for ordering food.
3.3.3 Catering module of the system
This module is mainly aimed at chefs and drink caterers. Its function is to display the order list according to the time order of the meal, and the chef configures different foods and other items according to the detailed list of the menu. After each meal order is completed, the system submits it to the cashier area.
3.3.4 System Cashier Module
This module is mainly aimed at cashiers. Its function is to display the menus after the meals are prepared. Customers provide table numbers and membership cards after meals. The system automatically calculates the discount amount and actual payment amount. The system automatically updates the database after payment is received.
3.3.5 System Management Module
This module is mainly aimed at managers and managers. The functions realized are member management, recipe management, and user management functions. 3.3.4
System Architecture Design
This system adopts the popular C/S structure, which /Server-side structure, the client is an application program based on the .Net FrameWork platform, the server is a database storage application system based on Sql Server 2005, and the object-oriented development language C# [13] is used as the programming language, using Visual studio 2010 As a development tool and a popular software development model—the waterfall model [14]
3.5 Client system directory structure
The client directory structure creates different file directories according to different modules to facilitate file management and future secondary development. The screenshot is shown in 3.19

Figure 3.19 System directory
Directory structure description: 1: DianCan: customer ordering module 2: PeiCan: food catering module 3: JieZhang: cash register and checkout module 4: Manage: system management module 5: Images: system pictures 3.6 System class diagram design according to
the
system Entities in , a total of 6 classes are designed, as shown in Figure 3.20 below for details

Figure 3.20 System class structure diagram The
detailed description is as follows:
1. T_CaiPu recipe class, the attribute and method structure in this class are shown in 3.21

Figure 3.21 The recipe class
T_CaiPu class is used to describe the recipe entity in the system, and its attributes include id (recipe number), c_name (recipe name), c_Price (dish price), c_type (category), c_image (photo), is_Tejia( Is it a special offer), isEnable (whether it is enabled or not)
2. T_User user class, attributes and methods are shown in Figure 3.22

Figure 3.22 User class
T_user class is used to describe the system user entity, and its attributes include id (record number), userName (user name), userPwd (user password), userRole (user role), isEnable (enable or not)
3.T_YiJian (Opinion class): The properties and methods of this class are shown in Figure 3.23

Figure 3.23 Opinion class
T_YiJian is an entity used to describe customer opinions, and its attributes include id (opinion number), HJ_YJ (environmental opinion), FW_YJ (service opinion), FC_YJ (meal opinion), KH_LY (customer message) 4
. T_Member (Member class): The properties and methods of this class are shown in Figure 3.24

Figure 3.24 Membership class
T_Member class is used to describe the entity of customer level, and its attributes include id (member number), member_Name (member name), type_id (membership level number), isEnable (whether enabled) 5. T_CanDan (meal
class ): The properties and methods of this class are shown in Figure 3.25

Figure 3.25 Meal class
T_CanDan is an entity class used to describe customer menus, and its attributes include id (menu number), desk_HM (table number), xf_je (consumption amount), member_id (member number), isJieZhang (checkout or not) ), xf_date (consumption date), state (catering status)
6. T_Can_MingXi (meal list details) class: the attributes and methods of this class are shown in Figure 3.26

Figure 3.26 The menu detail class
T_Can_MingXi is an entity used to describe the menu details, and its attributes include id (record number), can_id (menu number), cai_id (recipe number), cai_SL (number of servings), cai_JE (each type of dish
3.7 Main module design
3.7.1 Login module design The function of the login
module is to verify whether the user name and password are valid, and then judge the role number value if valid (1: Waiter role 2: Chef role 3: Cashier role 4: Administrator role), different windows are opened according to different roles. The preconditions for this module are to set the correct server address and the server is in the startup state. The input and output data are shown in Table 3.27 Data Data Output Type Data Type Constraint
User
Name The input string type consists of 4-10 digits of letters
The password input string type consists of 4-6 digits of numbers

Table 3.27 Input and output data of the login module
The specific implementation code is as follows:
//User name
string un = this.txt_UserName.Text.Trim();
//Password
string pwd = this.txt_UserPwd.Text.Trim();

//Judge whether the username and password are empty
if (address == "" || un == "" || pwd == "")
MessageBox.Show("Username, password, address cannot be empty");
else
{ //Determine whether the user name is a letter and the length is 4–10 digits if (!Regex.IsMatch(un, "[a-zA-Z]{4,10}")) { MessageBox.Show("Not a letter or The length is not enough"); return; } else if (!Regex.IsMatch(un, "[0-9]{4,6}")) { MessageBox.Show("Please enter a number with 4-6 digits"); return ; } dc = Program.GetDc(address); // returns the latest update in the database // dc = Program.ChangeDc(dc.T_user); IQueryable<T_user> t_user = dc.T_user.Where (u => u.userName == un && u.userPwd == pwd); if (t_user!=null&&t_user.Count()==1) { this.Hide();



















if (t_user.First().userRole == 1)
{//Open the order window
MainMenu mm = new MainMenu();
mm.Show();
}
else if (t_user.First().userRole == 4)
{ //Open manager Manage.FrmManage frmManage = new Manage.FrmManage(); frmManage.Show(); } else if (t_user.First().userRole == 2) { //Open chef window PeiCan.FrmZuoCai frmZuoCai = new PeiCan.FrmZuoCai(); frmZuoCai.Show(); } else if (t_user.First().userRole ==3) { //Open settlement window Jiezhang.FrmJieZhang frm_JieZhang = new Jiezhang.FrmJieZhang(); frm_JieZhang.Show() ; } } else MessageBox.Show("login failed");



















3.7.2 Ordering module design
The ordering module is an important module in the system. It mainly realizes the creation of customer menus and the storage of ordered dishes. The realization idea of ​​this module is to first systematically display today's specials, cold dishes, hot dishes, and soups by classification Classes, drinks, beverages, guests register tables according to their needs, select dishes and points (default 1), the system automatically calculates the total amount, if there is a wrong guest, you can delete a certain type of dish, and finally click submit to save it to the database. Then the prerequisite for the implementation of this module is that the user logs in to the system as a waiter, and there are corresponding dish information and a certain number of tables in the database. The input and output data of this module are shown in Table 3.28.
Data data output type data type constraints dish
name output string type length less than 50
price output string type length less than 50
picture output binary type
table number input string type length less than 50
dish name Number input number Number of servings input
number
Table 3.28 Input and output data of ordering module Concrete
implementation code:
///
/// System display menu
///
///
///
private void MainMenu_Load(object sender, EventArgs e)
{ dc = Program.dc; cur_z = new Cursor("images/icons/z.cur"); cur_y = new Cursor("images/icons/you1.cur"); tj_list = new List();




lc_list = new List();
rc_list = new List();
t_list = new List();
js_list = new List();
yl_list = new List();
LoadImage(-1, true);
//Display special price by default
if( tj_list.Count!=0)
this.panelEx4.Style.BackgroundImage = tj_list[tj_index];
//Load the table number
LoadDesk();
}
///
/// Modify the recipe
///
///
///
private void dgv_CanMingXi_CellContentClick(object sender, DataGridViewCellEventArgs e)
{ if (dgv_CanMingXi.Columns[e.ColumnIndex].Name == “del”) { //Get recipe ID cai_id = this.dgv_CanMingXi.Rows[e.RowIndex].Cells[“caiid "].Value.ToString();




var mx = canDan.T_Can_MingXi.ElementAt(e.RowIndex);
canDan.xf_je -= mx.cai_JE;
canDan.T_Can_MingXi.RemoveAt(e.RowIndex);
//Rebind control
this.lbl_HJ.Text = "total:" + canDan.xf_je + "Yuan";
BindingList<T_Can_MingXi> canList = new BindingList<T_Can_MingXi>(canDan.T_Can_MingXi.ToList());
this.dgv_CanMingXi.DataSource = canList;
}
}

Chapter 4 System Implementation
4.1 System Coding Specification
The system coding implementation adopts the currently popular object-oriented programming language—C#, so for future system expansion and test maintenance, it follows the C# coding specification uniformly released by Microsoft. The specific content is as follows: 4.1
. 1 Type naming
1. Class names, classes declared with Class must be named with nouns or noun phrases to reflect the role of the class. Such as: Class Indicator When the class is an attribute (Attribute), end with Attribute, when the class is an exception (Exception), end with Exception: Class ColorSetException Class CauseExceptionAttribute When the class only needs to have one object instance (global object, such as Application etc.), must end with Class, such as Class ScreenClass Class SystemClass. When the class is only used as the base class of other classes, according to the situation, end with Base: MustInherit Class IndicatorBase, if the defined class is a form, then the suffix Form must be added after the name, and if it is a Web form, the suffix must be added Page: Class PrintForm : Inherits Form '* Windows Forms Class StartPage : Inherits Page '* Web Forms
2. Enumerations and structures: must also be named after nouns or noun phrases. It is best to reflect the characteristics of enumeration or structure, such as: Enum ColorButtons 'ends with a plural number, indicating that this is an enumeration Structure CustomerInfoRecord 'ends with Record, indicating that this is a structure
3. Delegation type: Common delegation types are named after the noun describing the action to reflect the function of the delegation type instance: Delegate Sub DataSeeker (ByVal SeekString As String), the delegation type used for event processing must end with EventHandler, such as: Delegate Sub DataChangedEventHandler (ByVal Sender As Object, ByVal e As DataChangedEventArgs)
4. Interface: Unlike other types, interfaces must be prefixed with I and named with adjectives to highlight what capabilities the class implementing the interface will have: Interface ISortable 5.
Module : A module is not a type. Its name must be named after a noun, and the suffix Module:Module SharedFunctionsModule must be added. The common feature of all the above rules is that each word that makes up the name must start with an uppercase, and completely uppercase or lowercase names are prohibited .
4.1.2 Naming methods and attributes
1. Method: Whether it is a function or a subroutine, the method must be named after a verb or a verb phrase. There is no need to distinguish between functions and subroutines, and there is no need to specify a return type. Sub Open(ByVal CommandString As String), Function SetCopyNumber(ByVal CopyNumber As Integer), the parameter needs to indicate ByVal or ByRef, which will make the program longer, but it is very necessary. If there are no special circumstances, ByVal is used. For the naming method of parameters, refer to the following "Variable Naming Method". For methods that need to be overloaded, Overloads is generally not written, and overloaded methods are written as needed.
2. Attributes: In principle, fields (Field) cannot be made public. To access the value of a field, attributes are generally used. Properties are named with concise and clear nouns: Property Concentration As Single, Property Customer As CustomerTypes
3. Events: Events are special properties that can only be used in the context of event processing. The principle of naming is generally a verb or a participle of a verb, and the tense indicates the time when the event occurs: Event Click As ClickEventHandler, Event ColorChanged As ColorChangedEventHangler 4.1.3
Variables and constants Constants
are named after nouns that indicate the meaning of the constant, and generally do not distinguish the type of constant : Const DefaultConcentration As Single = 0.01, in the code with strict requirements, the constant starts with c_, such as c_DefaultConcentration, but it is best not to use it, it will cause difficulty in typing. Variables of ordinary types can be named with meaningful names, and abbreviations and meaningless names such as A, x1, etc. are not allowed. Good examples are given below: Dim Index
As Integer
Dim NextMonthExpenditure As Decimal
Dim CustomerName As String
Cannot If the name is too long, it should be as concise as possible, as in the following example:
Dim VariableUsedToStoreSystemInformation As String '* wrong, too complicated
Dim SystemInformation As String '* correct, simple and clear
Dim sysInfo As String '* wrong, too simple
In special cases, a variable with one letter can be considered:
Dim g As Graphic
For controls, the type of control should be specified by directly adding the class name after the variable:
Friend WithEvents NextPageButton As Button '* button
Friend WithEvents ColorChoicerPanel As Panel '* panel
Friend WithEvents CardFileOpenDialog As FileOpenDialog '* File Open Dialog
Wait, there is no need to specify the prefix of a variable of a certain type, just write the type in the back. Try to compare the following code:
btnCancel.Text = "&Cancel"
CancelButton.Text = " &Cancel"
Obviously the latter can make the reader understand that the type of the variable is a button.
4.1.4 Labels
Labels are code identifications used for Goto jumps. Since Goto is not recommended, the use of labels is relatively strict. Labels must be all uppercase, and the spaces in the middle should be replaced by underscores _, and should start with _, for example: _A_LABEL_EXAMPLE: Labels are defined in this way to fully distinguish them from other code elements.
4.1.5 Namespace
Usually, a project uses a namespace, which usually does not need to use the Namespace statement, but is specified in the "Root Namespace" of the project option. Using the root namespace can make the code more tidy and easy to modify. This is VB full of advantages. The syntax of the name space is: company name. product name [. plural of component name]
such as: Namespace Ninputer.VirtualScreen
Namespace Ninputer.CardEditor.CustomeControls
It is definitely not a good idea to randomly name a namespace, and the above regulations must be followed.
4.1.6 Comments There
are many rules for comments, and here is just one of them: normal comments start with ', separate' is only used to comment temporarily unused code
'
This is a common comment
'* This code is added after debugging is correct
'If UseHighSpeed(g) = True Then ...
This makes it easy to use code commenting tools to control the use of code.
4.2 Module function realization
4.2.1 Login module realizes
the login function. According to the user name and password input by the user, it is compared with the information in the database. If the verification is successful, it will enter different subsystems according to the role. The system role is based on the position. Divided into four fixed roles of waiter, chef, cashier, and manager, each role has different permissions and functions. Screenshots of system implementation are shown in 4.1 and 4.2

Figure 4.1 Username and password is empty verification screenshot

Figure 4.2 Screenshot of verification password digits
4.2.2 Main codes of the ordering module
The idea of ​​the ordering module code is that first, the customer browses the menu and selects different foods, and the system first puts the food into the shopping cart, and the customer can put it into the shopping cart The food in the cart is deleted, and the same type of food cannot be ordered repeatedly. The system automatically calculates the total price of the food in the shopping cart, and submits it to the database after confirmation. The screenshots of the system are shown in 4.3-4.6

Figure 4.3 Query vacant tables

Figure 4.4 screenshot of hot dishes

Figure 4.5 Drink Screenshot

Figure 4.6 menu screenshot
4.2.3 cashier module code implementation
The idea of ​​cashier module implementation is to automatically calculate the discount amount and actual payment amount according to the membership number system. The specific code is as follows.
double yh=0;
//Get membership number
mid = this.txt_Member_id.Text.Trim();
if (xf_je == null || xf_je == "")
{ MessageBox.Show("Please select a menu"); } else if ( mid== "") { MessageBox.Show("Please enter the member number"); } else { //Verify member information if (dc.T_Member.Count(m => m.id.ToString() == mid) == 0) { MessageBox.Show("No such member"); } else { //Display member information this.lbl_Member_Info.Text = "Member Information:" + dc.F_MemberNameByID(Convert.ToInt32(mid)) + ":" + dc.F_MemberLeavlNameByID(Convert.ToInt32(mid)) +

















"–" + dc.F_MemberLeavlByID(Convert.ToInt32(mid)) + "Level";
//Calculate discount
yh= Convert.ToInt32(xf_je) * (10 - dc.F_MemberLeavlByID(Convert.ToInt32(mid)).Value) * 0.1d;
this.txt_YH.Text = String.Format(“{0:C2}”,yh);
//Calculate actual payment amount
this.txt_SF.Text = String.Format(“{0:C2}”, Convert .ToDouble(xf_je) - yh);
isMember = true;//is a member
}
}
The screenshot of system implementation is shown in 4.7

Figure 4.7 Customer Checkout Screenshot
4.2.4 Catering Module Code Realization
The idea of ​​catering module function realization is mainly to display the latest menu and the detailed content of the menu. And update the latest menu in time.
4.2.5. Realization of system management module
The system management module mainly realizes the functions of adding, editing, deleting and querying recipes, users, tables, messages and members, as shown in Figure 4.8-4.10

Figure 4.8 Screenshot of system management

Figure 4.9 Edit recipe screenshot

Figure 4.10 Screenshot of table management

Chapter 5 System Test
5.1 Test purpose
To find as many defects in the system as possible through scientific methods, mainly to test whether the system function is in line with the functional requirements stipulated in the requirements specification and lung functional requirements, whether the system function is realized, and whether the system captures Abnormal data and output data correctly.
5.2 Test method
This test case design mainly adopts the method of black box test [15], and the specific methods used in functional module and integration test include equivalence class division [16], boundary value division, orthogonal decomposition, causal diagram analysis and error guessing 【17】. Regression testing [18] is used in system testing according to business processes.
5.3 Test environment
1. Server address: 172.16.1.4
2. Operating system: Windows VISTA
3. CPU: Intel® Pentium®4 CPU 3.00HZ
4. Available hard disk space: 160GB
5. Database: Microsoft SQL Server 2005
6. Test object: FengShaDuMIS.exe

5.4 Test results
After a lot of black box tests, the system meets the design requirements in terms of function and performance. The following is a screenshot of the system after the test.
1. The test situation of the login module is shown in Figure 5.1

Figure 5.1 Screenshot of login test
2. The situation of ordering module is shown in Figure 5.2 and 5.3

Figure 5.2 Screenshot of the main interface for ordering meals

Figure 5.3 Screenshot of the order test
3. The test situation of the catering module is shown in Figure 5.4

Figure 5.4 The screenshot of the chef's catering test
4. The cashier module test is shown in Figure 5.5

Figure 5.5 Screenshot of Cashier Module Test
5. System Management Module Test Figure 5.6-5.8

Figure 5.6 Recipe management test chart

Figure 5.7 Membership Management Test Diagram

Figure 5.8 User Management Test Screenshot
6. Message Management Test Figure 5.9—5.10

Figure 5.9 Screenshot of customer message test

Figure 5.10 screenshot of message statistics

Conclusion
This article starts from the principle of the waterfall model development process, and on the basis of analyzing the workflow of the catering system, discusses and establishes the workflow model of the restaurant ordering system, which is realized by C#4.0+DotNet Bar7.0+Ling+Sql Server 2005 The restaurant ordering information management system is developed, and the unit test and integration test of the system using the black box test principle show that. The system realizes: (1) customer ordering (2) chef catering (3) cashier management (4) system settings. The problem of this system is mainly manifested in the timely update of recipes. If the manager adjusts the price of the recipes in time during the business period, the customers will encounter the situation that the prices are not updated in time when ordering. Not humanized enough, such as not supporting bank card settlement, these problems are the direction of improvement of this system in the future.

Literature
[1] Gan Huarong, Catering Management and Practice, Beijing, University of International Business and Economics Press, 2009, pp. 109-120 [2]
Miao Fengjun, LAN Technology and Networking Engineering, Beijing, Tsinghua University Press, 2010 , 150-151 pages
[3] Li Dajun, POS system application, Beijing, Tsinghua University Press, 2004, 10-13 pages [
4] Wu Renjie, Web programming, Beijing, China Railway Press, 2009, 5 -6 pages
[5] Xu Shiliang, Ge Bing, Basics of Computer Software Technology, Beijing, Tsinghua University Press, 2010, pp. 25-31 [6]
Peng Aihua, Liu Hui, Wang Shenglin, Windows 7 Detailed Explanation, Beijing, Published by People’s Posts and Telecommunications Press, 2010, pp. 2-3
[7] Qian Shao, Li Huijian, Li Jizhe, C# WinForm Practical Development Course, Beijing, Water Conservancy and Hydropower Press, 2010, pp. 15-18 [8]
Jiang Hanyang, Li Yuejun, Pang Ya Juan, SQL Server 2005 Database Management and Development Tutorial, Beijing, People's Posts and Telecommunications Press, pp. 1-8 [
9] Grady Booch, Ivar Jacobson, James, Rumbaugh, The Unified Modeling Language User Guide [M]. Addison-Wesley, 1998 156
[10] Petzold, Windows Programming, Beijing, Tsinghua University Press, 2010, 245-256
[11] Bertand Meyer, Object Oriented Software Construction [M]. Prentice Hall, 1998, 5 pages
[12] Jim Arlow, Ila Neustadt, UML and the Unified Process: Practical Object-Oriented Analysis and Design [M]. Addison Wesley, 2002, page 95 [13] Wang Xiaoke, Lu Shuang, C# from entry to mastery, Beijing
, Tsinghua University Press, 2008, pp. 3-4
[14] Lu Huien, Software Engineering, Beijing, People's Posts and Telecommunications Press, 2007, pp. 9-10
[15] Sun Yong, Modern Software Engineering, Beijing, Beijing Hope Electronic Publishing Society, 2002, pp. 111
[16] Deng Liangsong, Liu Haiyan, Lu Lina, Software Engineering, Xi'an, Xidian University Press, 2004, pp. 56-57 [17] Zhou Su, Wang Wen
, Software Engineering Course, Beijing, Science Press, 2002, pages 74-75
[18] Wang Shaofeng, Object-Oriented Technology UML Course, Beijing, Tsinghua University Press, 2004, pages 23-50

Acknowledgments
Time flies, and in the blink of an eye, the professional class has ended. In general, the project has experienced a lot from topic selection to final completion. I have benefited a lot from it, achieved some achievements and also discovered my own shortcomings.
1. It is more important to choose a familiar development language and technology than blindly seeking new ideas. When receiving a project topic, the development language that immediately comes to mind is Microsoft's object-oriented C# language, although Java is also a new generation of object-oriented development Language, but there are certain deficiencies in UI design and efficiency. Therefore, the application range of Lenovo’s restaurant ordering system is limited to the unit’s LAN, so I finally chose the C# development language. The project was successfully completed, thanks The efficiency of the .NET development platform.
2. Creating a system model is an effective means to strengthen teamwork and communication and improve system development efficiency. When I first received the system development task, I didn't know where to start, and I didn't know what to do. Even if I downloaded some software from the Internet, I didn't know how to do it. Later, after reading "Object-Oriented Technology and UML", after analyzing and Research, combined with the respective characteristics of waterfall model, iterative increment, and spiral model, I think creating a software model is the most direct, easiest to understand, and easiest to operate a software development method, because this method is based on different requirements. I understand that it is the easiest and most effective way to communicate with developers and customers when you are not familiar with business rules. Facts have also proved the correctness of this method. The restaurant ordering system took less than two weeks 1.0 version is complete.
3. The daily summary is an important means to find problems and control progress. Although a detailed development plan has been formulated, unexpected things will also be encountered during the implementation process, such as leave, technical obstacles, etc., through the daily By summarizing, we can find the crux of the problem. If it is a problem of understanding, we should improve our understanding. If it is a problem of technology, we should consult the teacher or check information on the Internet in time. The completion is inseparable from careful planning and timely adjustment of progress.
4. New technology is not necessarily the best, mature and stable technology is the first choice. Before determining the framework, I also searched for many related technologies on the Internet. Most ORM frameworks require configuration files and installation of new components. These new technologies certainly have their advantages, but they are a new challenge for me after all. At the beginning, I also tried to learn new technologies, and tried to apply new technologies in the project. Later, I found that the learning time was longer, and it was difficult to digest and absorb and reach the level of proficiency. After weighing the choice, I chose Microsoft development tools. The ORM tool Ling to Sql with it has greatly improved the coding efficiency after testing.
Although through this project, my experience has been enriched, and my personal programming ability and communication ability have improved to a certain extent, but I also feel many shortcomings in myself. The main reasons are (1) Lack of project development experience in the corresponding industry, so demand extraction is incomplete and business logic is inaccurate, and more project development experience will be accumulated in the future. (2) Lack of necessary management experience and effective means of communication. In the early stage of project development, due to lack of understanding, the project was procrastinated. Later, I strengthened self-discipline and communicated and contacted students in a timely manner. The progress was gradually improved, and finally completed up the project. (3) Interface art is the most important work in the project development process. Because I lack the necessary artistic cells and aesthetics from a science and engineering background, the color matching and layout of the interface cannot reach the professional level, so until now the total I feel that the interface design is not satisfactory, so in the future project development process, it is best to invite some professional artists to design, which should be the best choice.
Finally, I sincerely thank Mr. Sun Feixian for his great help, especially when encountering technical problems, Mr. Sun will help me patiently no matter when, knowing that I have completed the project and the design of the graduation thesis, I would like to express my heartfelt thanks to Mr. Sun The teacher said "Teacher, you have worked hard".

Guess you like

Origin blog.csdn.net/ambiguous__/article/details/130798205