(精编)餐饮管理系统代码大全餐饮管理系统代码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}。