餐飲管理系統(tǒng)課程設計_第1頁
餐飲管理系統(tǒng)課程設計_第2頁
餐飲管理系統(tǒng)課程設計_第3頁
餐飲管理系統(tǒng)課程設計_第4頁
餐飲管理系統(tǒng)課程設計_第5頁
已閱讀5頁,還剩34頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、計算機應用軟件課程設計報告計算機應用軟件課程設計報告項目名稱 餐飲管理系統(tǒng) 班級學號 姓 名 指導老師 完成日期 2011-12-25 目錄一、需求分析21.1數據需求21.2總體設計21.3流程圖2二、總體設計22.1登錄窗體的設計22.2注冊用戶界面設計22.3主窗體設計22.4基礎信息22.4.1基礎信息-桌臺信息22.4.2基礎信息職工信息22.5輔助工具22.6 系統(tǒng)維護22.6.1系統(tǒng)維護權限管理22.6.2系統(tǒng)維護添加用戶22.7系統(tǒng)設置22.7.1系統(tǒng)設置修改密碼22.7.2系統(tǒng)設置鎖定系統(tǒng)22.8幫助22.9快捷菜單22.9.1開臺22.9.2點加菜22.9.3消費查詢25.

2、9.4結賬2三、詳細設計23.1登錄部分代碼23.2主界面的代碼23.3職工信息查詢代碼23.4桌臺信息查詢代碼23.5輔助工具23.6修改密碼、添加用戶、注冊用戶功能代碼23.7桌臺基本信息(雙擊桌臺圖標后)代碼23.8開臺部分代碼23.9結賬部分代碼23.10點加菜部分代碼23.11消費查詢部分代碼23.12用戶權限管理代碼2四、單元測試與組裝測試2五、總結2六、參考文獻2一、需求分析隨著餐飲業(yè)的不斷發(fā)展,餐飲管理系統(tǒng)的內容對于決策者和管理者來說都非常重要。本系統(tǒng)主要包括桌臺顯示、消費查詢。人事檔案及權限等幾大部分,具有良好的用戶接口,使用方便,具有完善的查詢,對維護系統(tǒng)起到輔助決策的作用

3、,能及時、方便、靈動地進行查詢、修改、刪除等維護性操作。餐飲管理系統(tǒng)有足夠的存儲容量,滿足酒店每日營業(yè)的變動,另外,對于操作用戶有一定的管理,并對用戶的權限有一定的設置超級管理員擁有所有權限。經理除了系統(tǒng)維護外,其他操縱都可以,普通用戶只能實現輔助工具的使用權限。1.1數據需求tb_food-存儲食品的tb_foodtype-存儲食品的類別tb_waiter-存儲所有職員信息tb_user-存儲管理用戶信息tb_room-存儲餐廳桌臺信息tb_guestfood-存儲消費信息1.2總體設計餐飲管理系統(tǒng)輔助工具系統(tǒng)維護基礎信息幫助系統(tǒng)設置退出添加用戶鎖定系統(tǒng)修改密碼權限管理記事本計算器日歷職員信

4、息桌臺信息退出系統(tǒng)關于結賬消費查詢點加菜開臺單天總營業(yè)額的查詢桌臺1.3流程圖二、總體設計2.1登錄窗體的設計用戶信息tb_user系統(tǒng)編號id用戶名username用戶權限power用戶密碼userpwd用戶信息er圖點擊登錄進入主窗體,點擊注冊賬號則進入注冊用戶界面2.2注冊用戶界面設計默認注冊的用戶類型只能是一般用戶2.3主窗體設計2.4基礎信息2.4.1基礎信息-桌臺信息可實現添加加、修改有增加、刪除、查詢 桌臺信息的功能雙擊圖標是桌臺基本信息雙擊桌臺圖標顯2.4.2基礎信息職工信息2.5輔助工具2.5.1輔助工具日歷2.5.2輔助工具計算器2.5.3輔助工具記事本2.6 系統(tǒng)維護2.

5、6.1系統(tǒng)維護權限管理2.6.2系統(tǒng)維護添加用戶2.7系統(tǒng)設置2.7.1系統(tǒng)設置修改密碼2.7.2系統(tǒng)設置鎖定系統(tǒng)2.8幫助2.9快捷菜單2.9.1開臺2.9.2點加菜2.9.3消費查詢5.9.4結賬三、詳細設計3.1登錄部分代碼namespace mycyms /登陸界面 public partial class frmlogin :form public int m=0; public frmlogin() initializecomponent(); private void frmlogin_load_1(object sender, eventargs e) / system.win

6、dows.forms.control.top.get; txtname.focus(); private void txtpwd_keypress(object sender, keypresseventargs e) if (e.keychar = 13) btnsubmit_click(sender, e); /點擊登錄按鈕 private void btnsubmit_click(object sender, eventargs e) if (txtname.text = ) messagebox.show(請輸入用戶名, 警告, messageboxbuttons.ok, messag

7、eboxicon.warning); else sqlconnection conn = baseclass.baseclass.cycon(); conn.open(); sqlcommand cmd = new sqlcommand(select count(*) from tb_user where username= + txtname.text + and userpwd= + txtpwd.text + , conn); int i = convert.toint32(cmd.executescalar(); if (i 0) cmd = new sqlcommand(select

8、 * from tb_user where username= + txtname.text + , conn); sqldatareader sdr = cmd.executereader(); sdr.read(); string userpower = sdrpower.tostring().trim(); conn.close(); frmmain main = new frmmain(); main.power = userpower;/記錄登錄用戶的權限 main.names = txtname.text;/用戶名 /frmchangepwd.n / main.times = da

9、tetime.now.toshortdatestring();/只輸出日期 main.times = datetime.now.tostring();/記錄登錄時間 main.show(); this.hide(); else m+; if (m = 3) btnsubmit.enabled = false; messagebox.show(密碼錯誤3次,請退出!); else messagebox.show(用戶名或密碼錯誤); private void btconcel_click(object sender, eventargs e) application.exit(); /點擊注冊賬

10、號.i=2表示這冊用戶界面 private void button2_click(object sender, eventargs e) frmchangepwd a = new frmchangepwd(); a.i = 2; a.showdialog(); / 如果點擊用戶名文本框,里面的文本清空,用戶即可輸出用戶名 private void txtname_click(object sender, eventargs e) txtname.text = ; 3.2主界面的代碼namespace mycyms public partial class frmmain : form publ

11、ic frmmain() initializecomponent(); public sqldatareader sdr; public string power; public string names; public string times; private void frmmain_load(object sender, eventargs e) switch (power) case 0: toolstripstatuslabel12.text = 超級管理員; break; case 1: toolstripstatuslabel12.text = 經理; break; case

12、2: toolstripstatuslabel12.text = 一般用戶; break; toolstripstatuslabel15.text = names; toolstripstatuslabel14.text = times; if (power = 2) 系統(tǒng)維護toolstripmenuitem1.enabled = false; 基礎信息toolstripmenuitem1.enabled = false; if (power = 1) 系統(tǒng)維護toolstripmenuitem1.enabled = false; private void additems(string r

13、zt) if (rzt = 使用) lvdesk.items.add(sdrroomname.tostring(), 1); else lvdesk.items.add(sdrroomname.tostring(), 0); private void 開臺toolstripmenuitem_click(object sender, eventargs e) if (lvdesk.selecteditems.count != 0) string names = lvdesk.selecteditems0.subitems0.text; frmopen openroom = new frmopen

14、(); = names; openroom.showdialog(); else messagebox.show(請選擇桌臺); private void 點加菜toolstripmenuitem_click(object sender, eventargs e) if (lvdesk.selecteditems.count != 0) string names = lvdesk.selecteditems0.subitems0.text; frmjzd dc = new frmjzd(); dc.rname = names; dc.showdialog(); el

15、se messagebox.show(請選擇桌臺); private void 結賬toolstripmenuitem_click(object sender, eventargs e) if (lvdesk.selecteditems.count != 0) string names = lvdesk.selecteditems0.subitems0.text; frmpayoff payoff = new frmpayoff(); payoff.rname = names; payoff.showdialog(); else messagebox.show(請選擇桌臺); private

16、void frmmain_activated(object sender, eventargs e) lvdesk.items.clear(); sqlconnection conn = baseclass.baseclass.cycon(); conn.open(); sqlcommand cmd = new sqlcommand(select * from tb_room, conn); sdr = cmd.executereader(); while (sdr.read() string zt = sdrroomzt.tostring().trim(); additems(zt); co

17、nn.close(); private void 消費查詢toolstripmenuitem_click(object sender, eventargs e) if (lvdesk.selecteditems.count != 0) string names = lvdesk.selecteditems0.subitems0.text; frmserch serch = new frmserch(); serch.rname = names; serch.showdialog(); else messagebox.show(請選擇桌臺); private void lvdesk_double

18、click(object sender, eventargs e) frmdetatles details = new frmdetatles(); details.tablename = lvdesk.selecteditems0.subitems0.text; details.showdialog(); private void lvdesk_click(object sender, eventargs e) string names = lvdesk.selecteditems0.subitems0.text; sqlconnection conn = baseclass.basecla

19、ss.cycon(); conn.open(); sqlcommand cmd = new sqlcommand(select * from tb_room where roomname= + names + , conn); sqldatareader sdr = cmd.executereader(); sdr.read(); string zt = sdrroomzt.tostring().trim(); sdr.close(); if (zt = 使用) this.contextmenustrip1.items0.enabled = false; this.contextmenustr

20、ip1.items1.enabled = true; this.contextmenustrip1.items3.enabled = true; this.contextmenustrip1.items5.enabled = true; this.contextmenustrip1.items6.enabled = true; if (zt = 待用) this.contextmenustrip1.items0.enabled = true; this.contextmenustrip1.items1.enabled = false; this.contextmenustrip1.items3

21、.enabled = false; this.contextmenustrip1.items5.enabled = false; this.contextmenustrip1.items6.enabled = false; conn.close(); private void 添加用戶toolstripmenuitem1_click(object sender, eventargs e) frmchangepwd pwd = new frmchangepwd(); /s = names; pwd.i = 1; pwd.showdialog(); private void 退出t

22、oolstripmenuitem1_click(object sender, eventargs e) if (messagebox.show(確定退出本系統(tǒng)嗎?, 提示, messageboxbuttons.okcancel, messageboxicon.exclamation) = dialogresult.ok) application.exit(); private void 幫助toolstripmenuitem1_click(object sender, eventargs e) frmabout ab = new frmabout(); ab.showdialog(); pri

23、vate void 鎖定系統(tǒng)toolstripmenuitem1_click(object sender, eventargs e) frmlock m = new frmlock(); m.showdialog(); private void 權限管理toolstripmenuitem1_click(object sender, eventargs e) usermanager power = new usermanager(); power.showdialog(); private void 日歷toolstripmenuitem1_click(object sender, eventa

24、rgs e) frmcalender calender = new frmcalender(); calender.showdialog(); private void 計算器toolstripmenuitem1_click(object sender, eventargs e) system.diagnostics.process.start(calc.exe); private void 記事本toolstripmenuitem1_click(object sender, eventargs e) system.diagnostics.process.start(notepad.exe);

25、 private void 桌臺信息toolstripmenuitem1_click(object sender, eventargs e) frmdesk desk = new frmdesk(); desk.showdialog(); private void 職員信息toolstripmenuitem1_click(object sender, eventargs e) frmuser users = new frmuser(); users.showdialog(); 3.3職工信息查詢代碼namespace mycyms public partial class frmuser :

26、form public frmuser() initializecomponent(); private void btquery_click(object sender, eventargs e) binddata(); private void binddata() sqlconnection conn = baseclass.baseclass.cycon(); sqldataadapter sda = new sqldataadapter(select id,waitername 姓名,cardnum 身份證號,waiternum 服務員編號,sex 性別,age 年齡,tell 電話

27、號碼 from tb_waiter order by id , conn); dataset ds = new dataset(); sda.fill(ds); datagridview1.datasource = ds.tables0; /修改按鈕 private void button1_click(object sender, eventargs e) btrewrite.enabled = false; btsave.enabled = true; btconcle.enabled = true; txtname.enabled = false; txtage.enabled = tr

28、ue; txtidcard.enabled = true; txtwaiternum.enabled = true; txttel.enabled = true; cbsex.enabled = true; private void btexit_click(object sender, eventargs e) this.close(); private void btrewrite_click(object sender, eventargs e) txtname.text = ; txtage.text = ; txtidcard.text = ; txttel.text = ; txt

29、waiternum.text = ; txtname.enabled = true; txtage.enabled = true; txtidcard.enabled = true; txtwaiternum.enabled = true; txttel.enabled = true; cbsex.enabled = true; btchange.enabled = false; btdelete.enabled = true; btsave.enabled = true; private void btdelete_click(object sender, eventargs e) sqlc

30、onnection conn = baseclass.baseclass.cycon(); conn.open(); sqlcommand cmd = new sqlcommand(delete from tb_waiter where id= + datagridview1.selectedcells0.value.tostring() + , conn); cmd.executenonquery(); conn.close(); binddata(); private void btsave_click(object sender, eventargs e) sqlconnection c

31、onn = baseclass.baseclass.cycon(); conn.open(); sqlcommand cmd = new sqlcommand(select count(*) from tb_waiter where waitername= + txtname.text + , conn); int i = convert.toint32(cmd.executescalar(); if (i 0) cmd = new sqlcommand(update tb_waiter set waitername= + txtname.text + ,cardnum= + txtidcar

32、d.text + ,waiternum= + txtwaiternum.text + ,sex= + cbsex.selecteditem.tostring() + ,age= + txtage.text + ,tell= + txttel.text + where id= + datagridview1.selectedcells0.value.tostring() + , conn); cmd.executenonquery(); conn.close(); binddata(); btrewrite.enabled = true; btchange.enabled = false; bt

33、save.enabled = false; btquery.enabled = true; btconcle.enabled = false; btdelete.enabled = false; btexit.enabled = true; txtname.enabled = false; else cmd = new sqlcommand(insert into tb_waiter(waitername,cardnum,waiternum,sex,age,tell) values( + txtname.text + , + txtidcard.text + , + txtwaiternum.

34、text + , + cbsex.selecteditem.tostring() + , + txtage.text + , + txttel.text + ), conn); cmd.executenonquery(); conn.close(); binddata(); btchange.enabled = true; btrewrite.enabled = true; btsave.enabled = false; btquery.enabled = true; btconcle.enabled = false; btdelete.enabled = true; btexit.enabl

35、ed = true; txtname.enabled = false; txtname.enabled = false; private void frmuser_load(object sender, eventargs e) cbsex.selectedindex = 0; private void datagridview1_cellclick(object sender, datagridviewcelleventargs e) try txtname.text = datagridview1.selectedcells1.value.tostring(); txtidcard.tex

36、t = datagridview1.selectedcells2.value.tostring(); txtwaiternum.text = datagridview1.selectedcells3.value.tostring(); cbsex.selecteditem = datagridview1.selectedcells4.value.tostring().trim(); txtage.text = datagridview1.selectedcells5.value.tostring(); txttel.text = datagridview1.selectedcells6.value.tostring(); btchange.enabled = true; btdelete.enabled = true; catch (exception err)

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論