您好,欢迎访问三七文档
餐饮管理系统代码1usingSystem;2usingSystem.Collections.Generic;3usingSystem.ComponentModel;4usingSystem.Data;5usingSystem.Drawing;6usingSystem.Text;7usingSystem.Windows.Forms;8usingSystem.Collections;9namespace餐饮管理系统10...{11publicpartialclassfrmManagement:Form12...{13ArrayListRoomStatus=newArrayList();14ArrayListVipClass=newArrayList();15publicfrmManagement()16...{17InitializeComponent();18}1920privatevoid房间类型BindingNavigatorSaveItem_Click(objectsender,EventArgse)21...{22this.Validate();23this.房间类型BindingSource.EndEdit();24this.房间类型TableAdapter.Update(this.dieteticManagementDataSet.房间类型);25}2627privatevoidfrmManagement_Load(objectsender,EventArgse)28...{29//TODO:这行代码将数据加载到表“dieteticManagementDataSet.管理员”中。您可以根据需要移动或移除它。30this.管理员TableAdapter.Fill(this.dieteticManagementDataSet.管理员);31//TODO:这行代码将数据加载到表“dieteticManagementDataSet.Vip”中。您可以根据需要移动或移除它。32this.vipTableAdapter.Fill(this.dieteticManagementDataSet.Vip);3334//TODO:这行代码将数据加载到表“dieteticManagementDataSet.餐牌”中。您可以根据需要移动或移除它。35this.餐牌TableAdapter.Fill(this.dieteticManagementDataSet.餐牌);36//TODO:这行代码将数据加载到表“dieteticManagementDataSet.食品类别”中。您可以根据需要移动或移除它。37this.食品类别TableAdapter.Fill(this.dieteticManagementDataSet.食品类别);38//TODO:这行代码将数据加载到表“dieteticManagementDataSet.商品”中。您可以根据需要移动或移除它。3940//TODO:这行代码将数据加载到表“dieteticManagementDataSet.餐房”中。您可以根据需要移动或移除它。41this.餐房TableAdapter.Fill(this.dieteticManagementDataSet.餐房);42//TODO:这行代码将数据加载到表“dieteticManagementDataSet.房间类型”中。您可以根据需要移动或移除它。43this.房间类型TableAdapter.Fill(this.dieteticManagementDataSet.房间类型);44VipClass.Add(普通会员);45VipClass.Add(中级会员);46VipClass.Add(高级会员);47RoomStatus.Add(可供);48RoomStatus.Add(预订);49RoomStatus.Add(占用);50RoomStatus.Add(停用);51RoomStatus.Add(脏台);52性别ComboBox.Items.Add(男);53性别ComboBox.Items.Add(女);54级别ComboBox.Items.Clear();55foreach(stringsinVipClass)56级别ComboBox.Items.Add(s);57餐台状态ComboBox.Items.Clear();58foreach(stringsinRoomStatus)59餐台状态ComboBox.Items.Add(s);60string[]sdata=Program.DBOpertor.GetRoomClass();61房间类型ComboBox.Items.Clear();62for(inti=0;isdata.Length;i++)63房间类型ComboBox.Items.Add(sdata[i]);64}6566privatevoid餐房BindingNavigatorSaveItem_Click(objectsender,EventArgse)67...{68this.Validate();69this.餐房BindingSource.EndEdit();70this.餐房TableAdapter.Update(this.dieteticManagementDataSet.餐房);71}7273privatevoidAdd_Click(objectsender,EventArgse)74...{75//newfrmAddAndModification(餐房DataGridView,this.dieteticManagementDataSet.餐房).Show();7677frm餐房f=newfrm餐房(this.dieteticManagementDataSet.餐房,Add);78foreach(stringsinRoomStatus)79f.餐台状态ComboBox.Items.Add(s);80string[]sdata=Program.DBOpertor.GetRoomClass();81for(inti=0;isdata.Length;i++)82f.房间类型ComboBox.Items.Add(sdata[i]);83f.ShowDialog();84//f.Dispose();85}8687privatevoidDelete_Click(objectsender,EventArgse)88...{89if(MessageBox.Show(确定要删除吗?,删除确定,MessageBoxButtons.YesNo)==DialogResult.Yes)90...{91stringno=餐房DataGridView.CurrentRow.Cells[0].Value.ToString();92this.dieteticManagementDataSet.餐房.Rows.Find(no).Delete();93}94}9596privatevoidModification_Click(objectsender,EventArgse)97...{98stringno=餐房DataGridView.CurrentRow.Cells[0].Value.ToString();99using(frm餐房f=newfrm餐房(this.dieteticManagementDataSet.餐房.Rows.Find(no),Modification))100...{101foreach(stringsinRoomStatus)102f.餐台状态ComboBox.Items.Add(s);103string[]sdata=Program.DBOpertor.GetRoomClass();104for(inti=0;isdata.Length;i++)105f.房间类型ComboBox.Items.Add(sdata[i]);106f.ShowDialog();107}108109}110111privatevoidbutton1_Click(objectsender,EventArgse)112...{113using(frm房间类型f=newfrm房间类型(this.dieteticManagementDataSet.房间类型,Add))114...{115f.ShowDialog();116}117}118119privatevoidbutton2_Click(objectsender,EventArgse)120...{121if(MessageBox.Show(确定要删除吗?,删除确定,MessageBoxButtons.YesNo)==DialogResult.Yes)122...{123stringno=房间类型DataGridView.CurrentRow.Cells[0].Value.ToString();124this.dieteticManagementDataSet.房间类型.Rows.Find(no).Delete();125}126}127128privatevoidbutton3_Click(objectsender,EventArgse)129...{130stringno=房间类型DataGridView.CurrentRow.Cells[0].Value.ToString();131using(frm房间类型f=newfrm房间类型(this.dieteticManagementDataSet.房间类型.Rows.Find(no),Modification))132...{133f.ShowDialog();134}135}136137privatevoid商品类型添加_Click(objectsender,EventArgse)138...{139using(frm商品类型f=newfrm商品类型(this.dieteticManagementDataSet.食品类别,Add))140...{141f.ShowDialog();142}143}144145privatevoid商品类型删除_Click(objectsender,EventArgse)146...{147if(MessageBox.Show(确定要删除吗?,删除确定,MessageBoxButtons.YesNo)==DialogResult.Yes)148...{149stringno=商品类型DataGridView.CurrentRow.Cells[0].Value.ToString();150this.dieteticManagementDataSet.食品类别.Rows.Find(no).Delete();151}152}153154privatevoid商品类型修改_Click(objectsender,EventArgse)155...{156stringno=商品类型DataGridView.CurrentRow.Cells[0].Value.ToString();157using(frm商品类型f=newfrm商品类型(this.dieteticManagementDataSet.食品类别.Rows.Find(no),Modification))158...{159f.ShowDialog();160}161}162163privatevoid商品类型保存_Click(objectsender,EventArgse)164...{165this.Validate();166this.食品类别BindingSource.EndEdit();167this.食品类别TableAdapter.Update(this.dieteticManagementDataSet.食品类别);168}169170privatevoid餐牌添加_Click(objectsender,EventArgse)17
本文标题:餐饮管理系统代码
链接地址:https://www.777doc.com/doc-352192 .html