餐飲管理餐飲管理系統(tǒng)設(shè)計(jì)_第1頁(yè)
餐飲管理餐飲管理系統(tǒng)設(shè)計(jì)_第2頁(yè)
餐飲管理餐飲管理系統(tǒng)設(shè)計(jì)_第3頁(yè)
餐飲管理餐飲管理系統(tǒng)設(shè)計(jì)_第4頁(yè)
餐飲管理餐飲管理系統(tǒng)設(shè)計(jì)_第5頁(yè)
已閱讀5頁(yè),還剩27頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

餐飲管理餐飲管理系統(tǒng)設(shè)計(jì)課程設(shè)計(jì)報(bào)告課程名稱:PowerBuilder10.5程序設(shè)計(jì)基礎(chǔ)設(shè)計(jì)題目:酒店餐飲管理系統(tǒng)專業(yè):信息與計(jì)算科學(xué)班級(jí):姓名:XXXX學(xué)號(hào):XXXXXXXX指導(dǎo)教師:XXXXXX學(xué)院數(shù)理系XXXX年XX月課程設(shè)計(jì)題目(問(wèn)題)描述酒店管理系統(tǒng)。取消、查詢及在收費(fèi)時(shí)的立賬,打折設(shè)定的等方面的功能。本組成員情況姓名學(xué)號(hào)承擔(dān)的任務(wù)成績(jī)杜雅笛2012314201調(diào)試郭曉麗2012314206試莫鵬飛2012314220資料查詢、登陸界面、代碼編寫及系統(tǒng)的調(diào)試教師評(píng)語(yǔ)簽名:注:本設(shè)計(jì)報(bào)告中各個(gè)部分如果頁(yè)數(shù)不夠,請(qǐng)大家自行擴(kuò)頁(yè),原則是一定要把報(bào)告寫詳細(xì),能說(shuō)明本組設(shè)計(jì)的成果和特色,能夠反應(yīng)小組中每個(gè)人的工作。報(bào)告中應(yīng)該敘述設(shè)計(jì)中的每個(gè)模塊。設(shè)計(jì)報(bào)告將是評(píng)定每個(gè)人成績(jī)的一個(gè)重要組成部分。一、本組設(shè)計(jì)的功能描述(含所有實(shí)現(xiàn)的模塊的功能)登錄界面的功能:在登陸界面正確輸入用戶名與口令就可以登陸主界面,如用戶名與口令不匹配則有提醒,點(diǎn)開(kāi)免費(fèi)注冊(cè)界面,可以錄入新的管理人員的信息,退出注冊(cè)界面輸入剛注冊(cè)的用戶名和口令就可登陸主界面。系統(tǒng)主界面的功能:●系統(tǒng)維護(hù):☆值班員信息維護(hù):實(shí)現(xiàn)對(duì)值班員的添加、刪除功能☆菜譜信息維護(hù):實(shí)現(xiàn)對(duì)已有菜單的查詢、添加和刪除☆修改口令:實(shí)現(xiàn)對(duì)用戶口令的更改?!裼唵喂芾?☆訂餐:實(shí)現(xiàn)對(duì)訂餐信息的添加☆訂餐修改:實(shí)現(xiàn)對(duì)已經(jīng)訂餐的信息的修改☆訂餐取消:實(shí)現(xiàn)對(duì)已經(jīng)訂餐的信息的取消☆訂餐查詢:實(shí)現(xiàn)對(duì)訂餐訂單按桌號(hào)、菜譜號(hào)、菜名的查詢●收費(fèi)管理:☆折扣設(shè)定:實(shí)現(xiàn)了對(duì)用餐人員的折扣設(shè)定☆客戶信息:顯示客戶信息●打印:☆打印客戶消費(fèi)賬單二、本組設(shè)計(jì)的主要特色主要特色有如下:1、登陸界面可以注冊(cè)新用戶2、在登陸主界面是彈出交班管理制度的界面3、可對(duì)值班人員、菜譜信息進(jìn)行添加,刪除4、可對(duì)訂餐情況進(jìn)行添加、刪除、查詢等功能5、對(duì)客戶的費(fèi)用進(jìn)行打折,打印客戶消費(fèi)單三、系統(tǒng)分析與設(shè)計(jì)2.1數(shù)據(jù)庫(kù)的設(shè)計(jì)與連接(1SQLSEVER2005建物理數(shù)據(jù)庫(kù)XSCJPowerBuilderODBC義DBProfile,連接數(shù)據(jù)庫(kù)。根據(jù)功能需求,在數(shù)據(jù)庫(kù)中先創(chuàng)建5個(gè)表列名數(shù)據(jù)類型可否為空說(shuō)明DC_DESKChar(20)Notnull桌號(hào)(主鍵)CP_NOChar(10)Notnull菜譜號(hào)CP_NAMEChar(20)null菜名DC_NUMBERChar(3)null數(shù)量DC_DATEdatetimeNull訂餐日期表1訂餐信息表DC列名數(shù)據(jù)類型可否為空說(shuō)明CP_NOCHAR(10)NOTNULL菜譜號(hào)(主鍵)CP_NAMECHAR(20)NULL菜名CP_KINDCHAR(20)NULL種類CP_PRICENUMBER(10)NULL價(jià)格CP_DETAILCHAR(50)NULL備注表2菜譜信息表CP列名數(shù)據(jù)類型可否為空說(shuō)明KH_NOCHAR(20)NOTNULL客戶號(hào)(主鍵)DC_DESKCHAR(20)NULL桌號(hào)JS_DZCHAR(3)NULL打折情況TOTALCHAR(5)NULL總計(jì)JS_DATEDATETIMENULL日期表3結(jié)算信息表JS列名數(shù)據(jù)類型可否為空說(shuō)明KH_NOCHAR(10)NOTNULL客戶號(hào)(主鍵)KH_NAMECHAR(20)NULL姓名KH_SEXCHAR(2)NULL性別KH_AGECHAR(3)NULL年齡KH_JOBCHAR(20)NULL職務(wù)KH_TELCHAR(20)NULL聯(lián)系電話KH_COMPANYCHAR(20)NULL工作電話表4榮譽(yù)客戶信息表KH列名數(shù)據(jù)類型可否為空說(shuō)明ZBY_NAMECHAR(20)NOTNULL值班員名(主鍵)ZBY_PAWDCHAR(10)NUTNULL口令表5值班員表ZBY實(shí)體和實(shí)體之間的關(guān)系E-R圖系統(tǒng)詳細(xì)設(shè)計(jì)(1)單擊菜單“File|New”,選擇應(yīng)用程序?qū)ο竽0瀹?huà)板,單擊“OK”按鈕在出現(xiàn)的對(duì)話框中完成應(yīng)用程序?qū)ο竺?、?kù)文件名的設(shè)置.(2)單擊“Finish”按鈕,進(jìn)入應(yīng)用程序?qū)ο笤O(shè)計(jì)畫(huà)面。1、在應(yīng)用程序?qū)ο蟮腛pen事件中輸入如下的程序代碼//ProfilejiudianSQLCA.DBMS="ODBC"SQLCA.AutoCommit=FalseSQLCA.DBParm="ConnectString='DSN=jiudian;UID=;PWD='"connect;open(w_open)sleep(1)close(w_open)open(w_login)該語(yǔ)句就是打開(kāi)w_open2、登錄窗口的設(shè)計(jì)。登錄窗口如圖(1)在W_login窗口的Open事件中輸入如下的程序代碼Environmentl_envintl_ScrWidth,l_ScrHeightsetRedraw(false)GetEnvironment(l_env)//取得屏幕的高度和寬度l_ScrWidth=PixelsToUnits(l_env.ScreenWidth,XpixelsToUnits!)l_ScrHeight=PixelsToUnits(l_env.ScreenHeight,YpixelsToUnits!)Move((l_scrwidth-this.width)/2,(l_scrheight-this.height)/2)//移動(dòng)窗口到屏幕中間setredraw(true)//打開(kāi)窗口刷新(2)按鈕控件cb_1(確定)的Click事件中的程序代碼如下:stringl_id,l_passwardstringl_passward0intil_id=trim(sle_1.text)l_passward=trim(sle_2.text)ifl_id=""thenmessagebox("提示","請(qǐng)輸入用戶名!")returnendifsle_1.setfocus()ifl_passward=""thenmessagebox("提示","請(qǐng)輸入密碼!")returnendifsle_2.setfocus()selectcount(*)into:ifromzbywherertrim(zby_name)=:l_idusingsqlca;ifi<1thenmessagebox("提示","該用戶不存在!")sle_1.text=""sle_2.text=""sle_1.setfocus()returnendifselectzby_pawdinto:l_passward0fromzbywherertrim(zby_name)=:l_idusingsqlca;iftrim(l_passward0)=l_passwardthenopen(w_main)close(parent)integerli_FileNumstringls_Emp_Inputlongll_FLengthll_FLength=FileLength("D:\MicrosoftSQLServer\1.txt")li_FileNum=FileOpen("D:\MicrosoftSQLServer\1.txt",StreamMode!,read!,shared!)IFll_FLength<32767THENFileRead(li_FileNum,ls_Emp_Input)filewrite(li_FileNum,ls_Emp_Input)messagebox("",ls_Emp_Input,None!)returnENDIF//顯示交班管理制度elsemessagebox("警告","密碼錯(cuò)誤,請(qǐng)重新輸入法!")sle_2.text=""sle_2.setfocus()endif(3)按鈕控件cb_2(取消)的Click事件中的程序代碼如下:Halt用于終止應(yīng)用程序的執(zhí)行.(4)按鈕控件cb_3(免費(fèi)注冊(cè))的Click事件中的程序代碼如下:open(w_zhuche)用來(lái)打開(kāi)注冊(cè)窗口.交班管理制度顯示的制作。(5)在該系統(tǒng)文件目錄下新建一個(gè)”1.txt”在里面輸入相應(yīng)的內(nèi)容。在登錄窗口的cb_1(確定)下的代碼integerli_FileNumstringls_Emp_Inputlongll_FLengthll_FLength=FileLength("D:\MicrosoftSQLServer\1.txt")li_FileNum=FileOpen("D:\MicrosoftSQLServer\1.txt",StreamMode!,read!,shared!)IFll_FLength<32767THENFileRead(li_FileNum,ls_Emp_Input)filewrite(li_FileNum,ls_Emp_Input)messagebox("",ls_Emp_Input,None!)returnENDIF這段代碼就是在進(jìn)入系統(tǒng)時(shí)顯示該信息,如下圖,3.注冊(cè)窗口的設(shè)計(jì)(1)在”檢測(cè)用戶名”按扭控件的click事件中輸入如下代碼:stringl_userl_user=sle_1.textifl_user=""thenmessagebox("警告","請(qǐng)輸入用戶名!",Exclamation!)sle_1.setfocus()return1endifintiselectcount(*)into:ifromZBYwhereZBY_NAME=:l_user;ifi>0thenmessagebox("警告","用戶名已存在,請(qǐng)重試!",Exclamation!)sle_1.text=""sle_1.setfocus()returnelsemessagebox("","恭喜你,該用戶名可以使用!")returnendif(2)在”提交”按扭控件的click事件中輸入如下代碼:stringl_userl_user=sle_1.textifsle_1.text=""thenmessagebox("提示","請(qǐng)輸入用戶名!")return1endifstringaa,bbaa=sle_2.textbb=sle_3.textifaa=""thenmessagebox("提示","密碼不能為空!")return1endififaa<>bbthenmessagebox("提示","輸入的密碼不一致~n~r請(qǐng)重新輸入!")sle_2.text=""sle_3.text=""sle_2.setfocus()returnendifinsertINTOzby(zby_name,zby_pawd)VALUES(:l_user,:aa)usingsqlca;ifsqlca.sqlcode=0thenmessagebox("提示","注冊(cè)成功,請(qǐng)牢記~r~n用戶名"+sle_1.text+"~r~n密碼"+sle_2.text)close(parent)elsemessagebox("提示","注冊(cè)失敗!")returnendif(3)在”取消”按扭控件的click事件中輸入如下代碼:close(parent)4.主菜單的設(shè)計(jì)(1Click事件程序代碼:halt其功能是關(guān)閉主窗口w_main,退出應(yīng)用程序。(2Click事件程序代碼:open(w_zby)(3Click事件程序代碼:open(w_choose_receive)(4)“系統(tǒng)維護(hù)”菜單下“修改口令”子菜單的Click事件程序代碼:open(w_changekl)(5Click事件程序代碼:open(w_dc)(6Click事件程序代碼:open(w_ujttyyytt)(7)“訂餐管理”菜單下“訂餐取消”子菜單的Click事件程序代碼:open(w_dc_qc)(8)“訂餐管理”菜單下“訂餐查詢”子菜單的Click事件程序代碼:open(w_dc_search)(9)“收款管理”菜單的“折扣設(shè)定”子菜單的Click事件程序代碼:open(w_zksd)(10)“收款管理”菜單下的“客戶信息”子菜單的CLICK事件程序代碼:open(w_kh)(11)“打印”菜單的“打印帳單”子菜單的Click事件程序代碼:open(w_print)(12)“幫助”菜單的”版本信息”子菜單的Click事件程序代碼:open(w_help)(13)w_main為mdihelp!。Title為酒店餐飲管理系統(tǒng)1.0。另外在窗口上布置一個(gè)圖片控件,按扭的click事件中有句open(main)的代碼,即為打開(kāi)此窗口。5.值班員信息維護(hù)窗口w_zby的設(shè)計(jì)zby在編輯狀態(tài)下如下圖,該數(shù)據(jù)窗口對(duì)象所鏈接的數(shù)據(jù)庫(kù)表格為ZBY,其數(shù)據(jù)源表示如下:SELECT"zby"."zby_name","zby"."zby_pawd"FROM"zby"(1)open事件代碼:dw_1.settransobject(sqlca)dw_1.retrieve()(2)窗口的closequery事件代碼:inti_countlongbbi_count=dw_1.modifiedcount()+dw_1.deletedcount()ifi_count>0thenbb=messagebox("提示","是否保存未保存的數(shù)據(jù)",question!,yesnocancel!,1)choosecasebbcase1ifdw_1.update()=1thencommitusingsqlca;return0elserollbackusingsqlca;messagebox("提示","數(shù)據(jù)保存失敗!")endifcase2return0case3return1endchooseendif(3)增加按鈕代碼:dw_1.scrolltorow(dw_1.insertrow(0))dw_1.setcolumn(0)dw_1.setfocus()(4)刪除按鈕代碼:longnetnet=messagebox("","你確定要?jiǎng)h除嗎",question!,yesno!,1)//提示是否要?jiǎng)h除choosecasenetcase1dw_1.deleterow(dw_1.getrow())//刪除當(dāng)前行case2return1endchoose(5)保存按鈕代碼:inti_counti_count=dw_1.modifiedcount()+dw_1.deletedcount()//判斷改變和刪除的數(shù)目。ifi_count>0thenifdw_1.update()=1thencommitusingsqlca;messagebox("提示","已成功保存"+string(i_count)+"紀(jì)錄")elserollbackusingsqlca;messagebox("提示","保存失敗")endifendif6.菜譜信息維護(hù)窗口w_choose_receive設(shè)計(jì)ddlb_1、ddlb_2屬性相同,其Items屬性頁(yè)如下圖所示。ddlb_3、ddlb_4屬性也相同,其Items屬性頁(yè)如下圖所示。ddlb_5的Items屬性頁(yè)如下圖所示其他的控件如窗口上所示。所鏈接的數(shù)據(jù)窗口對(duì)象在編輯狀態(tài)下,如圖下所示該數(shù)據(jù)窗口對(duì)象所鏈接的數(shù)據(jù)庫(kù)表格為CP,其數(shù)據(jù)源表示如下:SELECT"cp"."cp_no","cp"."cp_name","cp"."cp_kind","cp"."cp_price","cp"."cp_detail"FROM"cp"(1)Open事件:dw_1.settransobject(sqlca)ddlb_1.text="菜譜號(hào)"ddlb_4.text="="ddlb_5.text="and"(2)查詢代碼intistringlookforcondition//定義參數(shù):查詢條件綜合結(jié)果stringlookforitem1,lookforitem2,lookforitem3//定義參數(shù):要查詢的列stringlookforwhat1,lookforwhat2,lookforwhat3//定義參數(shù):要查詢的內(nèi)容stringlookforhow1,lookforhow2,lookforhow3//定義參數(shù):查詢的符號(hào)stringlookforoperator1,lookforoperator2//定義參數(shù):不同查詢條件組合操作符號(hào)lookforhow1=ddlb_3.textlookforhow2=ddlb_4.textifddlb_5.text="與"thenlookforoperator1="and"elseifddlb_5.text="或"thenlookforoperator1="or"elseifddlb_5.text="非"thenlookforoperator1="not"endififddlb_1.text="菜譜號(hào)"thenlookforitem1="cp_no"lookforwhat1="'"+sle_1.text+"'"elseifddlb_1.text="菜名"thenlookforitem1="cp_name"lookforwhat1="'"+sle_1.text+"'"elseifddlb_1.text="種類"thenlookforitem1="cp_kind"lookforwhat1="'"+sle_1.text+"'"elseifddlb_1.text="價(jià)格"thenlookforitem1="cp_price"lookforwhat1=sle_1.textelseifddlb_1.text="備注"thenlookforitem1="cp_detail"lookforwhat1="'"+sle_1.text+"'"endififddlb_2.text="菜譜號(hào)"thenlookforitem2="cp_no"lookforwhat2="'"+sle_2.text+"'"elseifddlb_2.text="菜名"thenlookforitem2="cp_name"lookforwhat1="'"+sle_2.text+"'"elseifddlb_2.text="種類"thenlookforitem2="cp_kind"lookforwhat2="'"+sle_2.text+"'"elseifddlb_2.text="價(jià)格"thenlookforitem2="cp_price"lookforwhat2="'"+sle_2.text+"'"elseifddlb_2.text="備注"thenlookforitem2="cp_detail"lookforwhat2="'"+sle_2.text+"'"endififddlb_2.text=""orddlb_4.text=""thenlookforcondition=lookforitem1+lookforhow1+lookforwhat1elselookforcondition=lookforitem1+lookforhow1+lookforwhat1+""+lookforoperator1+""+lookforitem2+lookforhow2+lookforwhat2endifdw_1.setfilter(lookforcondition)filter(dw_1)i=dw_1.retrieve()ifi<1thenmessagebox("提示","沒(méi)有相關(guān)記錄!",Exclamation!)sle_1.text=""sle_2.text=""returnendif(3)增加代碼:dw_1.scrolltorow(dw_1.insertrow(0))dw_1.setcolumn(0)dw_1.setfocus()(4“刪除按鈕控件的Click”按鈕相同.(5)“保存”按鈕控件的Click事件將用于保存用戶所做的修改,程序代碼與上述“保存”按鈕相同.(6)“退出”按鈕控件的Click事件將用于退出該程序窗口。7.修改口令w_changek設(shè)計(jì)(1)修改按鈕代碼:stringcorrect_pswd,ls_user,ls_pswdls_user=trim(sle_1.text)ls_pswd=trim(sle_2.text)ifls_user=""thenmessagebox("","用戶名不能為空!")returnendififls_pswd=""thenmessagebox("","請(qǐng)輸入原口令!")returnendififsle_4.text<>sle_3.textthenmessagebox("警告","兩次輸入的口令不一致,請(qǐng)重新輸入")sle_3.text=""sle_4.text=""sle_3.setfocus()elseselectrtrim(zby_pawd)into:correct_pswdfromzbywherertrim(zby_name)=:ls_user;ifcorrect_pswd<>ls_pswdthenmessagebox("警告","原口令不正確!")elseupdatezbysetzby_pawd=:sle_3.textwherertrim(zby_name)=:ls_user;commitusingsqlca;close(parent)messagebox("注意","你的口令已經(jīng)修改,請(qǐng)牢記!")endifendif(2)“取消”按扭用來(lái)退出該窗口。8、訂餐w_dc窗口設(shè)計(jì)所鏈接的的數(shù)據(jù)窗口對(duì)象在編輯狀態(tài)如圖該數(shù)據(jù)窗口對(duì)象所鏈接的數(shù)據(jù)庫(kù)表格為DC,其數(shù)據(jù)源表示如下:SELECT"dc"."dc_desk","dc"."cp_no","dc"."cp_name","dc"."dc_num","dc"."dc_data"FROM"dc"(1)open事件intg_rownumberg_rownumber=dw_1.insertrow(0)dw_1.settransobject(sqlca)dw_1.setfocus()dateg_dc_dateg_dc_date=today()//在數(shù)據(jù)窗口的日期這列顯示當(dāng)前日期dw_1.scrolltorow(g_rownumber)dw_1.setcolumn(0)(2)下一道菜intg_rownumberg_rownumber=dw_1.insertrow(0)dateg_dc_dateg_dc_date=today()dw_1.setfocus()dw_1.scrolltorow(g_rownumber)dw_1.setcolumn(1)(3)“刪除按鈕控件的Click”按鈕控件相同.(4)“保存按鈕控件的Click事件將用于保存用戶所做的修改,程序代碼與上述的“保存”按鈕相同。(5)“退出”按鈕控件的Click事件將關(guān)閉該窗口。9、訂餐修改窗口w_ujttyyytt設(shè)計(jì)Ddlb_1和ddlb_2兩個(gè)控件的屬性一樣,其item屬性如下圖,所鏈接的數(shù)據(jù)窗口對(duì)象dc(1)open事件//設(shè)置事務(wù)對(duì)象dw_1.settransobject(sqlca)ddlb_1.text="="ddlb_2.text="="(2)顯示訂單intistringlookforconditionstringlookforitem1,lookforitem2stringlookforwhat1,lookforwhat2stringlookforhow1,lookforhow2lookforhow1=ddlb_1.textlookforhow2=ddlb_2.textlookforitem1="dc_desk"lookforwhat1="'"+sle_1.text+"'"lookforitem2="dc_date"lookforwhat2="datetime('"+sle_2.text+"00:00:00')"ifsle_2.text=""thenlookforcondition=lookforitem1+lookforhow1+lookforwhat1elselookforcondition=lookforitem2+lookforhow2+lookforwhat2//lookforitem1+lookforhow1+lookforwhat1+""+"and"+""+endifdw_1.setfilter(lookforcondition)filter(dw_1)i=dw_1.retrieve()ifi<1thenmessagebox("提示","沒(méi)有相關(guān)記錄!",Exclamation!)returnendif(3)增加intg_rownumberg_rownumber=dw_1.insertrow(0)dateg_dc_dateg_dc_date=today()//為數(shù)據(jù)窗口的日期列顯示當(dāng)前日期dw_1.setfocus()dw_1.scrolltorow(g_rownumber)dw_1.setcolumn(1)(4)“刪除按鈕控件的Click“刪除”按鈕控件相同.(5)“保存按鈕控件的Click所述的“保存”按鈕控件相同.(6)“退出”按鈕控件的Click事件將用于退出該程序窗口。10、訂餐取消w_dc_qc設(shè)計(jì),控件如圖所示,所連接的數(shù)據(jù)窗口為dc.ddlb_1與ddlb_2的屬性相同.ddlb_1的item屬性圖a,ddlb_2的item屬性圖b圖a圖b(1)open:dw_1.settransobject(sqlca)(2)確定intiifddlb_1.text=""thenmessagebox("","請(qǐng)選擇要退餐的桌號(hào)!")returnendifstringl_dc_deskl_dc_desk="dc_desk='"+ddlb_1.text+"'"dw_1.setfilter(l_dc_desk)filter(dw_1)i=dw_1.retrieve()ifi<1thenmessagebox("","此桌無(wú)消費(fèi)記錄!")ddlb_1.text=""elsemessagebox("","請(qǐng)選擇要退定的菜!")returnendif(3)退訂的菜doublel_dc_num1,l_dc_num2stringl_cp_namel_dc_num1=double(ddlb_2.text)l_cp_name=dw_1.getitemstring(dw_1.getrow(),"cp_name")l_dc_num2=Long(dw_1.getitemstring(dw_1.getrow(),"dc_number"))intretret=messagebox("","你確定要退定"+string(l_dc_num1)+"一份"+l_cp_name,question!,yesnocancel!,2)choosecaseretcase1ifddlb_2.text="all"thendw_1.deleterow(0)ifdw_1.update()=1thenmessagebox("","退定成功!")close(parent)elsemessagebox("","退定失敗,請(qǐng)重試!")returnendifelseifl_dc_num1>l_dc_num2thenmessagebox("警告","退定出錯(cuò),請(qǐng)查看數(shù)量!")return1endifUPDATEdcSETdc_number=:l_dc_num2-:l_dc_num1;ifdw_1.update()=1thenmessagebox("","退定成功!")close(parent)returnendifreturnendifcase2return0case3return1endchoose11、訂餐查詢w_dc_search設(shè)計(jì)控件如上圖所示.其中有一個(gè)選項(xiàng)卡,卡上有三頁(yè),三頁(yè)的數(shù)據(jù)窗口控件所連接的數(shù)據(jù)窗口都是dc,界面如下圖,該數(shù)據(jù)窗口對(duì)象所鏈接的數(shù)據(jù)庫(kù)表格為CP和DC(1)open:tab_1.tabpage_1.dw_1.settransobject(sqlca)tab_1.tabpage_2.dw_2.settransobject(sqlca)tab_1.tabpage_3.dw_3.settransobject(sqlca)(2)按桌號(hào)查詢intistringl_desk,conditionl_desk=sle_1.textifl_desk=""thenmessagebox("提示","請(qǐng)輸入要查詢的桌號(hào)!")returnendifcondition="dc_desk='"+sle_1.text+"'"dw_1.setfilter(condition)filter(dw_1)i=dw_1.retrieve()ifi<1thenmessagebox("","無(wú)相關(guān)記錄,請(qǐng)重新輸入!")sle_1.text=""sle_1.setfocus()returnendif(3)按菜譜號(hào)查詢:intistringl_cp_no,conditionl_cp_no=sle_2.textifl_cp_no=""thenmessagebox("提示","請(qǐng)輸入要查詢的菜譜號(hào)!")returnendifcondition="cp_no='"+sle_2.text+"'"dw_2.setfilter(condition)filter(dw_2)i=dw_2.retrieve()ifi<1thenmessagebox("","無(wú)相關(guān)記錄,請(qǐng)重新輸入!")sle_2.text=""sle_2.setfocus()returnendif(4)按菜名查詢intistringl_cp_name,conditionl_cp_name=sle_3.textifl_cp_name=""thenmessagebox("提示","請(qǐng)輸入要查詢的菜名!")returnendifcondition="cp_namelike'%"+sle_3.text+"%'"dw_3.setfilter(condition)dw_3.filter()i=dw_3.retrieve()ifi<1thenmessagebox("","無(wú)相關(guān)記錄,請(qǐng)重新輸入!")sle_3.text=""sle_3.setfocus()returnendif(5)”退出”按扭用于退出該窗口.12、折扣設(shè)定W_zjsd窗口設(shè)計(jì)該數(shù)據(jù)窗口對(duì)象所鏈接的數(shù)據(jù)庫(kù)表格為js,其數(shù)據(jù)源表示如下:SELECT"js"."kh_no","js"."dc_desk","js"."js_dz","js"."total","js"."js_date"FROM"js"(1)Open:dw_1.settransobject(sqlca)(2)確定intiifddlb_1.text=""thenmessagebox("","請(qǐng)選擇要計(jì)算折扣的桌號(hào)!")ddlb_1.setfocus()returnendifstringl_desk,conditionl_desk=ddlb_1.textcondition="dc_desk='"+l_desk+"'"dw_1.setfilter(condition)filter(dw_1)i=dw_1.retrieve()ifi<1thenmessagebox("","該桌無(wú)消費(fèi)記錄!")returnendif(3)開(kāi)始計(jì)算doublel_totall_total=long(dw_1.getitemstring(dw_1.getrow(),"total"))ifl_total<200thenmessagebox("","總金額不足200~r~n無(wú)折扣優(yōu)惠")returnendififl_total>200andl_total<500thenmessagebox("","總金額大于200但小于500~r~n給予8.5扣優(yōu)惠")returnendififl_total>500andl_total<1000thenmessagebox("","總金額大于500但小于1000~r~n給予7扣優(yōu)惠")returnendififl_total>1000andl_total<5000thenmessagebox("","總金額大于1000但小于5000~r~n給予6扣優(yōu)惠")returnendififl_total>5000thenmessagebox("","總金額大于5000~r~n給予8.5扣優(yōu)惠")returnendif13.客戶信息w_kh設(shè)計(jì)該數(shù)據(jù)窗口對(duì)象所鏈接的數(shù)據(jù)庫(kù)表格為kh,其數(shù)據(jù)源表示如下:SELECT"ky"."kh_no","ky"."kh_name","ky"."kh_sex","ky"."kh_age","ky"."kh_job","ky"."kh_tel","ky"."kh_company"FROM"ky"14、打印帳單w_print設(shè)計(jì)該數(shù)據(jù)窗口對(duì)象所鏈接的數(shù)據(jù)庫(kù)表格為cp,dc,js,

溫馨提示

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

最新文檔

評(píng)論

0/150

提交評(píng)論