(精编)餐饮管理系统代码大全
餐饮管理程序(PB源代码)

餐饮管理程序(PB源代码)
drui12009-03-14上传
餐饮管理程序
1、在后台管理中增加了前台销售一览表。
2、完成了日志察看中的查找功能。
3、日志过滤(缺省为本日日志)
4、在后改管理的销售项目一览表中增加了排行TOP10
5、增加了版本校验机制
6、增加了错误陷阱
7、增加了程序中颜色自定义
8、修改了挂帐单位可挂帐额度的计算错误
9、修改了XP窗体的拖动
10、限制了程序只能运行1次
11、增加了运行库文件察看。
12、增加了操作日志中的系统提示
C++餐厅管理系统源码(可运行)

//Win10操作系统下,用VC6运行,文件后缀名应为.cpp#include <iostream>//输入输出流#include <fstream>//文件流#include <iomanip>//用来对输入输出操作的格式进行更加方便的控制,在ios_base基类的基础上#include <stdlib.h>//标准库头文件#include<Windows.h>//Windows,图形界面接口,图形设备函数等重要的功能using namespace std;typedef struct bianhao{int num;//桌子编号int seat;//座位数(顾客数)int stat;//桌子状态}bianhao_T;//利用数组存桌子,三个参数分别为桌子编号、座位数、状态(是否有人在用)bianhao_T A[10] = { {1, 2, 0},{2, 2, 0},{3, 2, 0},{4, 2, 0},{5, 2, 0},{6, 4, 0},{7, 4, 0},{8, 4, 0},{9, 4, 0},{10, 6, 0}};class Restaurant //餐厅类{private:char location[50]; //座位char phone_number[20];//电话号码char evaluates[200];//评价public:void Search();//搜寻void Set();//建立void evaluate();//评价};class Customer //顾客类{private:int desk; //桌子char dishes[20];//菜品int queues;//队列,排队char write_evaluate[200];//客户书写评价static int total;//总价格public:Customer();//顾客void order();//菜};class Waiter//服务员类{private:int job_number;//工作号char name[25];//名字char sex[5];//性别char phone_number[20];//手机号码public:void Search();//搜索void Set();//录入};class Menus//菜单类{private:static int sums;//菜品总价int number;//菜品序号int price;//菜品价格char dish_name[30];//菜品名字public:friend void Customer::order();void Search();//查询void Set();//录入};int Customer::total = 0;//顾客排队号int Menus::sums = 0;//餐品总价格void Welcome(){system("color b1");cout << " ︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻" << endl;cout << " 【︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻︻】" << endl;cout << " 【【】】" << endl;cout << " 【【★★★★ 】】" << endl;cout << " 【【】】" << endl;cout << " 【【】】" << endl;cout << " 【【★欢迎使用★ 】】" << endl;cout << " 【【】】" <<endl;cout << " 【【◆◆◆餐厅管理系统◆◆◆ 】】" << endl;cout << " 【【】】" << endl;cout << " 【【】】" << endl;cout << " 【【】】" << endl;cout << " 【【-------------------------------- 】】" << endl;cout << " 【【︱制作者:------、------、------ | 】】" << endl;cout << " 【【-------------------------------- 】】" << endl;cout << " 【【】】" << endl;cout << " 【【】】" << endl;cout << " 【【】】" << endl;cout << " 【︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼】" << endl;cout << " ︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼︼" << endl;}//****全局函数***//void Menu(){cout << " **** ****" << endl;cout << " *** ** ** ***" << endl;cout << " *** ** ** ***" << endl;cout << " *** ~.~ - - ***" << endl;cout << " *** 1、信息查询***" << endl;cout << "*** ^.^ @.@ ***" << endl;cout << "*** 2、信息录入***" << endl;cout << " *** $.$ +.+ ***" << endl;cout << " *** 3、顾客点餐***" << endl;cout << " *** @.@ = = ***" << endl;cout << " *** 4、接待顾客***" << endl;cout << " *** ***" << endl;cout << " *** 5、顾客评价***" << endl;cout << " *** ***" << endl;cout << " *** 0、退出***" << endl;cout << " *** ***" << endl;cout << " *** ***" << endl;cout << " ***" << endl;}void Search()//查询菜单函数{system("cls");cout << endl; cout << endl; cout << endl; cout << endl; cout << endl;cout << "1、查询餐厅信息" << endl;cout << endl;cout << "2、查询服务员信息" << endl;cout << endl;cout << "3、查询菜单" << endl;cout << endl;cout << "4、查看评价" << endl;cout << endl;cout << "5、返回上一级菜单" << endl;cout << endl;cout << "" << "请选择:" << endl;int choice;Restaurant restaurant;Waiter waiter;Menus dish;cin >> choice;switch (choice){case 1: restaurant.Search(); break;case 2: waiter.Search(); break;case 3: dish.Search(); break;case 4: restaurant.evaluate(); break;case 5:system("cls");Menu(); break;}}//黄int Arrange_table(int seat)//顾客桌子安排函数{int i = 0;for (i = 0; i < 10; i++){if (0 == A[i].stat)//判断桌子状态,是否被占用{if (A[i].seat >= seat)//如果桌子位置数大于等于人数,则安排此桌子,此桌子将被占用,状态变为1{A[i].stat = 1;cout << "编号" << A[i].num << "的座位可安排" << seat << "人" << endl;return A[i].num;//安排桌子}}}cout << "找不到可安排" << seat << "个人的座位,请顾客排队" << endl;}void reception()//接收顾客数{system("cls");int seat = 0;int num = 0;cout << "请输入当前需要接待的顾客数:" << endl;cin >> seat;num = Arrange_table(seat);system("pause");system("cls");Menu();}void orderdish(){Customer customer;customer.order();Menu();}void customer_evaluate()//顾客评价函数{char evaluate[200];cout << "请评价:" << endl;cin >> evaluate;ofstream out("evaluate.txt", ios::app);out << evaluate << endl;out.close();Menu();}void Restaurant::evaluate(){system("cls");cout << endl << "历史评价:" << endl << endl;ifstream in("evaluate.txt");while (in >> evaluates)cout << "" << evaluates << endl << endl;in.close();system("pause");system("cls");Menu();}Customer::Customer(){}void Customer::order()//顾客,点餐,计算总价{system("cls");int temp[50];//点餐编号int j = 0;int sum = 0;//菜品总价char flag = 'y';int num = 0;Menus menu[50];//菜品cout << "菜单" << endl << endl;ifstream in("Menus.txt");//以输入方式打开文件,从硬盘到内存int i = 0;while (in >> menu[i].number >> menu[i].dish_name >> menu[i].price){cout << "" << menu[i].number << setw(10) << menu[i].dish_name << setw(10) << menu[i].price << endl;//输出菜品编号、名字、价格i++;}in.close();//关闭文件while (flag == 'y'){cout << "请点餐,选择相应编号:" << endl;cin >> temp[num];num++;cout << "是否继续y or n" << endl;cin >> flag;}for (j = 0; j < num; j++)//点几份菜{for (i = 0; i < 10; i++){if (temp[j] == menu[i].number)//找到对应菜品编码{sum = sum + menu[i].price;//计算总价}}}cout << "总价钱:" << sum << endl;system("pause");system("cls");}//朱void Set()//信息录入函数{system("cls");cout << endl << endl << endl << endl;cout << "1 添加菜品" << endl << endl;cout << "2 添加服务员" << endl << endl;cout << "3 添加餐厅信息" << endl << endl;cout << "4 返回上一级菜单" << endl << endl;cout << "请选择:" << endl;Menus dish;int choice;Waiter waiter;Restaurant restaurant;cin >> choice;switch (choice){case 1:dish.Set(); break;case 2:waiter.Set(); break;case 3:restaurant.Set(); break;case 4:system("cls");Menu();break;}}void Waiter::Set(){system("cls");char flag = 'y';do{cout << "输入服务员的工号,姓名,性别,电话号码:" << endl;cin >> job_number >> name >> sex >> phone_number;ofstream out("Waiter.txt");out << job_number << " " << name << " " << sex << " " << phone_number << endl;out.close();cout << "是否继续是(y)否(n)" << endl;cin >> flag;} while (flag == 'y');Menu();}void Menus::Set(){system("cls");char flag = 'y';do{sums++;cout << "输入编号,菜名,价格" << endl;cin >> number >> dish_name >> price;ofstream out("Menus.txt", ios::app);out << number << " " << dish_name << " " << price << " " << endl;out.close();cout << "是否继续是(y)否(n)" << endl;cin >> flag;} while (flag == 'y');system("pause");system("cls");Menu();}void Restaurant::Set(){system("cls");cout << "输入餐厅位置,电话号码" << endl;cin >> location >> phone_number;ofstream out("Restaurant.txt");out << location << " " << phone_number << endl;out.close();system("pause");system("cls");Menu();}//吴void Restaurant::Search(){system("cls");cout << endl << endl;ifstream in("Restaurant.txt");cout << "地址" << "" << "联系电话" << endl;while (in >> location >> phone_number){cout << location << "" << phone_number << endl;}in.close();cout << endl << endl;system("pause");system("cls");Menu();}void Waiter::Search(){system("cls");ifstream in("Waiter.txt");cout << endl << endl;cout << "工号" << " " << "姓名" << " " << "性别" << " " << "电话号码" << endl;while (in >> job_number >> name >> sex >> phone_number){cout << " " << job_number << " " << name << " " << sex << " " << phone_number << endl;}in.close();system("pause");system("cls");Menu();}void Menus::Search(){system("cls");ifstream in("Menus.txt");cout << endl << endl;cout << "编号" << setw(10) << "菜名" << setw(10) << "价格" << endl;while (in >> number >> dish_name >> price){cout << " " << number << " " << setw(10) << dish_name << setw(10) << price << endl;}in.close();system("pause");system("cls");Menu();}int main(){Welcome();Sleep(3000);system("cls");Menu();do{cout << "请输入你的选择:" << endl;int choice;cin >> choice;switch (choice){case 1:Search(); break;case 2:Set(); break;case 3:orderdish(); break;case 4:reception(); break;case 5:customer_evaluate(); break;case 0:exit(1); break;}} while (1);return 0;}。
菜单管理系统代码

#include<iostream>#include <iomanip>#include<fstream>#include<string>using namespace std;class Cmenu //创建Cmenu类菜的属性{int num; //菜的编号string name; //菜名float price; //菜的单价string kind; //菜的种类int sort; //菜的数量public:void getnum(int i); //录入菜的编号void getname(string Name); //录入菜的名字void getprice(float Price); //录入菜的单价void getkind(string Kind); //录入菜的类别void getsort(int SORT); //录入所点菜的数量void menudisplay(); //菜谱显示void selectdisplay(); //对所点的菜进行输出float returnnum() //返回菜的编号{ return num; }string returnname() //返回菜名{ return name; }float returnprice() //返回菜的单价{ return price; }string returnkind() //返回菜的类别{ return kind; }int returnsort() //返回菜的数量{ return sort; }。
void Cmenu::getnum(int i) //录入菜的编号函数{num=i;}void Cmenu::getname(string Name) //录入菜的名字{name=Name;}void Cmenu::getprice(float Price) //录入菜的单价{price=Price;}void Cmenu::getkind(string Kind) //录入菜的类别{kind=Kind;}void Cmenu::getsort(int SORT) // 录入所点菜的数量{sort=SORT;}void Cmenu::menudisplay() //菜单的信息显示{cout<<setw(3)<<num<<setw(22)<<name<<setw(16)<<kind<<setw(16)<<price<<endl; }void Cmenu::selectdisplay() //对所点的菜进行输出{cout<<setw(3)<<num<<setw(24)<<name<<setw(16)<<kind<<setw(16)<<price<<setw(19)<<s ort<<endl;}float youhui(float sum,float point) //函数计算有优惠卷时的价格{if(point>1.0){sum=sum-point;}if(point<=1.0){sum=sum*point;}return sum;} 。
餐饮管理系统(1)界面图+源代码

餐饮管理系统1、前言在餐饮业务竞争越来越激烈的今天,如何提高服务质量,其管理能力显的越来越重要。
尤其是对一些大的餐饮店,餐饮店内部服务项目越多,管理难度越大,既要处理前台又要处理后台的工作,所以一个好的管理系统可以提高酒店的管理水平也可以大幅度提高酒店服务水平。
1.1目的随着当今社会信息化的日新月异的发展,计算机应用已经渗透到日常工作的许多方面无论是其自身还是所发挥的作用,计算机都标志着一种高科技、高效率和高水平。
为了企业创先进、争一流,为了企业的发展一套好的系统必不可少.现在餐饮业发展速度飞快,要想在激烈的社会竞争有一席之地,好的服务是最基本的保障,此次开发的餐饮管理系统就是针对现代化社会管理和要求,在服务上提高自己的效率,使自己的公司立于不败之地.1.2定义餐饮管理系统,SQL,E-R图1.3 参考资料《数据库应用系统开发技术》朱如龙刘焰机械出版社2004年8月《VC++与SQL2000开发技术》汪晓平钟军人民邮电出版社2004年8月2、系统设计2.1系统目标设计餐饮管理系统的主要目标是实现对酒店内部各种管理的电子化、自动化,提高各个模块之间的办公效率,为高质量餐饮服务提供保证。
2.2开发设计思想餐厅系统是按照国内餐饮行业最新要求开发的全心概念的信息管理系统。
该系统将餐厅收银、往来帐务结算及销售情况统计工作在单计算机或网络系统中完成。
主要特点包括:*代码菜谱编制,方便统计,方便输入;*开单、改单、结算、打印、用户界面方便友好;*系统专设往来账、内部账,结算方式灵活多样,结算消息详尽;*系统可同前台系统衔接,查询客人信贷情况,往前台客人帐户转账;*报表真实,实用性强,如:收银报表汇总收银、支票、信用卡、转帐等情况;菜肴销售报表汇总各种菜肴的日、月销售量;员工销售统计表,可打印值台人员销售业绩核实报表提供依据。
*账务系统共讷讷感的完整性。
一旦该系统正式运行,餐厅每日的营业账和全部往来客户的账务操作结算都将依靠计算机,该系统面对当前餐厅餐饮业各种负复杂的结算要求应具有很强的应变能力。
c#餐饮管理系统详细设计含所有窗体代码)

餐饮管理系统1.1开发背景近几年来,计算机网络、分布技术日趋成熟,随着科技的发展,餐饮业的竞争也越来越激烈。
想在这样竞争激烈的环境下生存,就必须运用科学的管理思想与先进的管理方法,使点餐与管理一体化。
这样不仅提高了工作效率,也避免了以前手工作业的麻烦,从而使管理者能够准确、有效地管理餐饮。
因此,餐饮业的管理者更希望从科学的管理中取得竞争的优势,在竞争激烈的商业市场中取胜。
1.2系统分析1.2.1 需求分析通过与XXX餐饮公司的沟通和需求分析,要求系统具体以下功能:●系统操作简单,界面友好●规范、完善的基础信息设置;●支持多人操作,要求有权限分配功能;●为了方便用户,要求系同支持模糊查询;●实现对消费账目自动结算。
1.2.2可行性分析1.引言(1)编写目的以文件的形式给企业的决策层提供项目实施的参考依据,其中包括项目存在的风险、项目需要的投资和能够收获的最大效益。
(2)背景XXX餐饮公司是一家以餐饮经营为主的私营企业。
为了完善管理制度、增强企业的竞争力、实现信息化管理,公司决定开发餐饮管理系统。
2.可行性研究的前提(1)要求餐饮管理系统必须提供桌台信息、菜品信息和人事档案信息的基础设置;强大的查询功能和消费管理功能;可以分不同权限、不同用户对该系统进行操作。
另外,该系统还必须保证数据的安全性、完整性和准确性。
(2)目标餐饮管理系统的目标是实现企业的信息化管理,节约人力、物力、财力等资源,提高餐饮行业的服务效率并提升企业市场竞争力。
(3)条件、假定和限制为实现企业的信息化管理,必须对才做人员进行培训,而且将原有的菜品、桌台、人事档案等信息转换为信息化数据,需要操作员花费大量时间和精力来完成,为不影响企业的正常运行,餐饮管理系统必须在两个月的时间内交付用户使用。
系统分析人员需要两个内到位,用户需要4天时间确认需求分析文档。
去除其中可能出现的问题,例如用户可能临时有事,占用5天时间确认需求分析。
那么程序开发人员需要在一个月零19天的时间内进行系统设计、程序编码、系统测试、程序调试和程序的打包工作。
最全商户MCC码对照表

最全商户MCC码对照表在我们的日常生活中,无论是购物消费、旅游出行还是餐饮娱乐,每一笔支付交易都与一个神秘的代码相关联,那就是商户 MCC 码。
MCC 码,全称为 Merchant Category Code,即商户类别码,它是银行卡收单管理中的一项重要编码,用于标识商户的主营业务范围和行业类别。
了解商户 MCC 码对于消费者、商家以及金融机构都具有重要意义。
接下来,为您呈现一份最全的商户 MCC 码对照表。
一、餐饮娱乐类1、 5812:餐厅、酒楼外出就餐是我们生活中的常见场景,无论是中式餐馆还是西式餐厅,其对应的 MCC 码通常是 5812。
2、 5813:饮酒场所,酒吧、酒馆、夜总会当您在酒吧享受休闲时光,或是在夜总会尽情狂欢时,对应的MCC 码就是 5813。
3、 7911:歌舞厅喜欢在歌舞厅放松娱乐的朋友们,这里的 MCC 码是 7911。
4、 7832:电影院走进电影院观看一场精彩的电影,对应的 MCC 码为 7832。
5、 7995:彩票销售购买彩票时的 MCC 码是 7995。
二、购物消费类1、 5311:百货商店在大型百货商场挑选各种商品,其 MCC 码是 5311。
2、 5691:服装商店购买时尚服装的店铺,MCC 码为 5691。
3、 5944:珠宝首饰店选购精美珠宝首饰的地方,对应的是 5944。
4、 5977:化妆品商店女士们常去的化妆品店,MCC 码是 5977。
5、 5651:运动用品店热爱运动的朋友们在购买运动装备时,对应的 MCC 码为 5651。
6、 5541:加油站给爱车加油的加油站,MCC 码是 5541。
7、 5732:家电销售购买家用电器的商店,MCC 码为 5732。
三、旅游出行类1、 4112:铁路客运乘坐火车出行时,对应的 MCC 码是 4112。
2、 4722:旅行社通过旅行社安排旅行行程,MCC 码为 4722。
3、 7512:汽车租赁需要租车出行时,对应的是 7512。
餐饮管理系统(核心代码)

餐饮管理系统教学单位长春工业大学姓名岳继武学号 20093561年级 093306专业软件工程指导教师刘寒梅职称副教授2013 年 03 月01日一、数据库连接类构建(文件DBconn.java)package com;import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;public class DBconn {private Connection con;private String classname="com.microsoft.jdbc.sqlserver.SQLServerDriver";private String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=canyin";public Connection getCon(){try{Class.forName(classname);con=DriverManager.getConnection(url,"sa","");}catch(Exception e){e.printStackTrace(System.err);con=null;}return con;}public void closed(){try{if(con!=null)con.close();}catch(Exception e){e.printStackTrace();}}//用于注册,添加public int GetCount(String SQL){try{Connection Con = getCon();Statement Smt = Con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_ UPDATABLE);int counts = Smt.executeUpdate(SQL);return counts;}catch(SQLException e){System.out.println("失败!");return 0;}}//用于查询,登陆public ResultSet GetRs(String SQL){try{Connection Con = getCon();Statement Smt = Con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_ UPDATABLE);ResultSet Rs = Smt.executeQuery(SQL);return Rs;}catch(SQLException e){System.out.println("失败!");return null;}}//修改和删除public boolean executeUpdate(String sql) {if (con == null) {getCon();}try {Statement stmt = con.createStatement();int iCount = stmt.executeUpdate(sql);System.out.println("操作成功,所影响的记录数为" + String.valueOf(iCount));} catch (SQLException e) {System.out.println(e.getMessage());System.out.println("executeUpdaterError!");}return true;}}二、中文字符处理类(文件Char.java)package com;import java.io.UnsupportedEncodingException;public class Char {public Char(){}/*** 对字符进行转码处理* @param str 要转码的字符串* @return 编码后的字符串*/public String toString(String str){// 转换字符String text = "";// 判断要转码的字符串是否有效if(str != null && !"".equals(str)){try {// 将字符串进行编码处理text = new String(str.getBytes("iso8859-1"),"GB18030");} catch (UnsupportedEncodingException e) {e.printStackTrace();}}// 返回后的字符串return text;}}三、字符串过滤类(文件DoString.java)package com;public class DoString {private String getstr;private String checkstr;public DoString(){}public void setGetstr(String getstr){this.getstr=getstr;dostring();}public String getGetstr(){return this.getstr;}public String getCheckstr(){return this.checkstr;}public void dostring(){this.checkstr=this.getstr;this.checkstr=this.checkstr.replaceAll("&","&");this.checkstr=this.checkstr.replaceAll(";","");this.checkstr=this.checkstr.replaceAll("'","");this.checkstr=this.checkstr.replaceAll("<","<");this.checkstr=this.checkstr.replaceAll(">",">");this.checkstr=this.checkstr.replaceAll("--","");this.checkstr=this.checkstr.replaceAll("\"\"",""");this.checkstr=this.checkstr.replaceAll("/","");this.checkstr=this.checkstr.replaceAll("%"," ");}}四、提示信息类(文件PopDialog.java)package com;public class PopDialog {/******************************功能:返回弹出提示对话框并重定向网页到指定页面的字符串*message:指定要显示的提示信息*url:指定重定向到的页面******************************/public String messageBox(String message,String url){String str="<script language='javascript'>alert('"+message+"');";str=str+"window.location.href='"+url+"';</script>";return str;}}五、时间函数类(文件Shijian.java)package com;import java.text.DateFormat;import java.util.Date;public class Shijian {public String showTodayTime(){Date date=new Date();return DateFormat.getDateInstance().format(date);}}六、CSS样式表(文件style.css)body,td,th {font-size: 12px;}body {background-image: url(../image/dw.gif);margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;}body {font-size: 12px;color: #000000;}a:link {font-size: 12px;color: #000000;text-decoration: none;}a:visited {font-size: 12px;color: #000000;text-decoration: none;}a:hover {font-size: 12px;color: #0000FF;}.style7 {color: #FFFFE1}七、系统登录界面(login.jsp和login_chuli.jsp)核心代码:<script language="javascript">function check(){//判断用户名是否为空if(ername.value==""){alert("请输入用户名!");ername.focus();return false;}//判断密码是否为空if(form1.password.value==""){alert("请输入密码!");form1.password.focus();return false;}}</script><table width="800" height="388" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td valign="top" background="image/login.jpg"><form id="form1" name="form1" method="post" action="login_chuli.jsp" onSubmit="return check()"> <table width="800" border="0" cellspacing="0" cellpadding="0"><tr><td height="127" colspan="2"> </td></tr><tr><td width="320" height="20" align="right">账号:</td><td width="480" height="25" align="left"><input name="username"type="text" id="username" /></td></tr><tr><td height="20" align="right">密码:</td><td height="25" align="left"><input name="password" type="password" id="password" /></td></tr><tr><td height="25" align="right">权限:</td><td height="25" align="left"><select name="quanxian" id="quanxian"><option value="员工" selected="selected">员工</option><option value="管理员">管理员</option></select></td></tr><tr><td height="30" align="right"> </td><td height="30" align="left"><input type="submit" name="Submit" value="登陆" /> <input type="button" name="Submit2" value="注册" onclick="location.href='zhuce.jsp'"/></td></tr></table></form></td></tr></table>后台处理:<%@ page language="java" contentType="text/html; charset=GB18030"pageEncoding="GB18030" import="java.sql.*"%><jsp:useBean id="Login_chuli" class="com.DBconn" scope="page"/><jsp:useBean id="popDialog" scope="page" class="com.PopDialog"/><jsp:useBean id="mystring" class="com.DoString"/><%//获取变量,并过滤危险字符mystring.setGetstr(newString(request.getParameter("username").getBytes("ISO-8859-1"),"GB18030")); String username=mystring.getCheckstr();mystring.setGetstr(newString(request.getParameter("password").getBytes("ISO-8859-1"),"GB18030")); String password=mystring.getCheckstr();String quanxian=newString(request.getParameter("quanxian").getBytes("ISO-8859-1"),"GB18030");//链接数据库Connection con=Login_chuli.getCon();//判断权限if(quanxian.equals("管理员")){//执行查询语句String sql="select * from login where username='"+username+"' and password='"+password+"'";//返回记录集ResultSet rs=Login_chuli.GetRs(sql);if(rs.next()){//存变量,作为判断条件session.setAttribute("jibie",""+quanxian+"");session.setAttribute("user_name",""+username+"");//登陆成功,跳转页面out.println(popDialog.messageBox("登录成功!","admin/management.jsp"));}else{//登陆失败,返回页面out.println("<script lanage='javascript'>alert('管理员登陆错误,请核实用户名和密码是否输入正确,重新输入');javascript:history.go(-1);</script>");}Login_chuli.closed();}//同上if(quanxian.equals("员工")){String sql="select * from register where r_name='"+username+"' and r_pass='"+password+"'";ResultSet rs=Login_chuli.GetRs(sql);if(rs.next()){session.setAttribute("id",""+rs.getString("r_no") +"");session.setAttribute("jibie",""+quanxian+"");session.setAttribute("yonghu",""+username+"");out.println(popDialog.messageBox("登录成功!","index.jsp"));}else{out.println("<script lanage='javascript'>alert('员工登陆错误,请核实用户名和密码是否输入正确,重新输入');javascript:history.go(-1);</script>");}Login_chuli.closed();}%>八、注册界面(文件zhuce.jsp和zhuce_chuli.jsp)核心代码:<script language="javascript">function check(){//判断ID是否为空if(form1.r_no.value==""){alert("请输入编号!");form1.r_no.focus();return false;}//判断用户名是否为空if(form1.r_name.value==""){alert("请输入用户名!");form1.r_name.focus();return false;}//判断密码是否为空if(form1.r_pass.value==""){alert("请输入密码!");form1.r_pass.focus();return false;}//判断性别是否为空if(form1.r_sex.value==""){alert("请输入性别!");form1.r_sex.focus();return false;}//判断年龄是否为空if(form1.r_nianling.value==""){alert("请输入年龄!");form1.r_nianling.focus();return false;}if(form1.s_email.value==""){alert("请输入E-mail地址!");form1.s_email.focus();return false;}//判断E-mail地址是否合法var regExp=/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/; //验证E-mail地址的正则表达式对象if(!regExp.test(form1.s_email.value)){ //判断E-mail地址是否合法alert("您输入的E-mail不合法!");form1.s_email.focus();return false;}//判断电话号码是否为空if(form1.s_tel.value==""){alert("请输入电话号码!");form1.s_tel.focus();return false;}//判断QQ号码是否为空if(form1.s_qq.value==""){alert("请输入QQ号码!");form1.s_qq.focus();return false;}//判断爱好是否为空if(form1.s_love.value==""){alert("请输入爱好!");form1.s_love.focus();return false;}//判断爱好是否为空if(form1.s_zhuzhi.value==""){alert("请输入住址!");form1.s_zhuzhi.focus();return false;}//判断爱好是否为空if(form1.s_zhiwei.value==""){alert("请输入职位!");form1.s_zhiwei.focus();return false;}//判断备注是否为空if(form1.s_beizhu.value==""){alert("请输入备注信息!");form1.s_beizhu.focus();return false;}}</script><table width="800" height="422" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td valign="top" background="image/reg.jpg"><form id="form1" name="form1" method="post" action="zhuce_chuli.jsp" onSubmit="return check()"> <table width="800" border="0" cellspacing="0" cellpadding="0"><td height="103" colspan="3"> </td></tr><tr><td> </td><td height="25">编号:<input name="r_no" type="text" id="r_no" size="10"/></td> <td> </td></tr><tr><td width="153" height="25"> </td><td width="234">姓名:<input name="r_name" type="text" id="r_name" /></td><td width="413">密码:<input name="r_pass" type="password" id="r_pass" /></td> </tr><tr><td height="25"> </td><td height="25">性别:<input name="r_sex" type="text" id="r_sex" /></td><td height="25">年龄:<input name="r_nianling" type="text" id="r_nianling" /></td> </tr><tr><td height="25"> </td><td height="25">邮件:<input name="s_email" type="text" id="s_email" /></td><td height="25">电话:<input name="s_tel" type="text" id="s_tel" /></td></tr><tr><td height="25"> </td><td height="25">QQ号:<input name="s_qq" type="text" id="s_qq" /></td><td height="25">爱好:<input name="s_love" type="text" id="s_love" /></td></tr><tr><td height="25"> </td><td height="25">住址:<input name="s_zhuzhi" type="text" id="s_zhuzhi" /></td> <td height="25">职位:<input name="s_zhiwei" type="text" id="s_zhiwei" /></td> </tr><td height="60"> </td><td height="60" colspan="2">备注:<textarea name="s_beizhu" cols="55" rows="5" id="s_beizhu"></textarea></td></tr><tr><td height="30" colspan="3" align="center"><input type="submit" name="Submit" value="注册" /> <input type="button" name="Submit2" value="返回" onclick="history.back()"/></td></tr></table></form></td></tr></table>后台处理<%@ page language="java" contentType="text/html; charset=GB18030"pageEncoding="GB18030" import="java.sql.*"%><jsp:useBean id="db" class="com.DBconn" scope="page"/><jsp:useBean id="popDialog" scope="page" class="com.PopDialog"/><jsp:useBean id="mystring" class="com.DoString"/><jsp:useBean id="chart" class="com.Char"/><jsp:useBean id="times" class="com.Shijian"/><%try {//获取变量,处理中文String r_no=chart.toString(request.getParameter("r_no"));String r_name=chart.toString(request.getParameter("r_name"));String r_pass=chart.toString(request.getParameter("r_pass"));String r_sex=chart.toString(request.getParameter("r_sex"));String r_nianling=chart.toString(request.getParameter("r_nianling"));String s_email=chart.toString(request.getParameter("s_email"));String s_tel=chart.toString(request.getParameter("s_tel"));String s_qq=chart.toString(request.getParameter("s_qq"));String s_love=chart.toString(request.getParameter("s_love"));String s_zhuzhi=chart.toString(request.getParameter("s_zhuzhi"));String s_zhiwei=chart.toString(request.getParameter("s_zhiwei"));String s_beizhu=chart.toString(request.getParameter("s_beizhu"));//链接数据库Connection con=db.getCon();// 添加信息的SQL语句String sql = "insert into register(r_no,r_name,r_pass,r_sex,r_nianling,s_email,s_tel,s_qq,s_love,s_zhuzhi,s_zh iwei,s_beizhu,s_time)values('"+r_no+"','"+r_name+"','"+r_pass+"','"+r_sex+"','"+r_nianling+"','"+s_email+" ','"+s_tel+"','"+s_qq+"','"+s_love+"','"+s_zhuzhi+"','"+s_zhiwei+"','"+s_beizhu+"','"+ times.showTodayTime()+"')";int row = db.GetCount(sql);if(row > 0){//跳转页面out.println(popDialog.messageBox("注册成功,去登陆吧!","login.jsp"));}con.close();} catch (Exception e) {out.print("注册失败!");e.printStackTrace();}%>九、信息一览管理代码(文件mg_info.jsp)<table width="799" height="521" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top" background="../image/RIGHT.jpg"><table width="799" height="26" border="0" cellpadding="0" cellspacing="0"><tr><td> <span class="STYLE1">员工信息管理</span></td></tr></table><table width="799" border="0" cellspacing="0" cellpadding="0"><tr><td width="36" align="center" bgcolor="#F0F0F0">编号</td><td width="83" align="center" bgcolor="#F0F0F0">账号</td><td width="67" align="center" bgcolor="#F0F0F0">密码</td><td width="36" align="center" bgcolor="#F0F0F0">性别</td><td width="35" height="30" align="center" bgcolor="#F0F0F0">年龄</td><td width="93" align="center" bgcolor="#F0F0F0">邮件</td><td width="62" align="center" bgcolor="#F0F0F0">电话</td><td width="70" align="center" bgcolor="#F0F0F0">QQ号</td><td width="80" align="center" bgcolor="#F0F0F0">爱好</td><td width="101" align="center" bgcolor="#F0F0F0">职位</td><td width="102" align="center" bgcolor="#F0F0F0">住址</td><td width="34" align="center" bgcolor="#F0F0F0">删除</td></tr><%int CountPage = 0;int CurrPage = 1;int PageSize = 15;int CountRow = 0;String StrPage = request.getParameter("Page");if (StrPage == null){CurrPage = 1;}else{CurrPage = Integer.parseInt(StrPage);}Connection con=my_info.getCon();if (con != null){try{String sqlyy = "Select * from register ";ResultSet rs=my_info.GetRs(sqlyy);if(!rs.next()){out.println("对不起,暂时没有员工信息");}else{st();int i = 0;CountRow = rs.getRow();CountPage = (CountRow/PageSize);if (CountRow%PageSize>0)CountPage++;Integer n = (CurrPage-1)*5+1;rs.first();rs.absolute(CurrPage*PageSize-PageSize+1);while (i<PageSize && !rs.isAfterLast()){%><tr><td align="center"><%=rs.getString("r_no")%></td><td align="center"><%=rs.getString("r_name")%></td><td align="center"><%=rs.getString("r_pass")%></td><td align="center"><%=rs.getString("r_sex")%></td><td height="25" align="center"><%=rs.getString("r_nianling")%></td><td align="center"><%=rs.getString("s_email")%></td><td align="center"><%=rs.getString("s_tel")%></td><td align="center"><%=rs.getString("s_qq")%></td><td align="center"><%=rs.getString("s_love")%></td><td align="center"><%=rs.getString("s_zhiwei")%></td><td align="center"><%=rs.getString("s_zhuzhi")%></td><td align="center"><a href="delete.jsp?id=<%=rs.getString("id")%>&c=1">删除</a></td></tr><%rs.next();i++;}}}catch (SQLException e){out.println(e.getMessage());}finally{con.close();}}%></table><table width="700" height="53" border="0" cellpadding="0" cellspacing="0"><tr ><td width="205" height="53" align="center">《<%=CurrPage%>/<%=CountPage %>》每页<%=PageSize %>条记录共<%=CountRow%>条记录</td><td width="495" align="left"><div align="left" ><%if (CurrPage>1){%><a href="mg_info.jsp?Page=<%=CurrPage-1%>">上一页</a><%}%><%if (CurrPage<CountPage){%><a href="mg_info.jsp?Page=<%=CurrPage+1%>">下一页</a><%}%><a href="mg_info.jsp?Page=<%=CountPage%>">最后一页</a></div></td></tr></table></td></tr></table>十、查询记录(文件salary_jilu.jsp)<script language="javascript">function check(){//判断用户编号是否为空if(form1.r_no.value==""){alert("请输入用户编号!");form1.r_no.focus();return false;}}</script><form id="form1" name="form1" method="post" action="salary_jilu.jsp" onSubmit="return check()"><table width="495" height="25" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td width="74">用户编号:</td><td width="179"><input type="text" name="r_no" id="r_no"/></td><td width="40">日期:</td><td width="151"><input name="c_shijian" type="text" id="c_shijian" value="<%=times.showTodayTime() %>" size="12" readonly> <script language='javascript'>if (!yers){document.write("<input type=button name='s' onclick='popUpCalendar(this, form1.c_shijian, \"yyyy-m-d\")' value='日历' style='font-size:12px'>")}</script></td><td width="51"><input type="submit" name="Submit" value="查询" /></td></tr></table></form><table width="799" border="0" cellspacing="0" cellpadding="0"><tr><td width="105" height="30" align="center" bgcolor="#F0F0F0">用户编号</td><td width="173" align="center" bgcolor="#F0F0F0">菜名</td><td width="82" align="center" bgcolor="#F0F0F0">单价</td><td width="104" align="center" bgcolor="#F0F0F0">数量</td><td width="147" align="center" bgcolor="#F0F0F0">就餐位置</td><td width="138" align="center" bgcolor="#F0F0F0">消费日期</td></tr><%int salary=0;int CountPage = 0;int CurrPage = 1;int PageSize = 10;int CountRow = 0;String StrPage = request.getParameter("Page");if (StrPage == null){CurrPage = 1;}else{CurrPage = Integer.parseInt(StrPage);}Connection con=salary_jilu.getCon();if (con != null){try{String r_no=request.getParameter("r_no");String c_shijian=request.getParameter("c_shijian");String sqlyy = "Select * from diancai where r_no='"+r_no+"' and c_shijian='"+c_shijian+"'";ResultSet rs=salary_jilu.GetRs(sqlyy);if(!rs.next()){out.println("对不起,暂时没有消费信息");}else{st();int i = 0;CountRow = rs.getRow();CountPage = (CountRow/PageSize);if (CountRow%PageSize>0)CountPage++;Integer n = (CurrPage-1)*5+1;rs.first();rs.absolute(CurrPage*PageSize-PageSize+1);while (i<PageSize && !rs.isAfterLast()){%><tr><td height="30" align="center"><%=rs.getString("r_no")%></td><td height="30" align="center"><%=rs.getString("c_name")%></td><td height="30" align="center"><%=rs.getString("c_danjia")%></td><td height="30" align="center"><%=rs.getString("c_shuliang")%></td><td height="30" align="center"><%=rs.getString("c_weizhi")%></td><td height="30" align="center"><%=rs.getString("c_shijian")%></td></tr><%salary=salary+Integer.parseInt(rs.getString("c_danjia"))*Integer.parseInt(rs.getString( "c_shuliang"));rs.next();i++;}}}catch (SQLException e){out.println(e.getMessage());}finally{con.close();}}%></table><br /><table width="593" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td height="30" align="center">总体消费为:<b><%=salary %>元</b> <a href="#" onClick="window.print()">打印》》</a></td></tr></table></td></tr></table>十一、修改信息代码(文件caidan_up.jsp和caidan_up_chuli.jsp)<table width="799" height="521" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top" background="../image/RIGHT.jpg"><table width="799" height="26" border="0" cellpadding="0" cellspacing="0"><tr><td> <span class="STYLE1">菜单信息修改</span></td></tr></table><%String yonghu=(String)session.getAttribute("yonghu");String id=request.getParameter("id");String sqlo="select * from caidan where id='"+id+"'";ResultSet rs=db.GetRs(sqlo);if(!rs.next()){out.println("暂时没有菜单信息");}else{%><form id="form1" name="form1" method="post" action="caidan_up_chuli.jsp" ><table width="475" border="0" cellspacing="0" cellpadding="0"><tr><td height="25"> 菜名:<input name="c_name" type="text" id="c_name" value="<%=rs.getString("c_name") %>" readonly/></td></tr><tr><td height="25"> 单位:<input name="c_danwei" type="text" id="c_danwei" value="<%=rs.getString("c_danwei") %>"/></td></tr><tr><td height="25"> 单价:<input name="c_danjia" type="text" id="c_danjia" value="<%=rs.getString("c_danjia") %>"/></td></tr><tr><td height="25"> 备注:<textarea name="c_beizhu" cols="40" rows="5"。
[餐饮管理]餐饮管理系统代码
![[餐饮管理]餐饮管理系统代码](https://img.taocdn.com/s3/m/dde568b3866fb84ae55c8d30.png)
(餐饮管理)餐饮管理系统代码餐饮管理系统代码1usingSystem;2using.Generic;3using;4using;5using;6using;7using.Forms;8using;9namespace餐饮管理系统10...{11publicpartialclassfrmManagement:Form12...{13ArrayListRoomStatus=newArrayList();14ArrayListVipClass=newArrayList();15publicfrmManagement()16...{17InitializeComponent();18}1920privatevoid房间类型BindingNavigatorSaveItem_Click(objectsender,EventArgse)22();23this.房间类型();24this.房间类型(.房间类型);25}2627privatevoidfrmManagement_Load(objectsender,EventArgse)28...{29//TODO:这行代码将数据加载到表“dieteticManagementDataSet.管理员”中。
您可以根据需要移动或移除它。
30this.管理员(.管理员);31//TODO:这行代码将数据加载到表“”中。
您可以根据需要移动或移除它。
32.Fill(.Vip);3334//TODO:这行代码将数据加载到表“dieteticManagementDataSet.餐牌”中。
您可以根据需要移动或移除它。
35this.餐牌(.餐牌);36//TODO:这行代码将数据加载到表“dieteticManagementDataSet.食品类别”中。
您可以根据需要移动或移除它。
37this.食品类别(.食品类别);38//TODO:这行代码将数据加载到表“dieteticManagementDataSet.商品”中。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
(精编)餐饮管理系统代码大全餐饮管理系统代码1 using System;2using System.Collections.Generic;4using System.Data;5using System.Drawing;6using System.Text;7using System.Windows.Forms;8using System.Collections;9namespace 餐饮管理系统10...{11 public partial class frmManagement : Form12 ...{13 ArrayList RoomStatus = new ArrayList();14 ArrayList VipClass = new ArrayList();15 public frmManagement()16 ...{17 InitializeComponent();18 }1920 private void 房间类型BindingNavigatorSaveItem_Click(object sender, EventArgs e)21 ...{22 this.Validate();23 this.房间类型BindingSource.EndEdit();24 this.房间类型TableAdapter.Update(this.dieteticManagementDataSet.房间类型);25 }2627 private void frmManagement_Load(object sender, EventArgs e)28 ...{29 // TODO: 这行代码将数据加载到表“dieteticManagementDataSet.管理员”中。
您可以根据需要移动或移除它。
30 this.管理员TableAdapter.Fill(this.dieteticManagementDataSet.管理员);31 // TODO: 这行代码将数据加载到表“dieteticManagementDataSet.Vip”中。
您可以根据需要移动或移除它。
32 this.vipTableAdapter.Fill(this.dieteticManagementDataSet.Vip);3334 // TODO: 这行代码将数据加载到表“dieteticManagementDataSet.餐牌”中。
您可以根据需要移动或移除它。
35 this.餐牌TableAdapter.Fill(this.dieteticManagementDataSet.餐牌);36 // TODO: 这行代码将数据加载到表“dieteticManagementDataSet.食品类别”中。
您可以根据需要移动或移除它。
37 this.食品类别TableAdapter.Fill(this.dieteticManagementDataSet.食品类别);38 // TODO: 这行代码将数据加载到表“dieteticManagementDataSet.商品”中。
您可以根据需要移动或移除它。
3940 // TODO: 这行代码将数据加载到表“dieteticManagementDataSet.餐房”中。
您可以根据需要移动或移除它。
41 this.餐房TableAdapter.Fill(this.dieteticManagementDataSet.餐房);42 // TODO: 这行代码将数据加载到表“dieteticManagementDataSet.房间类型”中。
您可以根据需要移动或移除它。
43 this.房间类型TableAdapter.Fill(this.dieteticManagementDataSet.房间类型);44 VipClass.Add("普通会员");45 VipClass.Add("中级会员");46 VipClass.Add("高级会员");47 RoomStatus.Add("可供");48 RoomStatus.Add("预订");49 RoomStatus.Add("占用");50 RoomStatus.Add("停用");51 RoomStatus.Add("脏台");52 性别ComboBox.Items.Add("男");53 性别ComboBox.Items.Add("女");54 级别ComboBox.Items.Clear();55 foreach (string s in VipClass)56 级别ComboBox.Items.Add(s);57 餐台状态ComboBox.Items.Clear();58 foreach (string s in RoomStatus)59 餐台状态ComboBox.Items.Add(s);60 string[] sdata = Program.DBOpertor.GetRoomClass();61 房间类型ComboBox.Items.Clear();62 for (int i = 0; i < sdata.Length; i++)63 房间类型ComboBox.Items.Add(sdata[i]);64 }6566 private void 餐房BindingNavigatorSaveItem_Click(object sender, EventArgs e)67 ...{68 this.Validate();69 this.餐房BindingSource.EndEdit();70 this.餐房TableAdapter.Update(this.dieteticManagementDataSet.餐房);71 }7273 private void Add_Click(object sender, EventArgs e)74 ...{75 //new frmAddAndModification(餐房DataGridView, this.dieteticManagementDataSet.餐房).Show();7677 frm餐房f=new frm餐房(this.dieteticManagementDataSet.餐房,"Add");78 foreach (string s in RoomStatus)79 f.餐台状态ComboBox.Items.Add(s);80 string[] sdata = Program.DBOpertor.GetRoomClass();81 for (int i = 0; i < sdata.Length; i++)82 f.房间类型ComboBox.Items.Add(sdata[i]);83 f.ShowDialog();84 // f.Dispose();85 }8687 private void Delete_Click(object sender, EventArgs e)88 ...{89 if (MessageBox.Show("确定要删除吗?", "删除确定", MessageBoxButtons.YesNo) == DialogResult.Yes)90 ...{91 string no = 餐房DataGridView.CurrentRow.Cells[0].Value.ToString();92 this.dieteticManagementDataSet.餐房.Rows.Find(no).Delete();93 }94 }9596 private void Modification_Click(object sender, EventArgs e)97 ...{98 string no = 餐房DataGridView.CurrentRow.Cells[0].Value.ToString();99 using (frm餐房 f = new frm餐房(this.dieteticManagementDataSet.餐房.Rows.Find(no), "Modification"))100 ...{101 foreach (string s in RoomStatus)102 f.餐台状态ComboBox.Items.Add(s);103 string[] sdata = Program.DBOpertor.GetRoomClass();104 for (int i = 0; i < sdata.Length; i++)105 f.房间类型ComboBox.Items.Add(sdata[i]);106 f.ShowDialog();107 }108109 }110111 private void button1_Click(object sender, EventArgs e)112 ...{113 using (frm房间类型f = new frm房间类型(this.dieteticManagementDataSet.房间类型,"Add"))114 ...{115 f.ShowDialog();116 }117 }118119 private void button2_Click(object sender, EventArgs e)120 ...{121 if (MessageBox.Show("确定要删除吗?", "删除确定", MessageBoxButtons.YesNo) == DialogResult.Yes)122 ...{123 string no = 房间类型DataGridView.CurrentRow.Cells[0].Value.ToString();124 this.dieteticManagementDataSet.房间类型.Rows.Find(no).Delete();125 }126 }127128 private void button3_Click(object sender, EventArgs e)129 ...{130 string no = 房间类型DataGridView.CurrentRow.Cells[0].Value.ToString();131 using (frm房间类型f = new frm房间类型(this.dieteticManagementDataSet.房间类型.Rows.Find(no), "Modification"))132 ...{133 f.ShowDialog();134 }135 }136137 private void 商品类型添加_Click(object sender, EventArgs e)138 ...{139 using (frm商品类型f = new frm商品类型(this.dieteticManagementDataSet.食品类别, "Add"))140 ...{141 f.ShowDialog();142 }143 }144145 private void 商品类型删除_Click(object sender, EventArgs e)146 ...{147 if (MessageBox.Show("确定要删除吗?", "删除确定", MessageBoxButtons.YesNo) == DialogResult.Yes)148 ...{149 string no = 商品类型DataGridView.CurrentRow.Cells[0].Value.ToString();150 this.dieteticManagementDataSet.食品类别.Rows.Find(no).Delete();151 }152 }153154 private void 商品类型修改_Click(object sender, EventArgs e)155 ...{156 string no = 商品类型DataGridView.CurrentRow.Cells[0].Value.ToString();157 using (frm商品类型f = new frm商品类型(this.dieteticManagementDataSet.食品类别.Rows.Find(no), "Modification"))158 ...{159 f.ShowDialog();160 }161 }162163 private void 商品类型保存_Click(object sender, EventArgs e)164 ...{165 this.Validate();166 this.食品类别BindingSource.EndEdit();167 this.食品类别TableAdapter.Update(this.dieteticManagementDataSet.食品类别);168 }169170 private void 餐牌添加_Click(object sender, EventArgs e)171 ...{172 using (frm餐牌 f = new frm餐牌(this.dieteticManagementDataSet.餐牌, "Add"))173 ...{174 DataTable BigClass = Program.DBOpertor.GetBigClass();175 string SBigClass;176 for (int i = 0; i < BigClass.Rows.Count; i++)177 ...{178 SBigClass = BigClass.Rows[i]["食品类别"].ToString();179 f.食品类别ComboBox.Items.Add(SBigClass);180 }181 f.ShowDialog();182 }183 }184185 private void 餐牌删除_Click(object sender, EventArgs e)186 ...{187 if (MessageBox.Show("确定要删除吗?", "删除确定", MessageBoxButtons.YesNo) == DialogResult.Yes)188 ...{189 string no = 餐牌DataGridView.CurrentRow.Cells[0].Value.ToString();190 this.dieteticManagementDataSet.餐牌.Rows.Find(no).Delete();191 }192 }193194 private void 餐牌修改_Click(object sender, EventArgs e)195 ...{196 string no = 餐牌DataGridView.CurrentRow.Cells[0].Value.ToString();197 using (frm餐牌 f = new frm餐牌(this.dieteticManagementDataSet.餐牌.Rows.Find(no), "Modification"))198 ...{199 f.ShowDialog();200 }201 }202203 private void 餐牌保存_Click(object sender, EventArgs e)204 ...{205 this.Validate();206 this.餐牌BindingSource.EndEdit();207 this.餐牌TableAdapter.Update(this.dieteticManagementDataSet.餐牌);208 }209210 private void 房间类型保存_Click(object sender, EventArgs e)211 ...{212 this.Validate();213 this.房间类型BindingSource.EndEdit();214 this.房间类型TableAdapter.Update(this.dieteticManagementDataSet.房间类型);215 }216217 private void 餐房保存_Click(object sender, EventArgs e)218 ...{219 this.Validate();220 this.餐房BindingSource.EndEdit();221 this.餐房TableAdapter.Update(this.dieteticManagementDataSet.餐房);222 }223224 private void Vip添加_Click(object sender, EventArgs e)225 ...{226 using (frmVip f = new frmVip(this.dieteticManagementDataSet.Vip, "Add"))227 ...{228 f.性别ComboBox.Items.Add("男");229 f.性别ComboBox.Items.Add("女");230 foreach (string s in VipClass)231 f.级别ComboBox.Items.Add(s);232 f.ShowDialog();233 }234 }235236 private void Vip修改_Click(object sender, EventArgs e)237 ...{238 string no = vipDataGridView.CurrentRow.Cells[0].Value.ToString();239 using (frmVip f = new frmVip(this.dieteticManagementDataSet.Vip.Rows.Find(no), "Modification"))240 ...{241 f.性别ComboBox.Items.Add("男");242 f.性别ComboBox.Items.Add("女");243 foreach (string s in VipClass)244 f.级别ComboBox.Items.Add(s);245 f.ShowDialog();246 }247 }248249 private void Vip删除_Click(object sender, EventArgs e)250 ...{251 if (MessageBox.Show("确定要删除吗?", "删除确定", MessageBoxButtons.YesNo) == DialogResult.Yes)252 ...{253 string no = vipDataGridView.CurrentRow.Cells[0].Value.ToString();254 this.dieteticManagementDataSet.Vip.Rows.Find(no).Delete();255 }256 }257258 private void Vip保存_Click(object sender, EventArgs e)259 ...{260 this.Validate();261 this.vipBindingSource.EndEdit();262 this.vipTableAdapter.Update(this.dieteticManagementDataSet.Vip);263 }264265 private void Save_Click(object sender, EventArgs e)266 ...{267 餐牌保存_Click(sender, e);268 房间类型保存_Click(sender, e);269 商品类型保存_Click(sender, e);270 餐房保存_Click(sender, e);271 Vip保存_Click(sender, e);272 管理员保存_Click(sender, e);273 Program.f.GetUpToDate();274 this.Close();275 }276277 private void Cancel_Click(object sender, EventArgs e)278 ...{279 this.Close();280 }281282 private void 管理员添加_Click(object sender, EventArgs e)283 ...{284 using (frm管理员f = new frm管理员(this.dieteticManagementDataSet.管理员, "Add"))285 ...{286 f.ShowDialog();287 }288 }289290 private void 管理员删除_Click(object sender, EventArgs e)291 ...{292 if (MessageBox.Show("确定要删除吗?", "删除确定", MessageBoxButtons.YesNo) == DialogResult.Yes)293 ...{294 string no = 管理员DataGridView.CurrentRow.Cells[0].Value.ToString();295 this.dieteticManagementDataSet.管理员.Rows.Find(no).Delete();296 }297 }298299 private void 管理员修改_Click(object sender, EventArgs e)300 ...{301 string no = 管理员DataGridView.CurrentRow.Cells[0].Value.ToString();302 using (frm管理员f = new frm管理员(this.dieteticManagementDataSet.管理员.Rows.Find(no), "Modification"))303 ...{304 f.ShowDialog();305 }306 }307308 private void 管理员保存_Click(object sender, EventArgs e)309 ...{310 this.Validate();311 this.管理员BindingSource.EndEdit();312 this.管理员TableAdapter.Update(this.dieteticManagementDataSet.管理员);313 }314315316317318 }319}。