Online Ordering System Project Proposal, which could help to increase the understanding for the online system. This paper aim to share knowledge.Full description
online papFull description
Online Food Ordering SystemFull description
This project Online Food Ordering System has been developed on PHP and MySQL. The main objective for developing this project was to sell food online order. This project Intends different types of f...
Online Food Ordering SystemFull description
Online Ordering System Project Proposal, which could help to increase the understanding for the online system. This paper aim to share knowledge.Full description
Online Food Ordering System
php mysqlFull description
Online Food Ordering System
This project Online Food Ordering System has been developed on PHP and MySQL. The main objective for developing this project was to sell food online order. This project Intends different types of f...
online food ordering system
Descripción: This project Online Food Ordering System has been developed on Java, JSP and MySQL. The main purpose for developing this project is to sell food online order. This project Intends different types o...
Full description
complete project
online quiz thru j2ee
The objective of RTS Project is to design software to fully automate the process of issuing a railway ticket.Full description
The Project Online Grocery Ordering System has been developed on Java, JSP and MySQL. The main aim for developing this project where customer can purchase and order groceries online. The system is ...
This project Online Food Ordering System has been developed on Java, JSP and MySQL. The main purpose for developing this project is to sell food online order. This project Intends different types o...
The main objective of the Online Food Ordering System is to manage the details of Item Category,Food,Delivery Address,Order,Shopping Cart. It manages all the information about Item Category, Custom...
The main objective of the Online Food Ordering System is to manage the details of Item Category,Food,Delivery Address,Order,Shopping Cart. It manages all the information about Item Category, Custom...
REST A UR A NT M M A N A GEMENT SYSTEM By
WONG XIAO YEN
SCHOOL OF ARTS AND SCIENCE TUNKU ABDUL RAHMAN COLLEGE KUALA LUMPUR ACADEMIC YEAR 20010/2011
Project Title
Restaur ant M Management S System By WONG XIAO YEN
Supervisor: CHIN CHAI LIM
A project report submitted to the School of Arts and Science in partial in partial fulfillment fulfillment of the requirement requirement for the Bachelor of Science, Campbell University, U.S.A, And Advanced Diploma in Science.
Division of Computer Science School of Arts and Science Tunku Abdul Rahman College Kuala Lumpur
20010/2011
Final Year Project
ii
Project Title
Restaur ant M Management S System By WONG XIAO YEN
Supervisor: CHIN CHAI LIM
A project report submitted to the School of Arts and Science in partial in partial fulfillment fulfillment of the requirement requirement for the Bachelor of Science, Campbell University, U.S.A, And Advanced Diploma in Science.
Division of Computer Science School of Arts and Science Tunku Abdul Rahman College Kuala Lumpur
20010/2011
Final Year Project
ii
Restaurant Management System
Declaration
Dec l ar at i o n The project submitted herewith is a result of my own efforts in totality and in every aspects of the project works. All information that has been been obtained from other sources had been fully acknowledged. I understand that any plagiarism, cheating cheating or collusion or any sorts constitutes a breach of College rules and regulations and would be subjected to disciplinary actions.
__________________________ __________________________ Student’s Name: Wong Xiao Yen Programme : Advances Diploma in Business Information System Year 2
Final Year Project
iii
Restaurant Management System
Abstract
A b s t r ac t The main purpose of carrying this project is partial fulfilment of the Bachelor of Science Degree (Campbell University, U.S.A.) and Advanced Diploma in Business Information System. This project is required to submitted as a Final Year project in order to graduate. This project is about “Restaurant Management System”. This is frond-end system. The front-end system is used by customer and staff. Customer and staff can be login to update their personal information through this web site. They also are able to make order for take away and delivery. Besides that, member also is able to make reserve table and meal on specific date and time. Furthermore, they can make the payment online without needed to travel to counter to make payment. This system also allow administrator to manage table, staff, member, reservation, delivery order
and
delivery to customer. This scope of the project covers Maintenances modules, Payment modules, Platform Design modules, Meal order modules, Reservation modules, and Report modules. The project of methodology is used UML (Unified Model Language) to design the System such as use case diagram, sequence diagram and activity diagram.
The
system flow and the actor are being drawn to understand how the system works does and who the actors that interact with the system are. Besides that, Visual Studio 2010, MySQL, C # and asp.net programming language, Adobe Flash, Microsoft Office that are used as development phases of the project. Besides that, there are various phase of development used when develop this project. We have gone through the every stage of the software life cycle, such as system planning, requirements, analysis, design and implementation. In developing in this web application, team work and communication was important for a project team to complete the whole system. Brainstorming with team member may get better idea and improvement for the system.
Final Year Project
iv
Restaurant Management System
Acknowledgement
A c k n o w l ed g em en t I would like to express my sincere gratitude to project supervisor, Ms. Chin Chai Lim, for her guidance, constant support and encouragement throughout the completion of this final year project. I would also like to convey my appreciation to Ms. Chin to her advice, knowledge and time to guide me throughout this final year project. Without the help and guidance from Ms. Chin Chai Lim, I would not able to complete this project successfully. A warm thank is extended to Tan Yoke Yen for sharing her resources, opinions, knowledge, experience and skills in programming and development methodology, so generously. I would also like to personally thank my family, friends in TAR College and my fellow course-mates who have one way or another extended their assistance in completing this project. Last, but not least, I wishes to acknowledge the unwavering support shown by Ms Chin, and my project moderator, Ms Chan K wai Mui.
Final Year Project
vi
Restaurant Management System
Table of Contents
Tab l e o o f C Co n t en t s Declaration.............................................................................................................................. iii Abstract....................................................................................................................................iv Acknowledgement ...................................................................................................................vi 1.
Introduction ......................................... ............................................ .................................. 131 Validation and Verification .............................................................................................. 131 Test Plan ........................................................................................................................... 136
User Guide .....................................................................................................................148
Final Year Project
viii
Restaurant Management System
Chapter 1 : System Planning
Chapter 1
System Planning
Final Year Project
1
Restaurant Management System
1.
Chapter 1 : System Planning
Sy s t em P P l an n i n g 1.1
Introduction
This chapter will discuss about the aims and objectives of this project. Then it will followed by a brief description of the company background and the organization chart of the restaurant. Furthermore, this chapter also includes the project scope that will be carried out with the description of each module. Lastly, the project schedules with a Gantt chart are shown.
1.2
Project Aims and Objectiv es
The main purpose of this project is to provide an ease and convenience online order meal and make table and meal reservation to the member. Firstly, the system can be benefit to customer. The system allow customer to make meal delivery, take away and reservation using computers by viewing the available table on specific date and time without spent traveling cost going to the restaurant and spent a lot of time and for the waiting time of meal order or the reservation. Besides that, the project objective is to provide convenient, tangible and intangible benefits to organisation. Tangible Benefits to Organisation The system can be help organisation by achieving quicker processing and turnaround of document or transaction. For example, in current system, they may use calculator to total up items of food order, it is need some time to make calculation, in contrast, and the system will do it automatically. The system can help restaurant in capturing stock availability management, so eliminate staff’s job to keep record of the stock availability. And then the systems able to analysis how much the stock of raw material are spoil and fresh. The spoil raw material of food will be as capturing lost on money management. So the decision maker can make decision to adjust when to restock of raw material, reduce money lost potential.
Final Year Project
2
Restaurant Management System
Chapter 1 : System Planning
Intangible Benefits to Organisation The restaurant is using off line system, if a customer want to make reservation after they work from their company, the restaurant may close, so the customer cannot contact to restaurant and may change another restaurant. In this case, the restaurant lost a lot of customer, because inconvenient to them. So in this new system development could provide 24 hours and Seven day per week services, customer can make reservation anytime and anywhere. Since the service become well, it could increase customer satisfaction, improve restaurant reputation and reduce error happen. For example, the staffs make a wrong record of customer address accidently, so wrong delivery foods to customer.
Final Year Project
3
Restaurant Management System
1.3
Chapter 1 : System Planning
Company Background
Nature of business : The TwinsYen’s Restaurant, at No 13, jalan 2/28 Wangsa Maju, Kuala Lumpur, Malaysia , was opened in 2008. The restaurant is opened by two sisters. In this few years, they have a good business because they were supported by college student and those stay in Wangsa Maju. Today, the restaurant has expanded the business and increase the staff until 50 employees, they are Financial Manager, Purchasing and Quality Assurance Manager, Operation Manager, Training Manager, Marketing Manager, Front End Director, Kitchen Manager, Shipment Manager, one receptionist, one bar tender, ten waitress, one head of cook, three assistant cook, and the others under different manager. Products and services: TwinsYen’s restaurant of main customers is Malaysian. In Malaysia, people like different kind of food, such as Western’s foods, Chinese’s foods, Malay’s foods, Thailand’s Foods, Italian foods and healthier food. In better words to say, the restaurant provides services and products are focusing on different level and different kind of consumer. Meals are generally served and eaten on premises, but also offer take-out and food delivery services. In the morning, TwinsYen’s restaurant prepares variety flavour breakfast and coffee or tea to the rushing business man and student. After 12.00 pm, the restaurant will prepare service and foods delight. In additional, the stage, stage lights, and dressing rooms are complete for customer having some events, or sing song on the stage. the restaurant help customer to hold a special events, such as free birthday cake and sing a birthday song, farewell party, and others celebration services with limited person. In a special day, the restaurant may promote season menu or specialty item to its menu. Business environment: The restaurant is double level premise. Inside the restaurant, at the first level include a bar for bar tender and receptionist use, one kitchen, and 20 different size of set of tables. At the second level of restaurant, has a balcony which was decorated with plants, you also can view outside from balcony, if see far a bit, Twin-tower building is over there, and the place 25 unit of difference size of set of tables. Outside of restaurant has well-lit parking will be available. The front and back of restaurant’s premise are others restaurant and other business operation. Walking 20 minutes will
Final Year Project
4
Restaurant Management System
Chapter 1 : System Planning
reach TwinsYen’s restaurant from LRT station. No market nearest. But have many company and one TARC and UTAR college nearest to restaurant. Size of operation 50 employees, they are
Financial Manager, Purchasing and Quality Assurance
Manager, Operation Manager, Training Manager, Marketing Manager, Front End Director, Kitchen Manager, Shipment Manager, one receptionist, one bar tender, ten waitress, one head of cook, three assistant cook, and the others under different manager.
Vision TwinsYen’s Restaurant aims to the best of restaurant in Kuala Lumpur, especially to serve people who are busy.
Final Year Project
5
Restaurant Management System
Chapter 1 : System Planning
Organisation structure :
Figure 1.1 : Organization Chart for TwinsYen’s Restaurant Management System
Current System Used TwinsYen’s Restaurant currently is using the traditional system and fully offline system. Customer needed go to restaurant to make table reservation or phone call to the restaurant make meal order, delivery and table reservation.
Besides that, administrator still using
manual system such as using cashier machine to print the payment, has a staff book to record staff information, record delivery information on paper, checking table reservation and customer take order by ticking a small piece of paper. After ticking the order, the waitress will ensure one more time again to customer, and then will pass one copy to receptionist and another one will pass to kitchen. If the customer wants to order food for delivery, they must go through the process to provide personal information every time.
Final Year Project
6
Restaurant Management System
1.4
Chapter 1 : System Planning
Project Scope
Restaurant Management System
Restaurant Management System
Online Ordering Subs stem
Online Table Reservation Subs stem
SMS Customer
Online Payment Subsystem Platform Party Design Subsystem
Maintenance Subsystem
Online Customer
Order Detail
Feedback /Survey
Subsystem
Subsystem
Redeem free gift Subsystem
Report Subsystem
1.4.1 Maintain Module This module is used for administrator to maintain the data such as to add, update or delete the working staff information, menu information, price of item, member information, table information and description of food.
1.4.2 Onlin e Table Reservatio n Module This module is for member reserve table and meal on specific date and time through online.
1.4.3 Online Payment Module This module use for calculate the total expenses in restaurant. The payment calculation will base on customer order meal with delivery, take away or reservation. The payment calculation will be included government tax and service charge only if customer makes order meal with take away and reservation, however, the RM 5 of transport fees also included if customer make order with delivery. Payment Method, it has two types, if the payment is pay by credit card then the payment will need
Final Year Project
7
Restaurant Management System
Chapter 1 : System Planning
customer pay deposit with 70 % of total amount of charge. If customer pay by cash, the customer is not required to pay deposit first, unless meet the restaurant staff.
1.4.4 Report Module This module is help manager to generate report such as sale report, feedback report, reservation reports, and delivery report. All reports are useful for different level of organization.
1.4.5 Online Orderin g Modu le This module can be access by staff and customer. Staffs access it for walk in customer to order food or cancel food had been ordered. Customer can register as member then direct make order process step by step through the internet. User can use search function which is included in this module for easy to find their favorite items.
1.4.6 SMS Customer Order Detail Module This module is used by staff to send message to inform customer. The staff sends the order information and time to take the meal ordered after the customer makes order.
1.4.7 Platform Party Desig n Modu le This module is allowing customer to design their party after make reservation.
1.4.8 Online Feedback Module This module is used for that customer to evaluate restaurant performance, such as food and drinks, customer service and staff behavior. The purpose is help restaurant’s organization to improve product and service that base on customer preference.
1.4.9 Redeem Free Grift Module This module is used for that customer to use their point to exchange the gift of restaurant provided.
Final Year Project
8
Restaurant Management System
1.5
Chapter 1 : System Planning
Proj ect Team Module 1
2
Responsible by
i.
Platform Design Online Payment
ii.
Table Reservation
i.
SMS Integration
ii.
Google map
Wong Xiao Yen
Tan Yoke Yen
iii. Delivery iv. Redemption v. Online Customer vi. Feedback vii. Online Ordering 3
Maintenance: i . Customer, Staff, Table
Wong Xiao Yen
ii . Meal , Meal Category
Tan Yoke Yen
9. Report : i.
Final Year Project
Annual Sale Report
Wong Xiao Yen
ii. Daily Member Payment Report
Wong Xiao Yen
iii. Daily Reservation Report
Wong Xiao Yen
iv. Monthly Sales Report
Tan Yoke Yen
v. Top 5 Monthly Report
Tan Yoke Yen
vi. Feedback Report
Tan Yoke Yen
vii. Rating Report
Tan Yoke Yen
9
Restaurant Management System
1.6
Chapter 1 : System Planning
Project Schedule
Final Year Project
10
Restaurant Management System
1.7
Chapter 1 : System Planning
Outlin e of appro ach/Methodology Used
For this project, I use two tier approaches (c #, asp.net ) to apply in the system development.. The two tier design means that client program (interfaces) as first tier and database server as second tier. The first tier is client program accesses database directly, however second tier is used when client program executes application logic (run SQL program with database).
This approach is used because it is a simple structure, easy to setup and do maintenance and it consumes lesser time to develop the system.
Besides that,
advantage of this approach is business logic and database is physically close, which provides higher performance. Mean that the coding run on client side, it will be more faster response to user. As the result, I apply two tier approaches for this project.
1.8
Chapter Summary
In this chapter, we had face some problems in project scope, defining module of the system, what module that we need to include and what function and features need to include in each module. We use the internet search engine, which is Google search to research the information which is related to our project as our references such as Domino web site and Mc Donald web site, TVG (cinema) website, based on those references, we can decide the main module and function in each module. Besides that, in project schedule planning, we need to estimate the date that we need to done our task, but the actual date for the task may have different to planning date, some tasks may be done earlier than the planning date and some tasks are over the due date. Base on the problem of project schedule, we need to have a proper distribution and arrangement of the task to each project member for ensuring the task can complete on time. We had a meeting in each week to ensure the progress of members and brainstorming the problems that we faced.
Final Year Project
11
Restaurant Management System
Chapter 2 : Requirement Analysis
Chapter 2
Requirements Analysis
Final Year Project
12
Restaurant Management System
2.
Chapter 2 : Requirement Analysis
Req u i r em en ts A n al y s i s 2.1
Introduction
This chapter will include requirement analysis to the project. Requirement analysis is the process of understanding the customer requirement and expectation from a proposed system or application. It was including functional requirements, design requirements and performance requirements.
2.2
Fact Gatherin g
2.2.1 Research When I started to develop this project, I had done some online research for restaurant website in Malaysia. I used Google search engine to search the category of website. I found that, the entire restaurant website does not provide table reservation, meal reservation and platform party design service. So I decided to do this system in my final year project. The system is providing online meal order for delivery, take away and reservation, so it make easy as possible to customer select more preference service of restaurant. 2.2.2 Interview Interview is one of fact-finding method to gather information during the system analysis phases to develop a system. I have contact my friend who as receptionist in a Vietnam restaurant, she has experience using restaurant system, so she can provide more details about the websites needs and knowledge to improve our website. The following information is the interview question that had been asked. 1.
What is the nature of business of your restaurant?
2. What do you think the services that provided by using current system? Are you satisfying your current system function? If no, what are the current system problems? 3. What are the functions or services needs for the new system? 4. After implement Restaurant Management System, do you think that it will bring profit to your restaurant?
Final Year Project
13
Restaurant Management System
2.3
Chapter 2 : Requirement Analysis
Fact Recordin g
In the system, user can view the webpage and get restaurant’s product and service information. Customer must register as a member, and then the customer only can make meal order, make table reservation, design platform party and provide feedback. After submit meal order details, the system will calculate the payment and staff will send message to user. The purpose of message is used to inform customer when the meal will be delivered or the meal will be done of cook. If customers submit table reservation with reserve meal together, the system will calculate the payment and allow customer design the platform party.
2.4
Developm ent Enviro nment Programming
C#.Net, Asp.net
languages Databases
MySQL express
Development tools
Microsoft Expression Studio 3, Project vision 2007
Hardware
Printer x 1 unit , Laptop x 1 unit
Software
Visual Studio 2010,
Microsoft Office 2007,
Microsoft Office Project 2007,
Microsoft Office
Visio, Adobe Flash Operating System
2.5
Microsoft Window XP or Microsoft Window 7
Operatio n Enviro nment Hardware
Recipe Printer , LCD Monitor Mobile device , Hand free, Printer
Software
Flash, Internet Explorer, Window XP
DBMS
MySQL express
Final Year Project
14
Restaurant Management System
2.6
Chapter 2 : Requirement Analysis
System Arc hit ecture
Final Year Project
15
Restaurant Management System
2.7
Chapter 2 : Requirement Analysis
Functi onal Requi rement
Maintenance
Maintenance Subsystem
Meal Maintenance Module
Customer Maintenance Module
Staff Maintenance Module
Table Maintenance Module
Login and Validation
Login in staff and members module, member login at front-end to consume restaurant’s services provided. Staff login at back–end make order, check member order information and check member reservation information only. Admin login at back-end to do admin process.
User management control, it will automatic detect who login then specify them using different module.
Validation the input box to make sure user has fill up all the information properly.
Final Year Project
16
Restaurant Management System
Chapter 2 : Requirement Analysis
Table Maintenance
Table Maintenance Add New Table
Edit / Update Table Details
View Table Details
Delete Table
Feature: 1. Add and Delete Table:
Each table has different table number, place at different
location and different number of seat. This function allow staff to add new table information if a new table is purchase, otherwise can delete the table information, once the table is not use. 2. Edit : Staff to modify table details. 3. View Table Details: Keep track table information.
Staff Maintenance
Staff Maintenance Module
Add New Staff
Edit Staff Details
View Staff Details
Purpose : Maintain employees information.
Feature :
1. Add New Staff: New employees’ profile include personal details information such as Name, IC, Address, position, salary and status. 2. Edit Staff Details : Modify staff’s profile details. For example, a waitress staff promote to receptionist. But staff has no authorised to modify own salary and status information.
3. View Staff Details : Keep track staff details. 4. Forgot Password : A staff login forgot their password, then ask their administrator to login, check their ID and Password and reset the status to allow them login.
Final Year Project
17
Restaurant Management System
Chapter 2 : Requirement Analysis
Customer Maintenance
Customer Maintenance Module
Register / Add
Edit / Update Profile
View Profile
Print
Forgot Password
Feature: 1. Add : Record customer information. Such as MemberID, MemberPoints and Gender. Auto generates member ID number to customer when customer register as new member. If customer is not a member, he or she must register as member then only can use restaurant’s service. The system will automatically store 100 points to member after customer register as member. 2. Edit : Staff to modify or Member himself or herself to modify their own profile details. On the other hand, update member’s points is based on payment module. From the payment module, the total amount charge as member’s point calculation which mean one ringgit as one point For example, total amount is RM 100.00, then member’s point 100 will be added into database. 3. View Profile : Keep track whole member profile information.
4. Print : Customer has optional to print profile information. 5. Forgot Password and ID : If customer forgot the password, they may require to answer some question for checking member password , or member can send email to admin for help.
Final Year Project
18
Restaurant Management System
Chapter 2 : Requirement Analysis
Table Reservation Module Table Reservation Module
Add Reservation
Edit Reservation
Cancel Reservation
View Reservation
Print Reservation
Feature: 1.
Add Reservation :
Date Reservation - It is allow customer select which day to reserve table in restaurant. The date reservation cannot be reserve earlier than today. Time Reservation - it is allow customer select which time to reserve table in restaurant. The customer must earlier reach and before time and date reserve, if late, the system will automatically make table available to others customer. Table reservation – The table can be reserve in non-smoking place and smoking place. They also can choose how many seat. The system should provide a button or link that allow member to check what their table reservation detail. Besides that, when starting the reservation page, member information is already showed, but it must allow member to modify their name and contact number. In additional, If member only reserve table, then the system will not include any payment charges and not allow member design party platform. Meal Reservation - After table reserved, customer will be allowed to make meal reservation.
2.
Cancel – the reservation can be cancel by staff through member permission, but the
money is not refundable. 3.
Edit – For events included, the reservation cannot be edit by member after the deposit
is paid. 4.
View - Staff can keep track the reservation detail.
5.
Print – Customer able to print the reservation detail and payment detail after confirm reservation. It will provide an reservation ID for proving to restaurant.
Final Year Project
19
Restaurant Management System
Chapter 2 : Requirement Analysis
Platform Design Module
Platform Design Module
Customize Party Platform
View Sample Platform
Print Platform
Features : 1.
Customize Platform :
Enable customer customer use the to drag the item by
selecting
function such as change color of stage, add baby chair, and add color balls. 2.
View Sample Platform: module Platform: module that similar look TwinsYen’s restaurant decoration.
3.
Print Platform: Print the platform design and related details.
Final Year Project
20
Restaurant Management System
Chapter 2 : Requirement Analysis
Payment Module
Payment Module Print Payment
Add Payment
View Payment
Feature: Add Payment : Record : Record the payment information. After confirm order and reservation, the payment will be added.
1.
View Payment :
Display - This function is used to display the total payment calculation after make order. Display the payment charge must be included government tax 5 %, service charge 10 % of total amount charge. If payment with delivery must include transport fees of RM 5, no matter far or near. Payment Method Method –Enable it has two types, whether the payment is pay by credit card or cash. If member pay credit card through online, the member must pay 70% of total payment. Enable user print receipt. Formula –
Print receipt – receipt – the receipt printed that is included tax charges, service charges, delivery charges, total price price of quantity quantity item, total price, subtotal, and date of of payment.
Final Year Project
21
Restaurant Management System
Chapter 2 : Requirement Analysis
Report Module Report Module
Annual sales Report
View Annual Sales Report -
Daily Reservation
Daily Member Payment
Report
Report
The report can be used by financial manager and marketing
manager. This report can be used for determining which time is earn less, and which time can earn more, so they can do some promotion when business is not frequent. kitchen manager. View Daily Reservation Report - This report is created for supervisor and kitchen They can use this report to determine how many of meal require to prepare on specific date and well prepare the table to customer before the customer is coming. View Daily Member Payment Report – This report is created for financial manager. The purpose is used to view total money is received .
Final Year Project
22
Restaurant Management System
2.8
Chapter 2 : Requirement Analysis
Non-Func tional Requirement
2.8.1
Production Requirement
‐
ASP.Net homepage for user where us ing World Wide Web.
‐
The user interface must be user friendly where using graphic picture to present information to customer.
‐
System will run logically when user hit some error. Example, not allows enter a character to numeric field, and would not terminate the system directly when error message is displayed.
‐
The system should have security function such as provides a protection of the information to the user, user’s password should be protected by encrypted it and if the staff forgot password, need contact admin to reset the password as security. If the member, need to answer certain question to login.
‐
The system should have accuracy function such as calculation of payment in system are accurate and consistency, by using professional formula for the calculation.
‐
The system must be always provide availability function and performance, such as user can take order or make reservation, the TwinsYen’s system is available 24 hour per day and 365 days per year.
‐
The system should provide the best performance function, such as the system must quicker response process after user click a button and the system is not easy down.
2.8.2
‐
Organizational Requirement Standard Requirements – the development process must be develop in a recognize standard, which is ISO 9000.
‐
Implementation Requirements -
use asp.net programming language for front
end system, use c sharp .net programming language for back end system. 2.8.3
‐
External Requirement Legislative Requirement – the software that use in the system, all must be original and obtain the license from the manufacturer.
‐
Ethical Requirement – the system must be acceptable for the user and the general public.
Final Year Project
23
Restaurant Management System
Chapter 2 : Requirement Analysis
2.9 Chapter Summary In this chapter, we had faced problems when defining the function requirement and non-functional requirement. Since we had no experience on POS system, we only can base on assumption on the system those main requirements. We used the fact gathering to solve our problems. I base on my friend’s information to get some idea to develop the restaurant management system. For example, select item to card, delivery and payment.
Final Year Project
24
Restaurant Management System
Chapter 3 : System Design
Chapter 3
System Design
Final Year Project
25
Restaurant Management System
3.
Chapter 3 : System Design
Sy s t em D Des i g n 3.1
Introduction
After we analyze the requirement of the system, the next is to process system design. The system design is important because it transform information that ultimately results in software. With the system design, it can help us to create a design physical model. In this chapter we will discuss about the database design, sequence diagrams and the design of system user interface.
3.2
Use Case Diagram
System Overview
Figure 3.2.1 : Restaurant System Overview Use Case Diagram
Final Year Project
26
Restaurant Management System
Chapter 3 : System Design
Maintain Staff
Figure 3.2.2 : Maintain Staff Use Case Diagram
Maintain Member
Figure 3.2.3 : Maintain Member Use Case Diagram
Final Year Project
27
Restaurant Management System
Chapter 3 : System Design
Maintain Table
Figure 3.2.4 : Maintain Table Use Case Diagram
Pay Payment
Figure 3.2.5 : Pay Payment Use Case Diagram
Final Year Project
28
Restaurant Management System
Chapter 3 : System Design
Design Platform Party
Figure 3.2.6 : Design Platform Party Use Case Diagram
Reservation
Figure 3.2.7 : Reservation Use Case Diagram
Final Year Project
29
Restaurant Management System
Chapter 3 : System Design
Generate Report
Figure 3.2.8 : Generate Report Use Case Diagram
Final Year Project
30
Restaurant Management System
3.3
Chapter 3 : System Design
Use Case Description
Maintain Staff Module Use case name
Maintain Staff
Brief Description
This use case allows staff add, edit and search staff information.
Actor
Adminsitrator
Main Flow Actor Action
System Response 1. Display Main Menu
3. Administrator select the “Maintain Staff”
4. Display Add New Staff and Update Staff
Subflows: S-1 Add New Staff System auto generate staff ID when form load. Administrator key in new staff details. System validate key in new staff details. Adminsitrator press save button, then the system will add member record into database.
S-2 Update Staff Administrator key in staff ID or username. System varify staff ID or username status and display staff details. Administrator press edit button and edit details. Staff press save button, system validate edited details and update staff database.
Alternative flows : A-1 Step S-1 and S2 : if the data enter is invalid
‐
Display “ invalid data” message
A-2 Step S1 : if the staff position is Administrator
‐
Auto generate staff id , the first character of staff id is “A”
A-3 Step S1 : if the staff position is Staff
‐
Auto generate staff id , the first character of staff id is “S”
A-3 Step S1: if the staff does not select “Done” button option
‐
System will not add new staff data
A-3 Step S2: if the staff does not select “Done” button option
‐
Final Year Project
System will not update staff data
31
Restaurant Management System
Chapter 3 : System Design
Maintain Member Module Use case name
Maintain Member
Brief Description
This use case allows member add, edit and search member information.
Actor
Member
Main Flow Actor Action
System Response 1. Display Main Menu
2. Member select the “register member”
3.Display registration form
4. Key in member details 5.Click save button
6. Validate member key in details 7.Display login form
8. Key in Username and password
9. Validate username and password 10. Display member main menu
16. Validate member edited details 17. Update member record
Alternative flows : A-1 Step 3 : if the username is exist
‐
Display “ This username has been use by another person”
A-2 Step 5 : if the date enter is invalid
‐
Display “ invalid data” message
‐
Cursor will point to the particular field
A-3 Step 15: if the member not select “Done” button option
‐
Final Year Project
System will not update member data
32
Restaurant Management System
Chapter 3 : System Design
Maintain Table Module Use case name
Maintain Staff
Brief Description
This use case allows staff add, edit, delete and search table information.
Actor
Adminsitrator
Main Flow Actor Action
System Response 1. Display Main Menu
4. Administrator select the “Maintain Table”
4. Display Add, Update and Delete button.
Subflows: S-1 Add New Table Administrator key in new table details. Administrator press Done button to save new table information. The system validate staff key in details and add a record into table database
S-2 Update Table Administrator key in table number, press press search button. System diplays table information. Administrator press edit button and edit table information. information. System validate input data and update the table information into database.
S-2 Delete Table Administrator key in table number and press search button, System display table information. Administrator press delete button. System prompt prompt up a comfrimation massage “ are you sure want to delete the the table”. Administrator were chosen confirm to delete the table. System will delete the table from database.
Alternative flows : A-1 Step S-1 and S2 : if the data enter is invalid
‐
Display “ invalid data” message
‐ A-5 Step S-2: if the administrator does not select “Done” button option
‐
System will not update table data
‐ A-6 Step S-2 if the administrator administrator choose no from prompt up message
‐
Final Year Project
System will not delete the table record
33
Restaurant Management System
Chapter 3 : System Design
Reservation, and Design Platform Party Use case name
Reservation, Pay payment and Design Platform Party
Brief Description
This use case enable customer customer to make a reservation, reservation, inculded table and and meal. After reserve table and and meal, the this use case also allow member view payment and pay payment , andl also design platform party. Member
Actor Main Flow
Actor Action
System Response 1. Reservation form
2. Select date and time 3. Click search button
4. Verify the date and time and save reservation detail into reservation database. 5.Display table information
6. Select table table number and add into reserved table 7. Click finish button
8. Update reservation detail into database and display reservation information. 9. Display back to reserve table form, continue to reserve meal and print button.
10. Click continue reserve meal 11. Display reserve meal page 12. Select food category 13. Enter food quantity 14. click order list button
15. Display reserve meal detail 16. Show back to reserve meal button , confirm delete meal item button and confirm reserve meal meal button.
17. Select comfirm reserve meal 18. System display pay payment page 19. Key in credit card details and click done 20. Validate credit card details and
Final Year Project
34
Restaurant Management System
Chapter 3 : System Design
print receipt 21. Display back home page button, and go to design platform party button 22. Select go to design platform party button. 23. Display platform design page 24. Customize platform design 25. Select print platform design 26. Prompt up print window
Alternative flows : A-1 Step S-4: if system have not generate generate reservation id
‐
System generate reservation id and display it
A-1 Step S-16: if member select confirm confirm delete meal item button
‐
Customer select particular particular item is require require to remove. remove.
‐
System remove the item from data base
‐
System recalculate the total price at bottom of grid view
A-1 Step S-6 and S-16: if member select does not add any item or delete all item
‐
System display back to previous page function of button only
A-1 Step S-20: if if member key in wrong data
‐
Final Year Project
System display error message message and not save data into database
35
Restaurant Management System
Chapter 3 : System Design
Payment Module Use case name
Pay Payment
Brief Description
This use case allows member computerized payment (cash) and e-payment via credit card .
Actor
Member
Main Flow Actor Action
System Response 1. Display payment form after user comfirm about meal order with delivery or take away. 2.Display payment method option, which are credit card and cash
4. Select payment option and press done option 6. Validate payment details 7. Save data into database and print receipt.
Alternative flows : A-1 Step 4 : if member select payment option is credit card
‐
Display credit card form that require user key in
‐
System calculate deposit user require to pay and balance
‐
System validate user key in credit card details
A-2 Step 4 : if the member select payment option is cash
‐
Display the balance
A-3 Step 1 : if the member select order meal with delivery
‐
System calculate government tax, service charge, transport fees, total charge
A-4 Step 1: if the member select order meal with take away
‐
Final Year Project
System calculate government tax, service charge and total charge
36
Restaurant Management System
Chapter 3 : System Design
Generate Report Use case name
Generate Report
Brief Description
This use case allows administrator to generate the customer annual sales report, daily member payment report, and daily reservation report
Actor
Member
Main Flow Actor Action
System Response 1. Display main menu
2. Select “report option”
2.Display sub menu: annual sales report, daily member payment report, and daily reservation report
Subflow: If the sub menu selected is annual sales report, the S-1: annual sales report If the sub menu selected is daily member payment report, the S-2: daily member payment report If the sub menu selected is a daily reservation report, the S-3: daily reservation report
Alternative flows : S-1 Annual sales report Administrator can view the report to know whole year of sale profit and know which month is better sales. When administrator clicks the print option, system will print the report.
S-2 Daily member payment report Administrator can select specific date to view report, purpose is to know which member is haven’t pay payment and the day total payment collect and total balance is haven’t collect. . When administrator clicks the print option, system will print the report.
S-3 Daily reservation report Administrator can view the report to know what is the table, what is the time, what is the meal and member detail on specific day. . When administrator clicks the print option, system will print the report.
Final Year Project
37
Restaurant Management System
3.4
Chapter 3 : System Design
Act ivity Diagram
Maintain Staff Module
Figure 3.4.1 : Maintain Staff for Update and View Activity Diagram
Final Year Project
38
Restaurant Management System
Chapter 3 : System Design
Figure 3.4.2 : Maintain Staff for Add New Staff Activity Diagram
Final Year Project
39
Restaurant Management System
Chapter 3 : System Design
Maintain Member Module
Figure 3.4.3 : Maintain Member for Add New Member Activity Diagram
Final Year Project
40
Restaurant Management System
Chapter 3 : System Design
Figure 3.4.4 : Maintain Member for Update and View Member Activity Diagram
Final Year Project
41
Restaurant Management System
Chapter 3 : System Design
Maintain Table Module
Figure 3.4.5 : Maintain Table for Add New Table Activity Diagram
Final Year Project
42
Restaurant Management System
Chapter 3 : System Design
Figure 3.4.6 : Maintain Table for Update,View and Delete Table A ctivity Diagram
Service Charge Government Tax Grand Total Delivery Fees
Balance Deposit
decimal(10,2) decimal(10,2)
Balance Deposit
OrderNo MemberID ResID
nvarchar(10) nvarchar(10) nvarchar(10)
Order Number Member ID Reservation ID
FK FK FK
Order Member Reservation
StaffID
nvarchar(50)
Staff ID
FK
Staff
Final Year Project
62
Restaurant Management System
Chapter 3 : System Design
Table Name: Staff Field Name Data Type StaffID nvarchar(10) FName nvarchar(20)
Data Description Staff ID Staff First Name
LName SAddress SCity
nvarchar(20) nvarchar(20) nvarchar(20)
Staff Last Name Address City
SState Zip ICNo ContactNo
nvarchar(20) int nvarchar(20) nvarchar(20)
State Zip Code IC Number Contact Number
Gender Position Salary
nvarchar(6) nvarchar(10) decimal(10,2)
Gender Position Salary
Status SUserName SPassword
nvarchar(10) nvarchar(20) nvarchar(20)
Free Status User Name Password
SEmail SDOB
nvarchar(30) date
Email Date of Birth
Final Year Project
63
Key PK
Reference
Restaurant Management System
3.8
Chapter 3 : System Design
User Interface Design
Non-Member Main Page
Figure 3.8.1 Non-Member Main Page
Member Main Page
Figure 3.8.2 Member Main Page
Final Year Project
64
Restaurant Management System
Chapter 3 : System Design
Member Registration
Figure 3.8.3 Member Registration
Final Year Project
65
Restaurant Management System
Chapter 3 : System Design
Member Login
Figure 3.8.4 Member Login
Change Member Password
Figure 3.8.5 Change Member Password
Final Year Project
66
Restaurant Management System
Chapter 3 : System Design
Member Forgot Password
Figure 3.8.6 Member Forgot Password
Final Year Project
67
Restaurant Management System
Chapter 3 : System Design
Member Profile
Figure 3.8.7 Member Profile
Final Year Project
68
Restaurant Management System
Chapter 3 : System Design
Reservation
Figure 3.8.8 Reservation
Final Year Project
69
Restaurant Management System
Chapter 3 : System Design
Check Table Reserved
Figure 3.8.8 Check Table Reserved
Member Reservation Information
Figure 3.8.9 Member Reservation Information
Final Year Project
70
Restaurant Management System
Chapter 3 : System Design
Reservation Meal Menu
Figure 3.8.10 Reservation Meal Menu
Member Meal Reservation Information
Figure 3.8.11 Member Meal Reservation Information
Final Year Project
71
Restaurant Management System
Chapter 3 : System Design
Reservation Payment
Figure 3.8.12 Reservation Payment
Platform Design
Figure 3.8.13 Platform Design
Final Year Project
72
Restaurant Management System
Chapter 3 : System Design
Order Payment with Cash Payment Method
Figure 3.8.13 Order Payment with cash payment method
Final Year Project
73
Restaurant Management System
Chapter 3 : System Design
Order Payment with Credit Card Payment Method
Figure 3.8.14 Order Payment with Credit Card payment method
Final Year Project
74
Restaurant Management System
Chapter 3 : System Design
Reservation Information
Figure 3.8.15 Reservation Information
Final Year Project
75
Restaurant Management System
Chapter 3 : System Design
About Us
Figure 3.8.16 About Us
Final Year Project
76
Restaurant Management System
Chapter 3 : System Design
Staff Main Page
Figure 3.8.17 Staff Main Page
Staff Login
Figure 3.8.18 Staff Login
Final Year Project
77
Restaurant Management System
Chapter 3 : System Design
Staff Registration
Figure 3.8.19 Staff Registration
Final Year Project
78
Restaurant Management System
Chapter 3 : System Design
Check Member Reservation
Figure 3.8.20 Check Member Reservation
Final Year Project
79
Restaurant Management System
Chapter 3 : System Design
Check Member Reservation Detail
Figure 3.8.21 Check Member Reservation Detail
Final Year Project
80
Restaurant Management System
Chapter 3 : System Design
Staff Maintenance
Figure 3.8.22 Staff Maintenance
Final Year Project
81
Restaurant Management System
Chapter 3 : System Design
Member Maintenance
Figure 3.8.23 Member Maintenance
Final Year Project
82
Restaurant Management System
Chapter 3 : System Design
Staff Profile
Figure 3.8.24 Member Maintenance
Final Year Project
83
Restaurant Management System
Chapter 3 : System Design
Table Maintenance
Figure 3.8.25 Table Maintenance
Report Page
Figure 3.8.26 Report Page
Final Year Project
84
Restaurant Management System
Chapter 3 : System Design
Figure 3.8.27 Example of Daily Reservation Report
Final Year Project
85
Restaurant Management System
Chapter 3 : System Design
Figure 3.8.28 Example of Annual Sales Report
Final Year Project
86
Restaurant Management System
Chapter 3 : System Design
Figure 3.8.29 Example of Daily Member Payment Report
Final Year Project
87
Restaurant Management System
3.10
Chapter 3 : System Design
Chapter Summary
The database design is the most important part to develop a system. It is very critical because it can influence the whole system function and operation. Each data tables, data fields, data types and relationship of the table must proper implement. Therefore, the problem will be minimized during the development of the system. The interface design also important part to develop the system, because poor design will affect the overall quality of the system. A user interface must be user friendly and attractive, because it allow user easy understand how the system process. It is possible save cost and save time from system learning curve.
Final Year Project
88
Restaurant Management System
Chapter 4 : Programming
Chapter 4
Programming
Final Year Project
89
Restaurant Management System
4.
Chapter 4 : Programming
Pr o g r am m i n g 4.1
Introduction
After the system design, the next step is programming . Programming is the processes of writing the program instruction that implement the program specification, using a suitable language. In this chapter will discuss about the programming method used. .
4.2
Programmi ng Language Used
This is the front end application, so C # , Asp.net, JavaScript and Flash Action Script programming language to code it. C sharp and Asp.net are Microsoft office product. Asp.net is a web application framework developed. Asp.net mostly use for built dynamic web site and built on the Common Language Runtime (CLR). On the other hand, C # is able to provide simplicity of coding and ease of understanding and high performance. Besides that, JavaScript and Flash Acton Script are scripting language, ) are used to generate a dynamic, interactive, functionality and more responsive web page or system. Flash is an authoring tools which is including features such as drag and drop user interface components, make some effects to the object and built in behaviours that add Action Script. Action Script is written behind of Flash animation, sound, picture, movie and special effect applications, and much more. (Prayaga et al, p10, 2007) JavaScript is a dynamic scripting language that allow website programmer to build interactivity into static HTML pages. This is done by embedding blocks of JavaScript code, which can be found anywhere from any Web page. JavaScript is a scripting language that is created by Netscape Communication and Sun Microsystems. JavaScript allows web browser to produce dynamic documents and enables programmers to call routines written in Java, C and C++ (Sutar et al, p134,2008). The speed of JavaScript run on client site’s code function is faster than server when waiting for server response back. It also advantage to the server’s burden, because reduce demand from client site.
Final Year Project
90
Restaurant Management System
4.3
Chapter 4 : Programming
Sample of Programmi ng Code
4.3.1
Connection Function
This function is easy for me to call out the connection and no need to create the connection in each form every time.
Final Year Project
91
Restaurant Management System
4.3.2
Chapter 4 : Programming
Auto Generate for ID This is the example of auto number for Member ID, we using auto number for ID to avoid the duplicate TD and arrange ID number in database. This method also use in Reservation ID, Staff ID and Order ID.
Final Year Project
92
Restaurant Management System
4.3.3
Chapter 4 : Programming
Maintenance Module This system has staff maintenance module, member maintenance module and table maintenance module.
Below is showing example code of table
maintenance module. This part of coding is taking from the StaffTableMaintainace.aspx.cs. It show how “Search Table” working in the system.
This part of coding is taking from the StaffTableMaintainace.aspx.cs. It show how “Update Table” working in the system. protected void btnSearch0_Click( object sender, EventArgs e) { ButtonUpdate(); }
This part of coding is taking from the StaffTableMaintainace.cs. It show how “Delete Table” working in the system. protected void Page_Load(object sender, EventArgs e) { btnDelete.Attributes.Add( "onclick" , " return confirm_delete()" );
This part of coding is taking from the StaffTableMaintainace.aspx.cs. It show how “Delete Table” working with c sharp to prompt up message working in the GUI system. <script type="text/javascript"> function wait() { if (confirm("Are you sure you want to delete this record ?") == true) return true; else return false; }
Final Year Project
96
Restaurant Management System
Chapter 4 : Programming
This part of coding is taking from the StaffTableMaintainace.aspx.cs. It show how “Add Table” working in the system. protected void btnNew_Click( object sender, EventArgs e) { string strSQL2 = "Insert into [Table] (TableNo, Status,Zone, Size) values (@no,@st,@z,@s)" ; if (btnNew.Text == "New") { btnCancel.Enabled = true; btnNew.Enabled = true; btnUpdate.Enabled = false; btnNew.Text = " Done "; btnDelete.Enabled = false; ddlZone.Enabled = true; txtSize.Enabled = true; txtStatus.Enabled = true; txtTableNo.Enabled = true; btnSearch.Text = "New Search"; txtSize.Text = ""; txtStatus.Text = ""; txtTableNo.Text = ""; lblmsg1.Text = ""; lblmsg2.Text= ""; lblmsg3.Text = ""; } else { if (txtTableNo.Text == "") { txtTableNo.Focus(); lblmsg3.Text = "* require fill"; } else if (txtSize.Text == "") { txtSize.Focus(); lblmsg2.Text = "* require fill"; } else if (txtSize.Text == "" || txtTableNo.Text == "") { txtSize.Focus(); lblmsg2.Text = "* require fill"; txtTableNo.Focus(); lblmsg3.Text = "* require fill "; } else try {
This part of coding is taking from the StaffTableMaintainace.aspx. Below is GUI code, by using ASP.net, this show how javascript of “delete funtion” working with delete button in the system. <%@ Page Language="C#" AutoEventWireup ="true" CodeFile=…."> . . . <script type="text/javascript"> function wait() { if (confirm("Are you sure you want to delete this record ?") == true) return true; else return false; } . . .
Final Year Project
98
/>
Restaurant Management System
4.3.4
Chapter 4 : Programming
Reservation Module
This part of coding is taking from the Reservation.aspx.cs. It show how “ Function call ” working in the system. 5.
Session["theRID"] = lblResID.Text; } 71. //load table information, but not show today table is reserved and not available 72. void ReloadTableTable 73. void TodayReservation() 74. { 69. 70.
} //make decision to display table information, base on today or other day void ReloadTableTable void DateValidation() 116. { 117. DateTime mydate = Convert.ToDateTime(txtReserveDate.Text); 118. 114. 115.
119. 120. 121. 122. 123. 124.
if (mydate < System.DateTime.Today) { Response .Write ("Cannot reserve table before today"); } else if ( mydate == System .DateTime .Today )
125. 126.
{ if (Zone.Checked == true ) { if (chkSize.Checked == true) { TodayZoneSize(); } else { TodayZone(); } } else if (chkSize.Checked == true ) { TodaySize(); }
//load table information with specific date, time and type of location void OtherDayZone() 362. { 363. 364. DateTime GetToday = DateTime.Parse(DateTime.Now.ToShortTimeString()); SqlConnection conNwind; 365. SqlCommand cmdSelectEmployees; 366. SqlDataReader dtrEmployees; 367. 361.
This part of coding is taking from the Reservation.aspx.cs. It show how “Update Reservation” working in the system. protected void btnDone_Click( object sender, EventArgs e) { string theRestype = "Online"; String TODAY = DateTime.Today.ToShortDateString(); String TOTIME = DateTime.Today.ToShortTimeString(); if (lblResID.Text != "") { if (txtContactName.Text == "") { lblmsg.Text = "*"; lblmsg3.Text = "The '*' place that your are require to fill up ."; } if (txtContact.Text == "") { lblmsg.Text = "*"; lblmsg3.Text = "The '*' place that your are require to fill up ."; } if (txtICNo.Text == "") { lblmsg.Text = "*"; lblmsg3.Text = "The '*' place that your are require to fill up ."; } else
This part of coding is taking from the Reservation.aspx.cs. It show how “ Cancel Table Reservation” working in the system. protected void btnCancel_Click( object sender, EventArgs e) { System.Threading. Thread.Sleep(5000); lblmsg.Text = "Please wait ........"; conNwind = new SqlConnection (connStr); conNwind.Open(); string Sql = "DELETE FROM ReserTable where ResID =@rid";
Final Year Project
111
Restaurant Management System
Chapter 4 : Programming using (SqlCommand dCmd = new SqlCommand SqlCommand(Sql, (Sql,
conNwind)) { dCmd.Parameters.AddWithValue( "@rid" "@rid", , lblResID.Text); dCmd.ExecuteNonQuery(); } conNwind.Close(); conNwind = new SqlConnection (connStr); conNwind.Open(); string Sql1 = "DELETE FROM Reservation where ResID =@rid"; =@rid" ; using (SqlCommand dCmd = new SqlCommand SqlCommand(Sql1, (Sql1, conNwind)) { dCmd.Parameters.AddWithValue( "@rid" "@rid", , lblResID.Text); dCmd.ExecuteNonQuery(); } conNwind.Close(); DateValidation(); lblmsg.Text = "" ""; ; // *****Go back to main page****** Response.Redirect( "Membermainpage.aspx" ); }
This part of coding is taking from the Rbasic.aspx.cs. It show how “ Delete Selected Reserve Table Item” Item” working in the system. protected void btnRemove_Click( object sender, EventArgs e) { string connStr = ConfigurationManager .ConnectionStrings[ "ConnectionString" ].ConnectionString; SqlConnection conNwind; foreach (GridViewRow row in GridView2.Rows) { CheckBox checkbox1 = (CheckBox CheckBox)row.FindControl( )row.FindControl( "ckRemove" "ckRemove"); ); { if (checkbox1.Checked) { Label lCartNo = (Label Label)row.FindControl( )row.FindControl( "lCartNo" "lCartNo"); );
Final Year Project
112
Restaurant Management System
Chapter 4 : Programming
{ conNwind = new SqlConnection (connStr); conNwind.Open(); // string Sql = "Delete From [ReserTable] where CartID =@tcid"; string Sql = " DELETE FROM ReserTable WHERE (CartID = @tcid)" @tcid)"; ; //string Sql = "Insert Into ReserTable(TableNo,ResID) values(@tno, @rid)"; using (SqlCommand dCmd = new SqlCommand SqlCommand(Sql, (Sql, conNwind)) { dCmd.Parameters.AddWithValue( "@tcid" "@tcid", , lCartNo.Text.Trim()); dCmd.ExecuteNonQuery(); } conNwind.Close(); Refresh(); }
This part of coding is taking from the ReserveOrderMenu.aspx.cs. It show how “Search “Search Meal” Meal” working in the system. SqlConnection conNwind; SqlCommand cmdSelectEmployees; SqlDataReader dtrEmployees; string connStr = ConfigurationManager .ConnectionStrings[ "ConnectionString" ].ConnectionString; conNwind = new SqlConnection (connStr); conNwind.Open(); cmdSelectEmployees = new SqlCommand SqlCommand( ("Select * From Meal Where MealName LIKE '%" + txtSearch.Text + "%'" "%'", , conNwind); // cmdSelectEmployees = new SqlCommand("Select count(mealNo) from meal, MeaCategory where MeaCategory.MCName= @name"); dtrEmployees = cmdSelectEmployees.ExecuteReader(); ListView1.DataSourceID = null null; ; ListView1.DataSource = dtrEmployees; ListView1.DataBind(); dtrEmployees.Close(); conNwind.Close();
Final Year Project
113
Restaurant Management System
Chapter 4 : Programming
This part of coding is taking from the ReserveOrderMenu.aspx.cs. It show Meal” working in the system. how “Add “Add Reserve Meal” protected void ListView1_SelectedIndexChanging1( object sender, ListViewSelectEventArgs e) { SqlConnection conNwind; string id = ListView1.DataKeys[e.NewSelectedIndex].Value.ToString(); Response.Write(id); ListViewItem item = (ListViewItem ListViewItem)ListView1.Items[e.NewSelectedIndex]; )ListView1.Items[e.NewSelectedIndex]; DropDownList ddlQty = (DropDownList )item.FindControl( "ddlQty" "ddlQty"); ); TextBox tRemark = (TextBox TextBox)item.FindControl( )item.FindControl( "txtRemark" "txtRemark"); ); Label lMealNo = (Label Label)item.FindControl( )item.FindControl( "lMealNo" "lMealNo"); ); Label lMealName = (Label Label)item.FindControl( )item.FindControl( "lMealName" "lMealName"); ); Label lPrice = (Label Label)item.FindControl( )item.FindControl( "lPrice" "lPrice"); );
Response.Write( "New Records Inserted Successfully." ); conNwind.Close(); }
Final Year Project
114
Restaurant Management System
Chapter 4 : Programming
This part of coding is taking from the ReserveOrderMenu.aspx.cs. It show how “Delete Meal Item” working in the system. protected void btnMultipleRowDelete_Click( object sender, EventArgs e) { string connStr = ConfigurationManager .ConnectionStrings[ "ConnectionString" ].ConnectionString; SqlConnection conNwind; foreach (GridViewRow row in GridView1.Rows) { CheckBox checkbox1 = (CheckBox)row.FindControl( "cbRows"); { if (checkbox1.Checked) { Label lCartNo = (Label)row.FindControl( "lblCartNo"); { conNwind = new SqlConnection (connStr); conNwind.Open(); "; string Sql = " DELETE FROM ResCart WHERE (RCartNO = @tcid)"; using (SqlCommand dCmd = new SqlCommand(Sql, conNwind)) { dCmd.Parameters.AddWithValue( "@tcid", lCartNo.Text.Trim()); dCmd.ExecuteNonQuery(); } conNwind.Close(); } } } } Refresh(); }
Final Year Project
115
Restaurant Management System
Chapter 4 : Programming
This part of coding is taking from the ReserveOrderMenu.aspx.cs. It show how “Confirm Reserve Meal” working in the system. protected void btnCheckOut_Click( object sender, EventArgs e) { SqlConnection conNwind5; string connStr = ConfigurationManager .ConnectionStrings[ "ConnectionString" ].ConnectionString; conNwind5 = new SqlConnection (connStr); conNwind5.Open(); string Sql2 = "Insert Into [ReserMeal](ResID,MealNo, Qty, Subtotal, Remark, MealName, Price) values(@rid, @mno,@qty, @sub, @remark, @mname, @price)"; using (SqlCommand dCmd = new SqlCommand(Sql2, conNwind5)) { foreach (GridViewRow row in GridView1.Rows) { Label lMealNo = (Label)row.FindControl( "lblMealNo"); Label lMealName = (Label)row.FindControl( "lblMealName" ); Label lQty = (Label)row.FindControl( "lblQty"); Label lPrice = (Label)row.FindControl( "lblPrice"); Label lSubtotal = (Label)row.FindControl( "lblSubtotal" ); Session["ReservationGrantotal" ] = lSubtotal.Text.Trim(); dCmd.Parameters.AddWithValue( "@rid", lblID.Text); dCmd.Parameters.AddWithValue( "@mno", lMealNo.Text.Trim()); dCmd.Parameters.AddWithValue( "@mname", lMealName.Text.Trim()); dCmd.Parameters.AddWithValue( "@qty", lQty.Text.Trim()); dCmd.Parameters.AddWithValue( "@price", lPrice.Text.Trim()); dCmd.Parameters.AddWithValue( "@sub", lSubtotal.Text.Trim()); dCmd.Parameters.AddWithValue( "@remark", "‐"); dCmd.ExecuteNonQuery(); dCmd.Parameters.Clear(); } } conNwind5.Close(); SqlConnection conNwind8; SqlCommand cmdSelectEmployees8; string connStr8 = ConfigurationManager .ConnectionStrings[ "ConnectionString" ].ConnectionString; conNwind8 = new SqlConnection (connStr8); conNwind8.Open(); cmdSelectEmployees8 = new SqlCommand("Delete From ResCart Where MemberID='" + Session["MemberID"] + "'", conNwind8); cmdSelectEmployees8.ExecuteNonQuery(); GridView1.DataSource = null; GridView1.DataBind(); conNwind8.Close(); Response.Redirect( "ReservationPayment2.aspx" );
Final Year Project
116
Restaurant Management System
4.3.5
Chapter 4 : Programming
Payment Module
This part of coding is taking from the ReservationPayment.aspx.cs. It show how “Calculate Payment” working in the system. private decimal GovTax = (decimal)0.05; private decimal SvCharge = (decimal)0.10; private decimal TheCalculation; private decimal totalGovTax, totalServiceCharge; private decimal TotalStatus = (decimal)0.0; private decimal getPay = (decimal)0.0; private SqlConnection con = new SqlConnection (); private decimal theSuggestion = (decimal)0.0; private decimal thebalance = (decimal)0.0; private decimal theDisplayTotal = (decimal)0.0;
This part of coding is taking from the ReservationPayment.aspx.cs. It show how “Validate Credit Card and Add Payment ” working in the system. protected void btnCheckOut_Click( object sender, EventArgs e) { String TODAY = DateTime.Today.ToShortDateString(); String TOTIME = DateTime.Today.ToShortTimeString(); //try //{ if (txtExpireDate.Text != "" || txtName.Text != "" || CardNo.Text != "") {
This part of coding is taking from the OPayment.aspx.cs (OrderPayment page). It show how “Order Meal with Delivery Payment Calculation” working in the system. decimal GetLabelGrandTotal = decimal.Parse(lblGrandTotal.Text); totalServiceCharge = GetLabelGrandTotal * SvCharge; totalGovTax = GetLabelGrandTotal * GovTax;
This part of coding is taking from the OPayment.aspx.cs (OrderPayment page). It show how “Order Meal with Collect by Customer Payment Calculation” working in the system. lblTransportFees.Text = "0.00"; TheCalculation = totalServiceCharge + totalGovTax + GetLabelGrandTotal; thebalance = TheCalculation ‐ theSuggestion; lblTotal.Text = TheCalculation.ToString( "F"); //caculation lblBalance.Text = thebalance.ToString( "F"); lblDeposit.Text = theSuggestion.ToString( "F"); lblGTax.Text = totalGovTax.ToString( "F"); lblServiceCharge.Text = totalServiceCharge.ToString( "F");
Final Year Project
122
Restaurant Management System
Chapter 4 : Programming
This part of coding is taking from the OPayment.aspx.cs (OrderPayment page). It show how “Calculate point base on payment” working in the system. //declaration point purpose int originalPoint; decimal decAmount = (decimal)0.0; string strPoint; int intAddUppoint, intAmount; Initialize(); SqlDataAdapter daHotel; DataSet dsHotel = new DataSet(); string sqlHotel = "select * from Members where MemberID='" + Session["MemberID"].ToString() + "'"; daHotel = new SqlDataAdapter (sqlHotel, con); daHotel.Fill(dsHotel, "Members"); foreach (DataRow row in dsHotel.Tables[0].Rows) { strPoint = dsHotel.Tables[ "Members"].Rows[0]["MPoint"].ToString(); decAmount = Convert.ToDecimal(lblTotal .Text ); originalPoint = Convert.ToInt32(strPoint); intAmount = Convert.ToInt32(decAmount); intAddUppoint = intAmount + originalPoint; string strSQL5 = " Update Members Set [MPoint]=@point where MemberID='" + Session["MemberID"].ToString() + "'"; SqlCommand cmd5 = new SqlCommand(strSQL5, con); // cmd5.Parameters.AddWithValue( "@point", intAddUppoint); cmd5.ExecuteNonQuery();
Final Year Project
123
Restaurant Management System
4.3.6
Chapter 4 : Programming
Platform Design
This part of coding is taking from the Stage.fla. It show how “ customize position of object” working in the system.
on (press) { startDrag( this, false, 0, 0, 400,400); } on (release, releaseOutside) { stopDrag(); }
This part of coding is taking from the PlatformDesign.aspx. It show how “Display flash appliction” working in the system.
Final Year Project
124
Restaurant Management System
4.3.7
Chapter 4 : Programming
Print Function This part of coding is taking from the PrintHelper.cs. It is print function class, use another form or page to call this function . Below is showing how “Print function ” working in the system. using System.Data; using System.Configuration; 7. using System.Web; 8. using System.Web.Security; 9. using System.Web.UI; 10. using System.Web.UI.WebControls; 11. using System.Web.UI.WebControls.WebParts; 12. using System.Web.UI.HtmlControls; 13. using System.IO; 14. using System.Text; 15. using System.Web.SessionState; 16. /// 17. /// Summary description for PrintHelper 18. /// 19. public class PrintHelper 20. { public PrintHelper() 21. { 22. } 23. public static void PrintWebControl( Control ctrl) 24. 25. { PrintWebControl(ctrl, string.Empty); 26. } 27. public static void PrintWebControl( Control ctrl, string Script) 28. { 29. StringWriter stringWrite = new StringWriter (); 30. System.Web.UI. HtmlTextWriter htmlWrite = new 31. System.Web.UI. HtmlTextWriter (stringWrite); if (ctrl is WebControl) 32. { 33. Unit w = new Unit(100, UnitType.Percentage); 34. ((WebControl)ctrl).Width = w; } 35. Page pg = new Page(); 36. pg.EnableEventValidation = false; 37. if (Script != string.Empty) 38. { 39. pg.ClientScript.RegisterStartupScript(pg.GetType(), 40. "PrintJavaScript" , Script); } 41. HtmlForm frm = new HtmlForm(); 42. pg.Controls.Add(frm); 43. 44. frm.Attributes.Add( "runat", "server"); frm.Controls.Add(ctrl); 45. pg.DesignerInitialize(); 46. pg.RenderControl(htmlWrite); 47. string strHTML = stringWrite.ToString(); 48. HttpContext.Current.Response.Clear(); 49. HttpContext.Current.Response.Write(strHTML); 50. 5. 6.
This part of coding is taking from the Opayment.aspx.cs.Below is showing how “Print button call the print function ” working in the system. protected void btnPrint_Click(object sender, EventArgs e) { PrintHelper.PrintWebControl(Tab10); Session["ctrl"] = Tab10 ; ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script language=javascript>window.open('Print.aspx','PrintMe', 'height=300px,width=300px,scrollbars=1');"); }
This part of coding is taking from the Print.aspx.cs.Below is showing how “ Page load the print function after Opayment form call the print function ” working in the system. protected void Page_Load(object sender, EventArgs e) { lbldate.Text = DateTime.Now.ToShortDateString(); Control ctrl = (Control)Session["ctrl"]; PrintHelper.PrintWebControl(ctrl); }
This part of coding is taking from the PlatformDesign.aspx.cs.The code is another method to print page. Below is showing how “ Print Page ” working in the system. btnPrint1.Attributes.Add( "onclick", "window.print();" );
Final Year Project
126
Restaurant Management System
Chapter 4 : Programming
4.3.8 GUI Validation This part of coding is taking from the Reservation.aspx. It show how “ Select Date and Time Validation” working in the system. <%@ Page Language="C#" AutoEventWireup ="true" CodeFile="Reservation.aspx.cs" Inherits="NormalReservation" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <script type="text/javascript"> function checkDate(sender, args) { if (sender._selectedDate < new Date()) { alert("You cannot select a day earlier than today!"); sender._selectedDate = new Date(); // set the date back to the current date sender._textbox.set_Value(sender._selectedDate.format(sender._format)) } }