vb課程設(shè)計(jì)實(shí)驗(yàn)報(bào)告客房管理系統(tǒng)_第1頁(yè)
vb課程設(shè)計(jì)實(shí)驗(yàn)報(bào)告客房管理系統(tǒng)_第2頁(yè)
vb課程設(shè)計(jì)實(shí)驗(yàn)報(bào)告客房管理系統(tǒng)_第3頁(yè)
vb課程設(shè)計(jì)實(shí)驗(yàn)報(bào)告客房管理系統(tǒng)_第4頁(yè)
vb課程設(shè)計(jì)實(shí)驗(yàn)報(bào)告客房管理系統(tǒng)_第5頁(yè)
已閱讀5頁(yè),還剩30頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、第1章統(tǒng)設(shè)計(jì)的目的與意義: 客房管理系統(tǒng)用于賓館旅客入住情況登記,包括旅客的姓名及身份證號(hào)的登記,以及入住房間信息.當(dāng)旅客離開時(shí),需要辦理退房結(jié)帳手續(xù).對(duì)于一定時(shí)間沒的旅客入住情況實(shí)現(xiàn)基本查詢,報(bào)表打印功能.對(duì)于賓館本身也實(shí)現(xiàn)了客房增減,入住情況查詢等功能. 無論各種等級(jí)的賓館,使用客房管理系統(tǒng)都具有非常實(shí)用的價(jià)值.使用該系統(tǒng)可以大大節(jié)省時(shí)間,提高辦公效率,而且非常方便的實(shí)現(xiàn)旅客信息的查詢,以及對(duì)賓館本身客房入住情況及時(shí)了解.因此,客房管理系 統(tǒng)的開發(fā)無疑具有深遠(yuǎn)的意義.系統(tǒng)功能設(shè)計(jì) 系統(tǒng)設(shè)計(jì)包括數(shù)據(jù)庫(kù)設(shè)計(jì),主界面設(shè)計(jì),菜單設(shè)計(jì)以及功能設(shè)計(jì).而其他功能設(shè)計(jì)包括系統(tǒng)登錄設(shè)計(jì),旅客信息登記,旅客信

2、息查詢,退房信息處理設(shè)計(jì)以及報(bào)表輸入等功能設(shè)計(jì),系統(tǒng)功能設(shè)計(jì)流程圖如圖所示開始啟動(dòng)圖1.1用戶登錄 旅客信息表為旅客的個(gè)人信息加入住客房信息,數(shù)據(jù)結(jié)構(gòu)如表 旅客信息表設(shè)置字段名類型大小說明登記號(hào)Text8旅客入住號(hào)姓名Text8旅客姓名身份證號(hào)碼Text18旅客身份證號(hào)房間號(hào)Text3入住房間號(hào)登記日期Text日期/時(shí)間旅客入住時(shí)間性別Text3旅客性別籍貫Text8旅客籍貫表2.1客房信息表為客房入住情況的基本信息,數(shù)據(jù)結(jié)構(gòu)如表客房信息表設(shè)置字段名類型大小說明房間號(hào)Text3房間號(hào)客房等級(jí)Text8客房等級(jí)客房類型Text8客房類型客房?jī)r(jià)格Text單精度型客房?jī)r(jià)格客房狀態(tài)Text3客房狀態(tài)客

3、房備注信息備注8客房備注信息 表2.2旅客退房記錄表為旅客退房相關(guān)的一些記錄信息,數(shù)據(jù)結(jié)構(gòu)如表旅客退房記錄表設(shè)置字段名類型大小說明登記號(hào)Text8旅客入住號(hào)登記日期日期/時(shí)間旅客登記時(shí)間退房時(shí)間日期/時(shí)間旅客退房時(shí)間付款金額Text單精度型付費(fèi)金額退房備注信息Text8退房備注信息 表2.3管理人員信息表存儲(chǔ)賓館管理人員使用該系統(tǒng)的帳號(hào)密碼,數(shù)據(jù)結(jié)構(gòu)表管理人員信息表設(shè)置字段名類型大小說明姓名Text20管理人員帳號(hào)密碼Text20管理人員密碼權(quán)限Text1管理人員權(quán)限表2.4第3章主體內(nèi)容31 設(shè)計(jì)標(biāo)準(zhǔn)模塊本系統(tǒng)設(shè)計(jì)過程中,創(chuàng)建一個(gè)通用函數(shù)模塊,用于實(shí)現(xiàn)數(shù)據(jù)庫(kù)連接及按需要打開一個(gè)數(shù)據(jù)表。程序代

4、碼如下:Option ExplicitPublic Sub opentable(pado As Adodc, precordsource As String)With pado .ConnectionString = Provider=Microsoft.Jet.OLEDB.4.0;Data Source= & App.Path & /Total.mdb .CommandType = adCmdUnknown .RecordSource = precordsource .Refresh End WithEnd Sub3.2 戶登錄界面設(shè)計(jì)用戶登錄的作用是判斷使用本程序的用戶是否是合法用戶。在程

5、序進(jìn)入登錄界面時(shí)要求輸入用戶名和密碼,如果用戶名,密碼正確程序繼續(xù)執(zhí)行。當(dāng)密碼錯(cuò)誤輸入的次數(shù)超過設(shè)定次數(shù)時(shí),給出提示信息退出程序,這樣防止了非法用戶對(duì)本程序的使用。321工作界面設(shè)計(jì) 圖3.1登錄窗體程序代碼如下:Private Sub cmdok_Click() 檢查正確的密碼首先要對(duì)用戶名特殊字符的過濾防止非授權(quán)用戶的登陸訪問Dim s1 As StringDim i As IntegerDim j As IntegerDim a(18) As String j = Len(txtUserName.Text) s1 = txtUserName.Text Dim c As Integer c

6、 = 1 For i = 1 To j a(i) = Mid(s1, i, 1)逐一判斷字符的合格化 If a(i) = Then MsgBox Error, vbOKOnly, Error Exit Sub ElseIf a(i) = Then MsgBox Error, vbOKOnly, Error Exit Sub ElseIf a(i) = = Then MsgBox Error, vbOKOnly, Error Exit Sub ElseIf a(i) = Then MsgBox Error, vbOKOnly, Error Exit Sub ElseIf a(i) = Then

7、MsgBox Error, vbOKOnly, Error Exit Sub ElseIf a(i) = , Then MsgBox Error, vbOKOnly, Error Exit Sub ElseIf a(i) = Then MsgBox Error, vbOKOnly, Error Exit Sub End If c = c + 1 txtUserName.SetFocus Next iDim strusername As StringDim strpassword As StringStatic intlogintimes As IntegerIf Trim(txtUserNam

8、e.Text) = ThenMsgBox 用戶名不能為空!, vbOKOnly + vbCritical, 錯(cuò)誤Exit SubEnd Ifopentable adousers, usersinfoadousers.Refreshadousers.Recordset.Find 姓名= & & txtUserName.Text & , , adSearchForward, 1If Not adousers.Recordset.EOF Then strusername = adousers.Recordset!姓名strpassword = adousers.Recordset!密碼Elsestr

9、username = strpassword = End IIf strusername = txtUserName.Text And strpassword = txtPassword.Text Thenadousers.Recordset.CloseUnload Mefrmmdi.Show ElseMsgBox 用戶名或密碼不對(duì)!, vbOKOnly + vbInformation, 提示 intlogintimes = intlogintimes + 1 If intlogintimes = 3 Thenadousers.Recordset.Close EndEnd IftxtPassw

10、ord.SetFocus SendKeys HOME+END End If End Sub Private Sub cmdcancel_click() Unload Me End Sub322 添加新用戶用于添加新的用戶包括用戶名,密碼,及職務(wù) 工作界面設(shè)計(jì)如圖 圖3.2添加用戶窗體程序代碼如下:Private Sub Command1_Click()opentable adousers, usersinfoadousers.RefreshWith adousers.RecordsetDim i As IntegerIf Trim(Text1(0).Text) = Then MsgBox 用戶

11、名不能為空!, vbExclamation + vbOKOnly, 警告 Text1(0).SetFocus Exit SubEnd IfIf Trim(Text1(1).Text) = Then MsgBox 密碼不能為空!, vbExclamation + vbOKOnly, 警告 Text1(1).SetFocus Exit SubEnd IfIf Trim(Text1(2).Text) = Then MsgBox 確認(rèn)密碼不能為空!, vbExclamation + vbOKOnly, 警告 Text1(2).SetFocusExit SubEnd IfIf Trim(Text1(1)

12、.Text) Trim(Text1(2).Text) Then MsgBox 確認(rèn)密碼不正確!, vbExclamation + vbOKOnly, 警告 Text1(2).SetFocusExit SubEnd If opentable adousers, usersinfo adousers.Refresh adousers.Recordset.Find 姓名= & & Text1(0).Text & , , adSearchForward, 1If adousers.Recordset.EOF = False Then MsgBox 已存在該用戶!, vbExclamation + vb

13、OKOnly, 警告 Text1(0).SetFocus Text1(0).SelStart = 0 Text1(0).SelLength = Len(Text1(0).Text) Exit SubEnd If opentable adousers, usersinfo .AddNew !姓名 = Trim(Text1(0).Text) !密碼 = Trim(Text1(1).Text) If Option1(0) Then !權(quán)限 = 1 If Option1(1) Then !權(quán)限 = 2 If Option1(2) Then !權(quán)限 = 3 .Update MsgBox 用戶添加成功!,

14、 vbExclamation + vbOKOnly, 警告 Text1(0).Text = Text1(1).Text = Text1(2).Text = End With Unload MeEnd SubPrivate Sub Command2_Click()Unload MeEnd Sub33 創(chuàng)建系統(tǒng)主界面當(dāng)系統(tǒng)運(yùn)行時(shí),首先進(jìn)入登錄界面,當(dāng)輸入帳號(hào),密碼合法時(shí),則啟動(dòng)系統(tǒng)主界面。主窗體是進(jìn)入其他模塊的入口。本系統(tǒng)主界面采用多文檔界面,設(shè)計(jì)情況如圖 圖3.3主界面窗體設(shè)計(jì)主界面菜單項(xiàng)在操作項(xiàng)目比較多的情況下,通常是通過菜單來調(diào)用下級(jí)程序。菜單項(xiàng)的設(shè)計(jì)包含設(shè)置快捷鍵與訪問鍵,設(shè)置如表: 主窗

15、體菜單表3.4級(jí)別菜單名稱快捷鍵訪問鍵主菜單系統(tǒng)功能mnuSystem&S子菜單用戶管理mnuUserCtrl+U&U退出系統(tǒng)mnuExit&X主菜單基本信息管理mnuInfo&I子菜單客房信息mnuRoomInfoCtrl+R&R入住情況mnuGuest&G退房記錄mnuQuit&C主菜單信息查詢mnuQuerySelect&Q主菜單報(bào)表輸出mnuReport&R子菜單房間情況表mnuReportRoomCtrl+R&R收費(fèi)情況表mnuReportMoney&M主菜單窗口布局mnuWindow&W子菜單水平平鋪mnuHorCtrl+R&H垂直平鋪mnuVer&V層疊mnuCascade&C排

16、列圖標(biāo)mnuIcon&I主菜單幫助信息mnuHelpCtrl+H&H內(nèi)容mnuContent&C索引mnuIndex&I設(shè)計(jì)主界面Option ExplicitPrivate Sub MDIForm_Load()App.Title = 賓館客房管理系統(tǒng)opentable adoroom, roomopentable adoguest, guestopentable adoquit, quitEnd SubPrivate Sub mnuCascade_Click()frmmdi.Arrange vbCascadeEnd SubPrivate Sub mnudenglu_Click()frmLog

17、in.ShowEnd SubPrivate Sub mnuExit_Click()Unload MeEnd SubPrivate Sub mnuGuest_Click()frmGuestInfo.ShowEnd SubPrivate Sub mnuHor_Click()frmmdi.Arrange vbTileHorizontalEnd SubPrivate Sub mnuIcon_Click()frmmdi.Arrange vbArrangeIconsEnd SubPrivate Sub mnuqueryguest_Click()frmqueryinfo.ShowEnd SubPrivate

18、 Sub mnuqueryroom_Click()frmqueryroom.ShowEnd SubPrivate Sub mnuQuit_Click()frmquitinfo.ShowEnd SubPrivate Sub mnuRoomInfo_Click()frmroominfo.ShowEnd SubPrivate Sub mnuUser_Click()frmusers.ShowEnd SubPrivate Sub mnuver_Click()frmmdi.Arrange vbTileVerticalEnd SubPrivate Sub toolbar1_buttonclick(ByVal

19、 button As MSComctlLib.button) Select Case button.Index Case 1 mnuRoomInfo_Click Case 2 mnuGuest_Click Case 3 mnuQuit_Click Case 4 mnuqueryroom_Click Case 5 mnuReportRoom_Click Case 6 mnuExit_Click End Select End Sub34 制作客戶信息登記窗體客戶信息窗體包括對(duì)全體旅客信息瀏覽,修改及刪除的窗體和添加新入住旅客信息窗體。旅客基本信息窗體,工作界面設(shè)計(jì)情況如圖: 控件屬性表3.5控件名

20、稱屬性設(shè)置值DataGrid1(名稱)dtgGuestInfoCommand1(名稱)cmdAddNewCaption添加(&A)Command2(名稱)cmdEditCaption修改(&E)控件名稱屬性設(shè)置值Command3(名稱)cmdDeleteCaption刪除(&D)Command4(名稱)cmdExitCaption退出(&X) 圖3.6旅客信息窗體程序代碼如下:Option ExplicitPrivate Sub dtgguestrefresh()With dtgguestinfo Set .DataSource = frmmdi.adoguest .AllowRowSizin

21、g = False .HeadFont = 2 .MarqueeStyle = dbgHighlightRow .AllowAddNew = False .AllowDelete = False .AllowUpdate = False .Columns(0).Caption = 登記號(hào) .Columns(0).Width = 600 .Columns(0).AllowSizing = False .Columns(1).Caption = 客人姓名 .Columns(1).Width = 600 .Columns(1).AllowSizing = False .Columns(2).Capt

22、ion = 身份證號(hào)碼 .Columns(2).Width = 1500 .Columns(2).AllowSizing = False .Columns(3).Caption = 房間號(hào) .Columns(3).Width = 600 .Columns(3).AllowSizing = False .Columns(4).Caption = 登記日期 .Columns(4).Width = 1000 .Columns(4).AllowSizing = False .Columns(5).Caption = 性別 .Columns(5).Width = 500 .Columns(5).Allo

23、wSizing = False .Columns(6).Caption = 籍貫 .Columns(6).Width = 2000 .Columns(6).AllowSizing = False End With End SubPrivate Sub cmdaddnew_Click()With frmguestinfoedit .Caption = 添加新旅客 .txtbookno.Locked = False .txtbookno.Text = .txtguestname.Text = .txtcardid.Text = .txtroomno.Text = dtpbookdate.Text

24、= Date .dtpbookdate.Enabled = False End With frmguestinfoedit.ShowEnd SubPrivate Sub cmddelete_Click()If frmmdi.adoguest.Recordset.EOF True And frmmdi.adoguest.Recordset.BOF True Then With frmmdi.adoroom.Recordset If MsgBox(確認(rèn)要?jiǎng)h除當(dāng)前記錄嗎?, vbYesNo + vbQuestion + vbDefaultButton2, 確認(rèn)框) = vbYes Then .Fin

25、d 房間號(hào)= & & frmmdi.adoguest.Recordset!房間號(hào) & , , adSearchForward, 1 If Not .EOF Then !客房狀態(tài) = 空 End If With frmmdi.adoguest.Recordset .Delete End With frmGuestInfo.SetFocus End If End With End IfEnd SubPrivate Sub cmdedit_Click() If frmmdi.adoguest.Recordset.EOF True And frmmdi.adoguest.Recordset.BOF T

26、rue Then With frmguestinfoedit .Caption = 修改客人信息 .txtbookno.Text = frmmdi.adoguest.Recordset!登記號(hào) .txtbookno.Locked = True .txtbookno.Enabled = False .txtguestname.Text = frmmdi.adoguest.Recordset!姓名 .txtcardid.Text = frmmdi.adoguest.Recordset!身份證號(hào)碼 .txtroomno = frmmdi.adoguest.Recordset!房間號(hào) .dtpbook

27、date.Text = frmmdi.adoguest.Recordset!登記日期 .dtpbookdate.Enabled = False End With End If frmguestinfoedit.ShowEnd SubPrivate Sub cmdexit_Click() Unload MeEnd SubPrivate Sub Form_Load()Me.Left = (frmmdi.Width - Me.Width) / 2Me.Top = (frmmdi.Height - Me.Height) / 4dtgguestrefreshEnd Sub35 旅客信息登記窗體本窗體用于

28、當(dāng)旅客入住時(shí),登記其基本信息,包括入住房間號(hào)。 圖 3.7添加新旅客窗體窗體初始化與激活事件代碼:Option ExplicitDim proomno As StringPrivate Sub cmdcancle_Click()Unload MeEnd SubPrivate Sub cmdok_Click()With frmmdi.adoguest.Recordset If Not txtbookno.Locked Then If Trim(txtbookno.Text) = Then MsgBox 登記號(hào)不能為空!, vbOKOnly + vbInformation, 提示 txtbookn

29、o.SetFocus Exit Sub End If .Find 房間號(hào)= & & txtbookno & , , adSearchForward, 1 If Not .EOF Then MsgBox 已經(jīng)有相同登記號(hào)!, vbOKOnly + vbInformation, 提示txtbookno.SetFocus Exit Sub End If frmmdi.adoroom.Recordset.Find 房間號(hào)= & & Trim(txtroomno.Text) & , , adSearchForward, 1 If Not frmmdi.adoroom.Recordset.EOF Then

30、 If frmmdi.adoroom.Recordset!客房狀態(tài) 空 Then MsgBox 已有客人居?。? vbOKOnly + vbInformation, 提示 txtroomno.SetFocus Exit Sub End If Else MsgBox 沒有此客房編號(hào),請(qǐng)重新輸入!, vbOKOnly + vbInformation, 提示 txtroomno.SetFocus Exit Sub End If If Trim(txtguestname.Text) = Then MsgBox 客人姓名不能為空!, vbOKOnly + vbInformation, 提示 txtgue

31、stname.SetFocus Exit Sub End If .AddNew !登記號(hào) = Trim(txtbookno.Text) frmmdi.adoroom.Recordset.Find 房間號(hào)= & &Trim(txtroomno.Text) & , , adSearchForward, 1 frmmdi.adoroom.Recordset!客房狀態(tài) = 有人 End If !姓名 = txtguestname.Text !身份證號(hào)碼 = txtcardid.Text !性別 = txtsex.Text !籍貫 = txtpro.Text If txtbookno.Locked Th

32、en If Trim(txtroomno.Text) proomno Then With frmmdi.adoroom.Recordset .Find 房間號(hào)= & & Trim(txtroomno.Text) & , , adSearchForward, 1 !客房狀態(tài) = 有人 .Find 房間號(hào)= & & proomno & , , adSearchForward, 1 !客房狀態(tài) = 空 End With End If End If !房間號(hào) = Trim(txtroomno.Text) !登記日期 = dtpbookdate.Text .Update Unload Me End Wi

33、th End SubPrivate Sub form_activate()proomno = Trim(txtroomno.Text)End Sub36 制作退房信息處理窗體當(dāng)旅客離開賓館時(shí),需要為其辦理退房手續(xù),在這過程中需要在旅客退房信息表中添加記錄信息,以及修改客房信息表,改變客房狀態(tài)。旅客退房信息窗體,工作界面設(shè)計(jì)情況如圖: 圖3.8退房窗體程序代碼如下:Private Sub dtgQuitRefresh() With dtgQuitInfo 綁定 Set .DataSource = frmmdi.adoquit .AllowRowSizing = False 表頭寬度設(shè)為兩行 .H

34、eadLines = 2 選擇方式為整行選中 .MarqueeStyle = dbgHighlightRow 不允許修改(設(shè)為只讀) .AllowAddNew = False .AllowDelete = False .AllowUpdate = False 第一列標(biāo)題和寬度 .Columns(0).Caption = 登記號(hào) .Columns(0).Width = 700 .Columns(0).AllowSizing = False 第二列標(biāo)題和寬度 .Columns(1).Caption = 登記日期 .Columns(1).Width = 1200 .Columns(1).AllowS

35、izing = False 第三列標(biāo)題和寬度 .Columns(2).Caption = 退房時(shí)間 .Columns(2).Width = 1200 .Columns(2).AllowSizing = False 第四列標(biāo)題和寬度 .Columns(3).Caption = 付費(fèi)金額 .Columns(3).Width = 1200 .Columns(3).AllowSizing = False .Columns(4).Caption = 備注 .Columns(4).Width = 4000Columns(4).AllowSizing = False End WithEnd SubPriva

36、te Sub cmdaddnew_Click() With frmquitinfoedit 窗體標(biāo)題 .Caption = 添加退房信息 .txtbookno.Locked = False .txtbookno.Text = .txtpaymoney.Text = .txtinfo.Text = .dtpquitdate.Text = Date 顯示為模式窗體 .Show End WithEnd SubPrivate Sub cmddelete_Click()If frmmdi.adoquit.Recordset.EOF True And frmmdi.adoquit.Recordset.BO

37、F True Then With frmmdi.adoquit.Recordset If MsgBox(確認(rèn)要?jiǎng)h除當(dāng)前記錄嗎?, vbYesNo + vbQuestion + vbDefaultButton2, 確認(rèn)框) = vbYes Then Find 登記號(hào)= & frmmdi.adoquit.Recordset!登記號(hào) & , , adSearchForward, 1 If Not .EOF Then !QuitStatus = False End If With frmmdi.adoquit.Recordset.Delete End With dtgQuitInfo.SetFocus

38、 End If End WithEnd IfEnd SubPrivate Sub cmdedit_Click() If frmmdi.adoguest.Recordset.EOF True And frmmdi.adoguest.Recordset.BOF True Then With frmquitinfoedit 窗體標(biāo)題 .Caption = 修改退房信息 .txtbookno.Text = frmmdi.adoquit.Recordset!登記號(hào) .txtbookno.Locked = True .txtpaymoney.Text = frmmdi.adoquit.Recordset!

39、付款金額 .TxtInfo.Text = frmMDI.AdoQuit.Recordset!QuitInfo .dtpquitdate.Text = frmmdi.adoquit.Recordset!退房時(shí)間 .ShowEnd With End IfEnd SubPrivate Sub cmdexit_Click() Unload MeEnd SubPrivate Sub Form_Load() Me.Height = 4155 Me.Width = 7920 Me.Left = (frmmdi.Width - Me.Width) / 2 Me.Top = (frmmdi.Height - M

40、e.Height) / 4 dtgQuitRefreshEnd Sub37 添加退房信息窗體本窗體用于當(dāng)旅客離開時(shí),登記旅客退房信息,以及計(jì)算并記錄付額, : 圖3.9添加退房信息窗體程序代碼如下:Private Sub CmdOK_Click()With frmmdi.adoquit.Recordset If Not txtbookno.Locked Then 可修改狀態(tài)表示是添加記錄 If Trim(txtbookno.Text) = Then MsgBox 登記號(hào)不能為空!, vbOKOnly + vbInformation, 提示 txtbookno.SetFocus Exit Sub

41、 End If frmmdi.adoguest.Recordset.Find 登記號(hào)= & Trim(txtbookno.Text) & , ,adSearchForward, 1 If frmmdi.adoguest.Recordset.EOF Then 有就提示,然后退出 MsgBox 非法登記號(hào)!, vbOKOnly + vbInformation, 提示 txtbookno.SetFocusSendKeys HOME+END txtpaymoney.Text = Exit Sub End If frmmdi.adoquit.Recordset.Find 登記號(hào)= & Trim(txtb

42、ookno.Text) & , , adSearchForward, 1 If Not frmmdi.adoquit.Recordset.EOF Then 有就提示,然后退出 MsgBox 已經(jīng)有相同登記號(hào)!, vbOKOnly + vbInformation, 提示 txtbookno.SetFocus SendKeys HOME+END txtpaymoney.Text = Exit Sub End If 沒有就添加記錄 .AddNew !登記號(hào) = Trim(txtbookno.Text) End If 給字段賦值 !付款金額 = Val(Trim(txtpaymoney.Text) !

43、退房時(shí)間 = dtpquitdate.Text If txtinfo.Text = Then MsgBox 備注不能為空!, vbOKOnly + vbInformation, 提示 txtinfo.SetFocus !退房備注信息 = txtinfo.TextEnd If .Update 退出窗體 Unload MeEnd WithEnd SubPrivate Sub CmdQuit_Click() 退出窗體 Unload MeEnd SubPrivate Sub Form_Load() Me.Height = 3405 Me.Width = 7440End Sub38制作旅客查詢窗體旅客查

44、詢窗體主要功能是實(shí)現(xiàn)客房信息查詢顯示,查詢方式可以是按旅客姓名,登記號(hào)也可以按房間號(hào)查詢。工作界面如圖:旅客查詢窗體控件屬性表3.10控件名稱屬性設(shè)置值DataGrid1(名稱)dtgQueryOption1(名稱)OptRoomNoCaption房間號(hào)Option2(名稱)OptionNameCaption旅客姓名Option3(名稱)optBookNoCaption登記號(hào)Text1(名稱)TxtValue 圖3.11旅客信息查詢窗體程序代碼如Option ExplicitPrivate Sub dtgqueryrefresh()With dtgquery Set .DataSource =

45、 frmmdi.adoguest .AllowRowSizing = False .HeadFont = 2 .MarqueeStyle = dbgHighlightRow.AllowAddNew = False .AllowDelete = False.AllowUpdate = False.Columns(0).Caption = 登記號(hào).Columns(0).Width = 600 .Columns(0).AllowSizing = False .Columns(1).Caption = 客人姓名 .Columns(1).Width = 600.Columns(1).AllowSizin

46、g = False .Columns(2).Caption = 身份證號(hào)碼 .Columns(2).Width = 1500 .Columns(2).AllowSizing = False .Columns(3).Caption = 房間號(hào).Columns(3).Width = 600 .Columns(3).AllowSizing = False.Columns(4).Caption = 登記日期 .Columns(4).Width = 1000 .Columns(4).AllowSizing = False .Columns(5).Caption = 性別 .Columns(5).Widt

47、h = 500 .Columns(5).AllowSizing = False .Columns(6).Caption = 籍貫.Columns(6).Width = 2000 .Columns(6).AllowSizing = False End With End SubPrivate Sub Command1_Click()If optroomno Then opentable frmmdi.adoguest, select * from guest where (guest.房間號(hào)) like & Trim(txtvalue.Text) & % ) ElseIf optname Then

48、 opentable frmmdi.adoguest, select * from guest where (guest.姓名) like & Trim(txtvalue.Text) & % ) ElseIf optbookno Then opentable frmmdi.adoguest, select * from guest where (guest.登記號(hào)) like & Trim(txtvalue.Text) & %) End If dtgqueryrefreshEnd SubPrivate Sub Form_Load()Me.Left = (frmmdi.Width - Me.Wi

49、dth) / 2Me.Left = (frmmdi.Height - Me.Height) / 2opentable frmmdi.adoguest, select * from guest order by 登記號(hào)dtgqueryrefreshEnd SubPrivate Sub optname_Click()txtvalue.Text = txtvalue.Visible = TrueFrame2.Caption = 按姓名查詢Frame2.Visible = TrueSendKeys TABEnd SubPrivate Sub optroomno_click()txtvalue.Text

50、 = txtvalue.Visible = TrueFrame2.Caption = 按房間號(hào)查詢Frame2.Visible = TrueSendKeys TABEnd SubPrivate Sub optbookno_click()txtvalue.Text = Label1.Visible = Truetxtvalue.Visible = TrueFrame2.Caption = 按登記號(hào)查詢Frame2.Visible = TrueSendKeys TABEnd Sub39 查詢客房信息客房查詢窗體主要功能是實(shí)現(xiàn)客房信息查詢顯示,查詢方式可以按房間號(hào),客房等級(jí),客房類型查詢,工作界面如

51、圖: 圖3.12客房信息查詢程序代碼如下:Private Sub dtgroomqueryinforefresh()With dtgroomqueryinfo Set .DataSource = frmmdi.adoroom.AllowRowSizing = False .HeadFont = 2 .MarqueeStyle = dbgHighlightRow .AllowAddNew = False .AllowDelete = False .AllowUpdate = False .Columns(0).Caption = 房間號(hào) .Columns(0).Width = 600 .Columns(0).AllowSizing = False .Columns(1).Caption = 客房等級(jí) .Columns(1).Width = 800 .Columns(1).AllowSizing = False .Columns(2).Caption = 客房類型 .Columns(2).Width = 800 .

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝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)論