酒店客房餐飲管理系統(tǒng)實(shí)現(xiàn)_第1頁(yè)
酒店客房餐飲管理系統(tǒng)實(shí)現(xiàn)_第2頁(yè)
酒店客房餐飲管理系統(tǒng)實(shí)現(xiàn)_第3頁(yè)
酒店客房餐飲管理系統(tǒng)實(shí)現(xiàn)_第4頁(yè)
酒店客房餐飲管理系統(tǒng)實(shí)現(xiàn)_第5頁(yè)
已閱讀5頁(yè),還剩9頁(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)介

1、酒店客房餐飲管理系統(tǒng)實(shí)現(xiàn)酒店客房餐飲管理系統(tǒng)功能完善,能管理普通酒店的客房住宿和餐飲等服務(wù)。本系統(tǒng)采用DELPHI和SQLSERVER工具開發(fā),分為前臺(tái)和后臺(tái)管理。前臺(tái)與后臺(tái)管理程序相對(duì)獨(dú)立,均共用一個(gè)數(shù)據(jù)庫(kù)。下面對(duì)該系統(tǒng)的部份功能和模塊以及代碼進(jìn)行分析。一前臺(tái)管理數(shù)據(jù)模塊該模塊是整個(gè)程序數(shù)據(jù)的提供者,以及包括大部分的處理函數(shù)和實(shí)現(xiàn)功能。單元文件名:u_data.pas數(shù)據(jù)模塊名:DM_main。部分代碼分析:返回指表中某字段的最大值,返回值為整型。因此該函數(shù)只能應(yīng)用字段為整型的表。functionTDM_main.GetMaxId(aTable,aField:string):integer;

2、varsSql:string;beginResult:=0;sSql:=selectmax(%s)from%s;withQ_getmaxdobeginSQL.Text:=Format(sSql,aField,aTable);Open;ifnotIsEmptythenResult:=Fields0.AsInteger+1;Close;end;end;接下來(lái)這個(gè)函數(shù)也是返回最大值,但是其為一個(gè)訂單的最大編號(hào)為字符型。functionTDM_main.GetMaxOrderId:string;varid:String;count:Integer;beginwithQ_count_orderdobeg

3、inOpen;count:=Fields0.Value;Close;end;id:=000+IntToStr(count);id:=Copy(id,length(id)-3,4);id:=F+FormatDateTime(yymmdd,now)+id;Result:=id;end;系統(tǒng)登陸函數(shù):在進(jìn)行系統(tǒng)的操作處理時(shí),必須登陸。該函數(shù)對(duì)用戶輸入的用戶名和密碼數(shù)據(jù)庫(kù)驗(yàn)證。其密碼是進(jìn)行加密的(加密模塊稍后分析)functionTDM_main.Login(user,passwd:String):String;varFlag:Boolean;beginifDatabase.Connected=fal

4、sethenDatabase.Connected:=True;passwd:=Copy(passwd+passwd,1,10);/加密處理passwd:=Encrypt(passwd,111);withQ_logindobeginClose;Params.ParamValuesID:=user;Params.ParamValuesPASSWD:=passwd;Open;/在用戶請(qǐng)中查詢?cè)撚脩艉兔艽a是否存在Flag:=(notIsEmpty);ifFlagthenbeginLogin:=FieldValuesNAME;IsPass:=Flag;endelsebeginLogin:=;Applic

5、ation.MessageBox(請(qǐng)重新輸入!,登錄失敗,MB_OK);end;Close;end;end;系統(tǒng)登出:procedureTDM_main.Logout;beginDatabase.Connected:=False;/斷開數(shù)據(jù)庫(kù)的連接end;加密模塊:?jiǎn)卧募篶rypt.pas。簡(jiǎn)單的加密算法。constC1=52845;C2=22719;functionEncrypt(S:String;Key:Word):String;/S:加密的字符串;Key:密鑰varI:Integer;j:Integer;beginResult:=S;forI:=1toLength(S)dobegi

6、nResultI:=char(byte(SI)xor(Keyshr8);Key:=(byte(ResultI)+Key)*C1+C2;end;s:=Result;Result:=;fori:=1tolength(s)dobeginj:=Integer(si);Result:=Result+Char(65+(jdiv26)+Char(65+(jmod26);end;end;主模塊系統(tǒng)的主界面,包括系統(tǒng)登陸。在沒有進(jìn)行登陸之前4個(gè)功能按鈕為灰色。第一個(gè)按鈕為客房管理,其次是餐飲管理,再次是客戶查詢,最后是收費(fèi)管理。客房管理模塊客房管理包括客房預(yù)定,入住,調(diào)整。其界面如下:操作介紹:預(yù)定:首先在證件

7、編號(hào)文體框中輸入相關(guān)的證件編號(hào),按回車鍵,顯示如下窗口:輸入完整后單擊添加則返回上一個(gè)界面,相關(guān)的數(shù)據(jù)將自動(dòng)填寫。然后在右邊選擇相應(yīng)的客房等級(jí)。在網(wǎng)格中將顯示該等級(jí)的所有空閑房號(hào)。選擇一個(gè)房間,再點(diǎn)擊“新建”按鈕,然后點(diǎn)擊“添加”。客房預(yù)定完畢。入住:在證件編號(hào)文體框中輸入相關(guān)的證件編號(hào),按回車鍵。如果該客戶已經(jīng)預(yù)定則自動(dòng)顯示信息,否則將彈出上面的窗口要求輸入信息。.餐飲管理包括選菜、點(diǎn)菜、打單:下面是其相代碼說(shuō)明:procedureTF_foodorder.btnOkClick(Sender:TObject);varid:integer;total:single;beginifsid=the

8、nbeginB_neworderClick(nil);end;訂單明細(xì)id:=DM_main.GetMaxId(order_detail,id);withQ_foodetaildobeginAppend;Fields0.AsInteger:=id;Fields1.AsString:=sid;Fields2.AsString:=dbtext1.Caption;Fields3.AsString:=edtNum.Text;Fields4.AsString:=dbtext4.Caption;Post;DisableControls;Close;Open;EnableControls;end;/更新總訂

9、單的總金額withDM_main.T_foodorderdobeginEdit;total:=DM_main.GetSumPrice(sid);Fields3.AsFloat:=total;Post;end;end;/撤銷選擇的一項(xiàng)菜目procedureTF_foodorder.btnCancelClick(Sender:TObject);vartotal:Single;beginwithQ_foodetaildobeginifIsEmptythenExit;ifnotActivethenbeginParamByName(sid).Value:=sid;Open;end;Delete;end;

10、total:=DM_main.GetSumPrice(sid);withDM_main.T_foodorderdobeginifnotActivethenOpen;Locate(id,sid,);Edit;Fields3.AsFloat:=total;Post;end;end;procedureTF_foodorder.B_neworderClick(Sender:TObject);begin/新建總訂單sid:=DM_main.GetMaxOrderId;withDM_main.T_foodorderdobeginOpen;Append;Fields0.AsString:=sid;Field

11、s1.AsString:=DateTimeToStr(Now);Fields2.AsString:=Trim(edtName.Text);Post;end;withQ_foodetaildobeginClose;ParamByName(sid).Value:=sid;Prepare;Open;end;end;打單:票據(jù)示例如下。|p*ge1of1二.后臺(tái)管理.數(shù)據(jù)模塊該模塊是整個(gè)程序數(shù)據(jù)的提供者,以及包括大部分的處理函數(shù)和實(shí)現(xiàn)功能。單元文件名:u_data.pas數(shù)據(jù)模塊名:DM_main。部分代碼分析:設(shè)置前臺(tái)操作員的密碼:procedureTDM_main.SetOperatorPassw

12、ord(password:String);beginpassword:=Copy(password+password,1,10);password:=Encrypt(password,111);力口密單元withT_operatordobeginEdit;FieldValuesPASSWD:=password;end;end;根據(jù)客房ID篩選客房:procedureTDM_main.SetModifyFilter(RoomID:String);beginwithT_room_modifydobeginClose;iflength(RoomID)0thenbeginFilter:=ID=+Roo

13、mID+;Filtered:=True;endelseFiltered:=False;Open;end;end;獲得客房級(jí)別:procedureTDM_main.GetRoomLevel(RoomLevel:TStrings);beginRoomLevel.Clear;RoomLevel.Add(全部級(jí)別);withQ_room_leveldobeginOpen;First;whilenotEofdobeginRoomLevel.Add(FieldValuesDESCRIPT);Next;end;Close;end;end;客房統(tǒng)計(jì)圖實(shí)現(xiàn)函數(shù):/StarDate:開始日期;EndDate:結(jié)束

14、日期;procedureTDM_main.GetRoomStat(StartDate,EndDate:TDate;TimeStep,StatType:Boolean;RoomLevel:Integer;BarSeries:TBarSeries);varStatResult:integer;MidDate:TDate;StatLabel:String;beginBarSeries.Clear;whileStartDateEndDatedobeginMidDate:=GetNextDate(StartDate,TimeStep);ifStatTypethenStatResult:=SumTurno

15、ver(StartDate,MidDate)elseStatResult:=SumUsedRoom(StartDate,MidDate,RoomLevel);ifTimeStepthenStatLabel:=FormatDateTime(dd,StartDate)+日elseStatLabel:=FormatDateTime(mm,StartDate)+月;BarSeries.AddY(StatResult,StatLabel);StartDate:=MidDate;end;end;換算下個(gè)月(日)日期:functionTDM_main.GetNextDate(StartDate:TDate;

16、TimeStep:Boolean):TDate;varTimeYear,TimeMonth:String;beginifTimeStepthenResult:=StartDate+1elsebeginTimeYear:=FormatDateTime(yyyy,StartDate);TimeMonth:=FormatDateTime(mm,StartDate);ifTimeMonth=12thenbeginTimeYear:=IntToStr(StrToInt(TimeYear)+1);TimeMonth:=01;endelseTimeMonth:=IntToStr(StrToInt(TimeM

17、onth)+1);Result:=StrToDate(TimeYear+-+TimeMonth+-01);end;end;系統(tǒng)登陸模塊該系統(tǒng)登陸將連接數(shù)據(jù)庫(kù)的管理員用戶表進(jìn)行驗(yàn)證:procedureTF_login.b_loginClick(Sender:TObject);varsSql:string;beginif(Trim(i_admin.Text)=)or(i_passwd.Text=)thenbeginMessageDlg(請(qǐng)輸入管理員帳號(hào)和密碼!,mtWarning,mbOK,mbHelp,6);i_admin.SetFocus;Exit;end;sSql:=select*froma

18、dmin_userwherename=%sandpasswd=%s;withDM_main.Q_admindobeginSQL.Text:=Format(sSql,Trim(i_admin.Text),i_passwd.Text);Open;ifIsEmptythenbeginMessageDlg(連接錯(cuò)誤!請(qǐng)確認(rèn)管理員帳號(hào)和密碼!,mtWarning,mbOK,mbHelp,6);i_admin.SetFocus;Exit;endelsebeginClose;self.Close;end;end;end;登陸界面:3.主控程序后臺(tái)管理主窗口如下:后臺(tái)管理程序采用MDI風(fēng)格窗體。并采用事件管理

19、機(jī)制ActionList管理所有功能模塊的點(diǎn)擊事件:procedureTF_main.RoomAddExecute(Sender:TObject);beginApplication.CreateForm(TF_add,F_add);RoomAdd.Enabled:=False;end;procedureTF_main.RoomModifyExecute(Sender:TObject);beginApplication.CreateForm(TF_modify,F_modify);RoomModify.Enabled:=False;end;procedureTF_main.HelpAboutExecute(Sender:TObject);beginF_about.ShowModal;end;procedureTF_main.SystemExitExecute(Sender:TObject);beginClose;end;proce

溫馨提示

  • 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ù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 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)論