1、小型餐馆管理系统一:用例图1.记录预约 接待员输入要预约的日期;系统显示该日的预约;接待员输入顾客的姓名和电话,预约的时间,用餐人数和餐桌号;如果输入的预约用餐人数多于餐桌能容纳的人类,于是系统发出一个警告信息询问用户是否想要继续预约;如果用户回答是,用例将不进行预约而终止;如果用户回答否,预约将被输入,并附有一个警告标志。2.取消预约 接待员选择要求的预约;接待员取消该预约;系统询问接待员确认取消预约;接待员如果回答是,系统记录取消并更新显示。接待员如果回答否,系统则不进行任何操作。3.修改预约 接待员执行修改预约;接待员重新输入顾客姓名和电话号码、预定的时间、用餐人数以及预留的餐桌;系统询
2、问接待员是否要更改预约;接待员如果回答是,系统则记录修改并更新预约,接待员如果回答否,系统则不进行任何操作。4、调换餐桌 侍者领班选择需要的预约;侍者领班改变该预约的餐桌分配;系统询问侍者领班确认调换;侍者领班如果回答是;系统则记录改变并更新显示,侍者领班如果回答否,系统则不进行任何操作。5、预约顾客到达 侍者领班执行显示预约,侍者领班输入时间、用餐人数和分配给顾客的餐桌;系统显示出来相关的预约信息。6、未预约顾客到达 侍者领班执行显示预约,侍者领班输入时间、用餐人数和分配给顾客的餐桌;系统显示没有相关预约,系统接着发出一个信息询问用户是否想要进行预约;如果用户回答是,则系统记录预约并更新显示
3、;如果用户回答否,则系统不进行任何操作。二.设计类:1.Cutomer类(顾客): 进行预定的人。属性类型意义nameCHAR名字phoneNuberCHAR电话号码2.Reservation类(预订):提前预约一个特定时间的晚餐。属性类型意义ReservationCHAR预订coversCHAR预订将来用餐的人数dateCHAR用餐日期timeCHAR用餐时间3.Table类(餐桌):预订餐桌号属性类型意义placesCHAR餐桌号4.WalkIn(未预约):没有提前进行的预三:顺序图1.记录预约用例的顺序图描述:2.修改预约用例的顺序图描述:3.取消预约用例的顺序图描述:4.调换餐桌用例的
4、顺序图描述:5.预约顾客到达用例的顺序图描述:6.未预约顾客到达用例的顺序图描述:7.显示预约用例的顺序图描述:四:操作界面主界面:二级界面:五:餐馆管理系统代码1 using System;2using System.Collections.Generic;3using System.ComponentModel;4using System.Data;5using System.Drawing;6using System.Text;7using System.Windows.Forms;8using System.Collections;9namespace 餐饮管理系统10.11 publ
5、ic 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. 餐桌类型Bind
6、ingSource.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 / T
7、ODO: 这行代码将数据加载到表“dieteticManagementDataSet.Vip”中。您可以根据需要移动或移除它。32 this.vipTableAdapter.Fill(this.dieteticManagementDataSet.Vip);33 34 / TODO: 这行代码将数据加载到表“dieteticManagementDataSet.餐桌编号”中。您可以根据需要移动或移除它。35 this.餐桌编号TableAdapter.Fill(this.dieteticManagementDataSet.餐桌编号);36 / TODO: 这行代码将数据加载到表“dieteticM
8、anagementDataSet.食品类别”中。您可以根据需要移动或移除它。37 this.食品类别TableAdapter.Fill(this.dieteticManagementDataSet.食品类别);38 / TODO: 这行代码将数据加载到表“dieteticManagementDataSet.商品”中。您可以根据需要移动或移除它。3940 / TODO: 这行代码将数据加载到表“dieteticManagementDataSet.餐桌”中。您可以根据需要移动或移除它。41 this.餐桌TableAdapter.Fill(this.dieteticManagementDataSe
9、t.餐桌);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
10、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.GetRoomCl
11、ass();61 餐桌类型ComboBox.Items.Clear();62 for (int i = 0; i sdata.Length; i+)63 餐桌类型ComboBox.Items.Add(sdatai);64 6566 private void 餐桌BindingNavigatorSaveItem_Click(object sender, EventArgs e)67 .68 this.Validate();69 this.餐桌BindingSource.EndEdit();70 this.餐桌TableAdapter.Update(this.dieteticManagementD
12、ataSet.餐桌);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 s
13、data = Program.DBOpertor.GetRoomClass();81 for (int i = 0; i sdata.Length; i+)82 f. 餐桌类型ComboBox.Items.Add(sdatai);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
14、.91 string no = 餐桌DataGridView.CurrentRow.Cells0.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.Cells0.Value.ToString();99 using (frm餐桌 f = new frm餐桌(this.
15、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(sdatai);106 f.ShowDialog();107 108 109 110111 pri
16、vate 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) = Dial
17、ogResult.Yes)122 .123 string no = 餐桌类型DataGridView.CurrentRow.Cells0.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.Cells0.Value.ToString();131 using
18、 (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 14414
19、5 private void 商品类型删除_Click(object sender, EventArgs e)146 .147 if (MessageBox.Show(确定要删除吗?, 删除确定, MessageBoxButtons.YesNo) = DialogResult.Yes)148 .149 string no = 商品类型DataGridView.CurrentRow.Cells0.Value.ToString();150 this.dieteticManagementDataSet.食品类别.Rows.Find(no).Delete();151 152 153154 privat
20、e void 商品类型修改_Click(object sender, EventArgs e)155 .156 string no = 商品类型DataGridView.CurrentRow.Cells0.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, E
21、ventArgs 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 Dat
22、aTable BigClass = Program.DBOpertor.GetBigClass();175 string SBigClass;176 for (int i = 0; i BigClass.Rows.Count; i+)177 .178 SBigClass = BigClass.Rowsi食品类别.ToString();179 f.食品类别ComboBox.Items.Add(SBigClass);180 181 f.ShowDialog();182 183 184185 private void 餐桌编号删除_Click(object sender, EventArgs e)1
23、86 .187 if (MessageBox.Show(确定要删除吗?, 删除确定, MessageBoxButtons.YesNo) = DialogResult.Yes)188 .189 string no = 餐桌编号DataGridView.CurrentRow.Cells0.Value.ToString();190 this.dieteticManagementDataSet.餐桌编号.Rows.Find(no).Delete();191 192 193194 private void 餐桌编号修改_Click(object sender, EventArgs e)195 .196
24、string no = 餐桌编号DataGridView.CurrentRow.Cells0.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.餐桌编号Binding
25、Source.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 privat
26、e 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.dieteticManagementDataS
27、et.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.Cells0.Value.ToString();2
28、39 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, Ev
29、entArgs e)250 .251 if (MessageBox.Show(确定要删除吗?, 删除确定, MessageBoxButtons.YesNo) = DialogResult.Yes)252 .253 string no = vipDataGridView.CurrentRow.Cells0.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 .
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1