(精编)餐饮管理系统代码大全

合集下载

餐饮管理程序(PB源代码)

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

C++餐厅管理系统源码(可运行)

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目的随着当今社会信息化的日新月异的发展,计算机应用已经渗透到日常工作的许多方面无论是其自身还是所发挥的作用,计算机都标志着一种高科技、高效率和高水平。

为了企业创先进、争一流,为了企业的发展一套好的系统必不可少.现在餐饮业发展速度飞快,要想在激烈的社会竞争有一席之地,好的服务是最基本的保障,此次开发的餐饮管理系统就是针对现代化社会管理和要求,在服务上提高自己的效率,使自己的公司立于不败之地.1.2定义餐饮管理系统,SQL,E-R图1.3 参考资料《数据库应用系统开发技术》朱如龙刘焰机械出版社2004年8月《VC++与SQL2000开发技术》汪晓平钟军人民邮电出版社2004年8月2、系统设计2.1系统目标设计餐饮管理系统的主要目标是实现对酒店内部各种管理的电子化、自动化,提高各个模块之间的办公效率,为高质量餐饮服务提供保证。

2.2开发设计思想餐厅系统是按照国内餐饮行业最新要求开发的全心概念的信息管理系统。

该系统将餐厅收银、往来帐务结算及销售情况统计工作在单计算机或网络系统中完成。

主要特点包括:*代码菜谱编制,方便统计,方便输入;*开单、改单、结算、打印、用户界面方便友好;*系统专设往来账、内部账,结算方式灵活多样,结算消息详尽;*系统可同前台系统衔接,查询客人信贷情况,往前台客人帐户转账;*报表真实,实用性强,如:收银报表汇总收银、支票、信用卡、转帐等情况;菜肴销售报表汇总各种菜肴的日、月销售量;员工销售统计表,可打印值台人员销售业绩核实报表提供依据。

*账务系统共讷讷感的完整性。

一旦该系统正式运行,餐厅每日的营业账和全部往来客户的账务操作结算都将依靠计算机,该系统面对当前餐厅餐饮业各种负复杂的结算要求应具有很强的应变能力。

c#餐饮管理系统详细设计含所有窗体代码)

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 码。

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("&","&amp;");this.checkstr=this.checkstr.replaceAll(";","");this.checkstr=this.checkstr.replaceAll("'","");this.checkstr=this.checkstr.replaceAll("<","&lt;");this.checkstr=this.checkstr.replaceAll(">","&gt;");this.checkstr=this.checkstr.replaceAll("--","");this.checkstr=this.checkstr.replaceAll("\"\"","&quot;");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">&nbsp;</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">&nbsp;</td><td height="30" align="left"><input type="submit" name="Submit" value="登陆" />&nbsp; <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">&nbsp;</td></tr><tr><td>&nbsp;</td><td height="25">编号:<input name="r_no" type="text" id="r_no" size="10"/></td> <td>&nbsp;</td></tr><tr><td width="153" height="25">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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="注册" />&nbsp; <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>&nbsp;&nbsp;&nbsp;&nbsp;<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>&nbsp;&nbsp; <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">&nbsp;菜名:<input name="c_name" type="text" id="c_name" value="<%=rs.getString("c_name") %>" readonly/></td></tr><tr><td height="25">&nbsp;单位:<input name="c_danwei" type="text" id="c_danwei" value="<%=rs.getString("c_danwei") %>"/></td></tr><tr><td height="25">&nbsp;单价:<input name="c_danjia" type="text" id="c_danjia" value="<%=rs.getString("c_danjia") %>"/></td></tr><tr><td height="25">&nbsp;备注:<textarea name="c_beizhu" cols="40" rows="5"。

[餐饮管理]餐饮管理系统代码

(餐饮管理)餐饮管理系统代码餐饮管理系统代码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.商品”中。

食堂饭卡管理系统源代码

printf("\n\t\t输入密码:");
scanf("%s",&student[num].password);
printf("\n\t\t输入添加金额:");
scanf("%d",&student[num].balance);
num++;
printf("\n\t\t是否继续添加?(Y/N):");
void select(); /* 主菜单 */
void writetofile();
void addnewcard(); /*添加用户*/
void searchcard(); /*查询用户*/
printf("\n\t\t余额: %d",student[i].balance);
printf("\n\t\t密码: %s",student[i].password);
printf("\n\t\t************************************************");
if (getch()=='y')
addnewcard();
return;
}
void searchcard() /*查询用户 */
{
int mark=0;
int i;
int a=0;
char cardnumber[10];
printf("\n\t\t***************** 按学号查找 *****************\n");

C语言实现外卖管理系统

C语言实现外卖管理系统本文为大家分享了C语言外卖管理系统的具体代码,供大家参考,具体内容如下内容说明(废话):上学期写的课程设计,主题是外卖管理系统,希望可以模拟网上订餐,店家工作,专人管理的过程。

并实现注册与登录以及基本信息的输出,因为个人比较懒,一直没有整理上去,今天得空,要是得到大家的宝贵意见的话,会不胜荣幸。

重点内容三端登录:分别为管理员,用户以及店主;两端注册,分别为用户以及店铺,其中店铺的注册成功需要得到管理员的审核。

管理员端可以查看店铺信息,店铺信息修改(分为增删改查),处理申请店铺,和修改本人信息。

用户端分为用户相关(为用户本人对自己信息的操作),查看订单,查看菜品,购买菜品,以及订单排序。

管理员端为增添菜品,删除菜品,修改菜品,查看菜品以及业绩查看(统计总订单与总收入)。

另外:1. 店家注册需要的到管理员的认证,认证通过之后才可登录2. 密码修改需要输入旧的密码,三次错误可以找回密码,输入手机号,若手机号匹配得当,则可产生三位数的随机验证码,输入验证码即可修改。

3. 对于已超过三分钟的订单不能修改,因为已经配送4. 限制了用户的余额,当购买时余额不足时,需要进行账户的充值,而购买结束后,账户的余额也会相应的减少以下为功能模块图:以下为函数调用关系图:以下为整个代码:#include<stdio.h>#include<stdlib.h>#include<string.h> #include<windows.h> #include<time.h>#include<conio.h> void choose();//建立关于店铺的结构体typedef struct shop{char name[20];char phone[20];char address[30];char password[20];struct shop *next;}shop,*link_shop;//建立关于订单的结构体typedef struct food{char name[20];int type;int amount;int price;int total;char shop[20];char yonghu[20];char leibie[20];struct food *next;}food,*link_food;//建立关于用户的结构体typedef struct user{char name[20];char delivery[39];char password[15];char number[15];int score;struct user *next;}user,*link_user;typedef struct money{char person[20];char card[25];char mima[20];struct money *next;}money,*link_money;char yh[20];//用户设置全局变量char dp[20];//店铺设置全局变量time_t start,end;//函数声明void foodwrite(link_food LF); void shopwrite1(link_shop LS);void dingdanwrite(link_food LF);void user_moneywrite(link_user LM);void welcome(){int i=0;char a[52]="▲▼WELCOME TO RESTAURANT MANAGEMENT SYSTEM▲▼";//system("color 0a");printf("\n\n\n\n\t\t");while(a[i]){printf("%c",a[i]);Sleep(50);i++;}printf("\n\n\n\n\t\t");}void Exit(){int i=0;system("cls");char a[20]="LOVE you,byebye^_^";system("color 03");printf("\n\n\n\t\t\t");while(a[i]){printf("%c",a[i]);Sleep(100);i++;}}void ME(){system("color 0b");printf("\n\n\n\t\t☆★ W E L C O M E ☆★\n\n\t这里是外卖管理系统,请选择接下来的操作:");printf("\n\n\t\t\t1.登陆");printf("\t\t\t2.注册\t\t\t0.退出\n");}//主菜单(登陆或者注册)void MENU(){printf("\n\n\n\n\t\t\t\t\t================================\n");printf("\t\t\t\t\t 外卖管理系统 \n");printf("\t\t\t\t\t 1.管理员登陆 \n");printf("\t\t\t\t\t 2.用户登录 \n");printf("\t\t\t\t\t 3.店家登陆 \n");printf("\t\t\t\t\t 0.返回上一级 \n");printf("\t\t\t\t\t================================\n");}//管理员选项void MENU1(){system("color 0f");printf(" 温馨小提示:按5可以清屏哦^-^\n");printf("\n\n\t\t\t\t\t1.查看店铺信息▲\n");printf("\t\t\t\t\t--------------\n");printf("\t\t\t\t\t2.店铺信息修改▼\n");printf("\t\t\t\t\t--------------\n");printf("\t\t\t\t\t3.处理申请店铺▲\n");printf("\t\t\t\t\t--------------\n");printf("\t\t\t\t\t4.修改本人信息▼\n");printf("\t\t\t\t\t--------------\n");printf("\t\t\t\t\t0.返回上一级▲\n");}//用户选项void MENU2(){system("color 0f");printf("\n\n\t\t\t\t 1.用户相关▲\t\t\t 5.购买菜品▼\n");printf("\t\t\t\t---------------\t\t\t---------------\n");printf("\t\t\t\t 2.查看订单▲\t\t\t 6.订单排序▼\n");printf("\t\t\t\t---------------\t\t\t---------------\n");printf("\t\t\t\t 3.查看菜品▲\t\t\t 0.返回上级▼\n");printf("\t\t\t\t---------------\t\t\t---------------\n");printf("\t\t\t\t 4.修改订单▲\n");}//店主选项void MENU3(){system("color 0f");printf("\n\n\n\t\t\t ________ Shop Version _______\n");printf("\t\t\t| |\n");printf("\t\t\t| 1.添加菜品 |\n");printf("\t\t\t| 2.修改菜品 |\n");printf("\t\t\t| 3.删除菜品 |\n");printf("\t\t\t| 4.查看菜品 |\n");printf("\t\t\t| 5.查看业绩 |\n");printf("\t\t\t| 0.返回上一级 |\n");printf("\t\t\t|_____________________________|\n"); }//建立关于单链表void *creatf(){int i=0,n;link_food LF;food *s,*r;char a[10];//srand((unsigned)time(NULL));//产生随机数的种子LF=(food *)malloc(sizeof(food));LF->next=NULL;r=LF;while(1){printf("请输入菜的名称:");scanf("%s",a);if(strcmp(a,"0")!=0){s=(food *)malloc(sizeof(food));printf("请输入菜的单价:");scanf("%d",&s->price);printf("请输入菜的类别");scanf("%s",s->leibie);strcpy(s->name,a);s->total=(s->amount)*(s->price);r->next=s;s->next=NULL;r=s;}elsebreak;}foodwrite(LF);}shop *creats(){char a[30],b[20],c[15],d[20];link_shop LS;shop *s,*r;LS=r=(shop *)malloc(sizeof(shop));LS->next=NULL;r=LS;while(1){printf("请输入店铺信息:\n");printf("\t\t●店铺名称:");scanf("%s",a);printf("\n\t\t●店铺电话:");scanf("%s",b);if(strcmp(b,"0")!=0){printf("\n\t\t●店铺地址:");scanf("%s",c);printf("\n\t\t●店铺密码:");scanf("%s",d);s=(shop *)malloc(sizeof(shop));strcpy(s->name,a);strcpy(s->phone,b);strcpy(s->address,c);strcpy(s->password,d);r->next=s;s->next=NULL;r=s;}elsebreak;}return LS;}void Outputshop(link_shop Ls){int n=0;shop *p,*u;p=Ls->next;system("cls");printf("入驻的商家如下:\n");printf("\t\t\t\t-------------------------------------------\n"); printf("\t\t\t\t店铺名称\t店铺电话\t店铺地址\n");printf("\t\t\t\t-------------------------------------------\n"); while(p){printf("\t\t\t\t%8s\t%8s\t%7s\n",p->name,p->phone,p->address); printf("\t\t\t\t-------------------------------------------\n"); p=p->next;}for(u =Ls->next; u != NULL;u = u->next)n++;printf("\t\t\t\t合计\t\t\t\t%d个\n",n);printf("\t\t\t\t-------------------------------------------\n"); }void Outputfood(link_food LF){food *s;s=LF->next;int sum=0;printf("订单如下:\n");printf("\t----------------------------------------------------------------------------------------------------\n");printf("\t菜名\t\t数量/份\t\t单价/元\t\t总价/元\t\t店铺\t\t订单号\t\t用户名\n");printf("\t----------------------------------------------------------------------------------------------------\n");for(s=LF->next;s!=NULL;s=s->next){if(strcmp(s->yonghu,yh)==0){printf("\t%-8s\t%-8d\t%-8d\t%-8d\t%-10s\t%-10d\t%s\n",s->name,s->amou nt,s->price,s->total,s->shop,s->type,s->yonghu);printf("\t----------------------------------------------------------------------------------------------------\n");sum=sum+s->total;}}printf("\t累计输出/元\t\t\t\t\t\t\t%d\n",sum);printf("\t----------------------------------------------------------------------------------------------------\n");if(sum==0){printf("○您还没有订单呢,快去购买吧φ(>ω<*) ");printf("\n\t\t\t\t\t->");Sleep(1000);printf("->");Sleep(1000);printf("->");Sleep(1000);system("cls");MENU2();return;}}void outputfood(link_food LF){food *p;p=LF->next;printf("\n\t\t\t 菜谱 ");printf("\n\t\t\t--------------------------------------------------\n" );printf("\t\t\t菜名菜价店铺菜系\n");printf("\t\t\t---------------------------------------------------\n") ;while(p){printf("\t\t\t%-13s%-12d%-14s%s\n",p->name,p->price,p->shop,p->leibie );printf("\t\t\t---------------------------------------------------\n") ;p=p->next;}}//充值user* addmoney(user *u){int n;char y;char a[20];FILE *fp;link_money LY;money *p,*r;printf("您账户里的余额为:%d",u->score);printf("是否充值?Y/else");fflush(stdin);//清除缓存y=getchar();if(y=='Y'){fp=fopen("yue.txt","rt");LY=r=(money *)malloc(sizeof(money));LY->next=NULL;while(!feof(fp)){p=(money *)malloc(sizeof(money));fscanf(fp,"%s %s %s\n",p->person,p->card,p->mima); p->next=NULL;r->next=p;r=p;}fclose(fp);p=LY->next;while(1){if(strcmp(yh,p->person)==0){break;}elsep=p->next;}printf("充值的钱数?");scanf("%d",&n);printf("请输入支付密码:");scanf("%s",a);if(strcmp(p->mima,a)==0){u->score=(u->score+n);printf("已充值");}elseprintf("\t\t×密码错误,充值失败");}elseprintf("已放弃充值");return u;}//按工号排序void name_sort(link_shop LS){int i,j,n;n = 0; //记录店铺总数;shop *u,*q,*p;for(u =LS->next; u != NULL;u = u->next)n++;//采用冒泡法对各个节点按姓名升序for(i=1;i<=n;i++){u =LS;for(j=0;j<n-i;j++){p = u->next;q = p->next;if(strcmp(p->name,q->name) > 0 || strcmp(p->name,q->name) == 0) {u->next = q;p->next = q->next;q->next = p;}u = u->next;}}printf("\t排序后店铺信息\n");Outputshop(LS);return;}void address_sort(link_shop LS){int i,j,n;n = 0; //记录店铺总数;shop *u,*q,*p;for(u =LS->next; u != NULL;u = u->next)n++;//采用冒泡法对各个节点按地址升序for(i=1;i<=n;i++){u =LS;for(j=0;j<n-i;j++){p = u->next;q = p->next;if(strcmp(p->address,q->address) > 0 || strcmp(p->address,q->address) == 0){u->next = q;p->next = q->next;q->next = p;}u = u->next;}}printf("\t\t\t\t地址排序后店铺信息\n");Outputshop(LS);return;}void dingdan_name_sort(link_food LF) //按订单食物名称排序{int i,j,n;n = 0; //记录店铺总数;food *u,*q,*p;for(u =LF->next; u != NULL;u = u->next)n++;//采用冒泡法对各个节点按姓名升序for(i=1;i<=n;i++){u =LF;for(j=0;j<n-i;j++){p = u->next;q = p->next;if(strcmp(p->name,q->name) > 0 || strcmp(p->name,q->name) == 0) {u->next = q;p->next = q->next;q->next = p;}u = u->next;}}Outputfood(LF);return;}void dingdan_total_sort(link_food LF) //按订单总价从高到低排序{int i,j,n;n = 0; //记录店铺总数;food *u,*q,*p;for(u =LF->next; u != NULL;u = u->next)n++;//采用冒泡法对各个节点按姓名升序for(i=1;i<=n;i++){u =LF;for(j=0;j<n-i;j++){p = u->next;q = p->next;if(p->total>q->total){u->next = q;p->next = q->next;q->next = p;}u = u->next;}}Outputfood(LF);return;}void dingdandelete(link_food Lf){food *p,*n;p=Lf;n=p->next;int m;char a;printf("请输入你所想删除的订单序号:");scanf("%d",&m);while(n){if(m==n->type){if(strcmp(n->shop,dp)==0){p->next=n->next;//foodwrite(Lf);dingdanwrite(Lf);break;}elseprintf("不好意思,您没有权限删除\n"); break;}else{p=p->next;n=n->next;}}}food *dingdanread(){FILE *fp;link_food LF,r,s;fp=fopen("dingdan.txt","rt");if(fp==NULL){printf("查看订单失败");return 0;}LF=r=(food *)malloc(sizeof(food));r->next=NULL;while(!feof(fp)){s=(food *)malloc(sizeof(food));fscanf(fp,"%s %d %d %d %s %d %s\n",s->name,&s->amount,&s->price,&s->t otal,s->shop,&s->type,s->yonghu);r->next=s;s->next=NULL;r=s;}return LF;}void scorefind(link_food LF){int sum=0;food *p;p=LF->next;system("cls");printf("\n\n\n\t\t\t产生的订单如下:\n");printf("----------------------------------------------------------------------------------------------------\n");printf(" 菜品名称 \t菜品数量\t菜品单价\t菜品总价\t店铺名称\t订单号 \t\t用户名\n");printf("----------------------------------------------------------------------------------------------------\n");while(p)if(strcmp(p->shop,dp)==0){printf(" %7s%14d%15d%16d%16s%15d%18s\n",p->name,p->amount,p->price,p ->total,p->shop,p->type,p->yonghu);printf("----------------------------------------------------------------------------------------------------\n");sum=sum+p->total;}p=p->next;}printf(" 合计/元:\t\t\t\t\t\t\t累计收入%d\n",sum);printf("----------------------------------------------------------------------------------------------------\n");if(sum==0)printf("\t\t●您店里的菜还没有人购买哦,应该反思啦\n");}food * foodread()//读取{link_food LF;food *s,*r;LF=r=(food *)malloc(sizeof(food));LF->next=NULL;FILE *fp;fp=fopen("food.txt","rt");if(fp==NULL){printf("不能打开此文件");exit(1);}while(!feof(fp))//判断文件指针是否处于文件结束位置,若是,返回1,非,返回0{s=(food *)malloc(sizeof(food));fscanf(fp,"%s %d %s %s\n",s->name,&s->price,s->shop,s->leibie); r->next=s;s->next=NULL;r=s;}fclose(fp);return LF;money * moneyread()//读取{link_money LM;money *s,*r;LM=r=(money *)malloc(sizeof(money));LM->next=NULL;FILE *fp;fp=fopen("yue.txt","rt");if(fp==NULL){printf("不能打开此文件");exit(1);}while(!feof(fp))//判断文件指针是否处于文件结束位置,若是,返回1,非,返回0{s=(money *)malloc(sizeof(money));fscanf(fp,"%s %s %s\n",s->person,s->card,s->mima);r->next=s;s->next=NULL;r=s;}fclose(fp);return LM;}shop * shopread(){link_shop LS;shop *s,*r;LS=r=(shop *)malloc(sizeof(shop));r->next=NULL;FILE *fp;fp=fopen("shop.txt","rt");if(fp==NULL){printf("不能打开此文件");exit(1);}while(!feof(fp))//判断文件指针是否处于文件结束位置,若是,返回1,非,返回0{s=(shop *)malloc(sizeof(shop));s->next=NULL;fscanf(fp,"%s %s %s %s\n",s->name,s->phone,s->address,s->password); r->next=s;r=s;}fclose(fp);return LS;}user * userread(){link_user LU;user *s,*r;LU=r=(user *)malloc(sizeof(user));r->next=NULL;FILE *fp;fp=fopen("users.txt","rt");if(fp==NULL){printf("不能打开此文件");exit(1);}while(!feof(fp))//判断文件指针是否处于文件结束位置,若是,返回1,非,返回0{s=(user *)malloc(sizeof(user));s->next=NULL;fscanf(fp,"%s %s %s %s %d\n",s->name,s->delivery,s->password,s->numbe r,&s->score);r->next=s;r=s;}fclose(fp);return LU;}void deleteshop(link_shop LS){int i=0;shop *p,*q;p=LS;q=p->next;char m[20];char a;printf("请输入你所想删除的店铺名称或者电话:");scanf("%s",m);while(q){if(strcmp(m,q->name)==0||strcmp(m,q->phone)==0) {i++;p->next=q->next;shopwrite1(LS);return;}else{p=p->next;q=q->next;}}if(i==0){printf("没有此店铺,无法删除\n");return;}}void deletedingdan(link_food Lf){food *p,*n;p=Lf;n=p->next;int m,i=0;char a;printf("请输入你所想删除的订单号:");scanf("%d",&m);while(n){if(n->type==m){if(strcmp(n->yonghu,yh)==0){p->next=n->next;i++;foodwrite(Lf);}elseprintf("不好意思,您没有权限删除\n");break;}else{p=p->next;n=n->next;}}if(i==0){printf("\t没有此订单,无法删除\n");return;}}void purchase(){link_food Lf;money *LM,*mo;user *lu,*us;FILE *fp;char a[20],b[20],mi[20];char y;int i=0;printf("\t\t◇您想吃啥呢?");scanf("%s",a);Lf=foodread();food *p;p=Lf->next;srand((unsigned)time(NULL));//订单号的种子while(p!=NULL){if(strcmp(p->name,a)==0||strcmp(p->leibie,a)==0){// printf("%s\t%d\t%s\n",p->name,p->price,p->shop); i++;}p=p->next;}if(i==0){printf("\t\t\t×不好意思,还没有此菜呢\n");system("pause");system("cls");MENU2();return;}else{p=Lf->next;printf("\n\t\t\t--------------------------------------------------\n" );printf("\t\t\t菜名菜价店铺菜系\n");printf("\t\t\t---------------------------------------------------\n") ;while(p){if(strcmp(p->leibie,a)==0||strcmp(p->name,a)==0){printf("\t\t\t%-13s%-12d%-14s%s\n",p->name,p->price,p->shop,p->leibie );printf("\t\t\t---------------------------------------------------\n") ;}p=p->next;}}printf("\t\t◇请输入要购买的店铺:");scanf("%s",b);lu=userread();us=lu->next;while(us){if(strcmp(yh,us->name)==0)break;elseus=us->next;}//找出要购买的用户信息LM=moneyread();mo=LM->next;i=0;while(mo){if(strcmp(yh,mo->person)==0){i++;break;}elsemo=mo->next;}//找出用户的银行卡信息if(i==0){printf("\t\t×您还没有绑定银行卡哦,不能购买的");return;}p=Lf->next;i=0;while(p){if(strcmp(p->name,a)==0||strcmp(p->leibie,a)==0){if(strcmp(p->shop,b)==0){printf("\t\t◇请输入要购买的数量");scanf("%d",&p->amount);if(p->amount!=0){i++;p->total=(p->amount)*(p->price);p->type=rand()%900+100;if((us->score)<p->total){printf("\t\t×您的账号余额不足,请先充值\n"); system("pause");system("cls");MENU2();return;}printf("\t\t●确认购买?Y/else");fflush(stdin);y=getchar();if(y=='Y'){printf("请输入支付密码:");scanf("%s",mi);if(strcmp(mi,mo->mima)==0){fp=fopen("dingdan.txt","at");if(fp==NULL)printf("\t\t\t\t×购买失败\n");//因文件无法打开而失败 else{fprintf(fp,"%s %d %d %d %s %d %s\n",p->name,p->amount,p->price,p->tot al,p->shop,p->type,yh);fclose(fp);us->score=(us->score)-(p->total);user_moneywrite(lu);printf("\t\t\t\t√购买成功,请耐心等待配送\n");start = time(NULL);//计时system("pause");system("cls");MENU2();return;}}else{printf("\t\t×密码错误,购买失败");system("pause");system("cls");MENU2();return;}}else{printf("\t\t\t×已放弃购买");system("pause");system("cls");MENU2();return;}}else{printf("\t\t\t×请输入正确的数量");system("pause");system("cls");MENU2();return;}}}p=p->next;}if(i==0){printf("\t\t×请输入表中的店铺名称哦\n");system("pause");system("cls");MENU2();}}void foodwrite(link_food LF)//保存{FILE *fp;food *p;char a;printf("确认保存?(Y/else)");scanf("%*c%c",&a);if(a=='Y'){fp=fopen("food.txt","at");if(fp==NULL)printf("错误!无法打开");for(p=LF->next;p!=NULL;p=p->next)fprintf(fp,"%s %d %s %s\n",p->name,p->price,dp,p->leibie); printf("修改成功\n");fclose(fp);return;}elseprintf("已放弃修改");}void foodwrite1(link_food LF){FILE *fp;food *p;char a;printf("确认保存?(Y/else)");scanf("%*c%c",&a);if(a=='Y'){fp=fopen("food.txt","wt");if(fp==NULL)printf("错误!无法打开");for(p=LF->next;p!=NULL;p=p->next)fprintf(fp,"%s %d %s %s\n",p->name,p->price,p->shop,p->leibie); printf("修改成功\n");fclose(fp);return;}elseprintf("已放弃修改");}// void foodwrite2(link_food LF)// {// FILE *fp;// food *p;// char a;// printf("确认保存?(Y/else)");// scanf("%*c%c",&a);// if(a=='Y')// {// fp=fopen("food.txt","wt");// if(fp==NULL)// printf("错误!无法打开");// for(p=LF->next;p!=NULL;p=p->next)// fprintf(fp,"%s %d %s %s\n",p->name,p->price,p->shop,p->leibie); // printf("修改成功\n");// fclose(fp);// return;// }// else// printf("已放弃修改");// }void dingdanwrite(link_food LF){FILE *fp;food *p;char a;printf("确认保存?(Y/else)");scanf("%*c%c",&a);if(a=='Y'){fp=fopen("dingdan.txt","wt");if(fp==NULL)printf("错误!无法打开");for(p=LF->next;p!=NULL;p=p->next)fprintf(fp,"%s %d %d %d %s %d %s\n",p->name,p->amount,p->price,p->tot al,p->shop,p->type,p->yonghu);printf("修改成功\n");fclose(fp);return;}elseprintf("已放弃修改");}void shopwrite1(link_shop LS){FILE *fp;shop *p;char a;printf("确认保存?(Y/else)");scanf("%*c%c",&a);if(a=='Y'){fp=fopen("shop.txt","wt");if(fp==NULL)printf("错误!无法打开");for(p=LS->next;p!=NULL;p=p->next)fprintf(fp,"%s %s %s %s\n",p->name,p->phone,p->address,p->password); printf("保存成功\n");fclose(fp);return;}elseprintf("已放弃");}void shopwrite2(link_shop LS){FILE *fp;shop *p;char a;printf("是否将信息保存至文件里?(Y/else)");scanf("%*c%c",&a);if(a=='Y'){fp=fopen("shop.txt","at");if(fp==NULL)printf("错误!无法打开");for(p=LS->next;p!=NULL;p=p->next)fprintf(fp,"%s %s %s\n",p->name,p->phone,p->address);printf("修改成功\n");fclose(fp);return;}elseprintf("已放弃修改");}void userwrite(link_user LU){FILE *fp;user *p;char a;// printf("请确认?(Y/else)");// scanf("%*c%c",&a);// if(a=='Y')// {fp=fopen("users.txt","wt");if(fp==NULL)printf("错误!无法打开");for(p=LU->next;p!=NULL;p=p->next)fprintf(fp,"%s %s %s %s %d\n",p->name,p->delivery,p->password,p->numb er,p->score);printf("操作成功\n");fclose(fp);return;// }//else//printf("已放弃注册");}void user_moneywrite(link_user LM){FILE *fp;user *p;char a;// printf("是否将信息保存至文件里?(Y/else)");// scanf("%*c%c",&a);// if(a=='Y')// {fp=fopen("users.txt","wt");if(fp==NULL)printf("错误!无法打开");for(p=LM->next;p!=NULL;p=p->next)fprintf(fp,"%s %s %s %s %d\n",p->name,p->delivery,p->password,p->numb er,p->score);//printf("注册成功\n");fclose(fp);//return;// }//else//printf("已放弃注册");}void userwrite2(link_user LU){FILE *fp;user *p;char a;printf("是否将信息保存至文件里?(Y/else)");scanf("%*c%c",&a);if(a=='Y'){fp=fopen("users.txt","at");if(fp==NULL)printf("错误!无法打开");for(p=LU->next;p!=NULL;p=p->next)fprintf(fp,"%s %s %s %s %d\n",p->name,p->delivery,p->password,p->numb er,p->score);printf("注册成功\n");fclose(fp);return;}elseprintf("已放弃注册");}void increaseshop(link_shop LS){char a[30],b[20],c[15],d[20];shop *s;printf("请输入你所想加入的店铺信息:\n");printf("\t\t●店铺名称:");scanf("%s",a);printf("\n\t\t●店铺电话:");scanf("%s",b);printf("\n\t\t●店铺地址:");scanf("%s",c);printf("\n\t\t●店铺密码:");scanf("%s",d);if(strcmp(a,"0")!=0){s=(shop *)malloc(sizeof(shop));strcpy(s->name,a);strcpy(s->phone,b);strcpy(s->address,c);strcpy(s->password,d);}s->next=LS->next;LS->next=s;shopwrite1(LS);}void shopfind(link_shop LS){shop *p;char E[20];p=LS->next;printf("请输入店铺的名称:");scanf("%s",E);while(strcmp(p->name,E)!=0&&(p->next)!=NULL){p=p->next;}if((p->next)==NULL){printf("没有此店铺");return;}printf("您所查询的店铺信息为:\n名称\t电话\t地址\n"); printf("%s %s %s",p->name,p->phone,p->address);}void registerdeal(){int q;FILE *fp;char y;link_shop head;shop *r,*p;head=r=(shop *)malloc(sizeof(shop));r->next=NULL;fp=fopen("shenqing.txt","rt");if(fp==NULL){printf("发生错误,无法打开文件");return;}if((y=fgetc(fp))==EOF){printf("目前没有需要处理的信息\n");system("pause");system("cls");MENU1();return;}else{while(!feof(fp)){p=(shop *)malloc(sizeof(shop));fscanf(fp," %s %s %s %s \n",p->name,p->phone,p->address,p->password);r->next=p;p->next=NULL;r=p;}for(p=head->next;p!=NULL;p=p->next)printf("%s %s %s\n",p->name,p->phone,p->address);printf("是否同意注册?Y/else");scanf("%*c%c",&y);if(y=='Y'){fp=fopen("shop.txt","at");if(fp==NULL)printf("文件不存在,打开错误\n");for(p=head->next;p!=NULL;p=p->next)fprintf(fp,"% s %s %s %s \n",p->name,p->phone,p->address,p->password);fclose(fp);}}printf("处理成功");fp=fopen("shenqing.txt","wt");fclose(fp);}void MENU1_choose(){int n,m,q;char a[20],b[20],c[20],d[20];char y;FILE *fp,*fa;shop *p;shop sq;link_shop LS;link_user LU;LS=shopread();while(1){printf("请选择你想所想进行的选项:\n");scanf("%d",&n);if(n==1){Outputshop(LS);printf("是否进行排序?Y/else");fflush(stdin);y=getchar();if(y=='Y'){system("cls");printf("\n\n\n\t\t\t●1.按店铺名称排序\n"); printf("\t\t\t●2.按店铺地址排序\n");scanf("%d",&m);if(m==1)name_sort(LS);if(m==2)address_sort(LS);printf("1.退出\t2.返回");scanf("%d",&m);if(m==1)exit(0);else{system("cls");MENU1();continue;}}。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 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}。

相关文档
最新文档