【正文】
And Then If MsgBox(“保存當(dāng)前記錄的變化嗎?”,vbOKCancel+vbExclamation,”警告”)=vbOK Then ‘保存 Call cmdSave_Click End IfEnd IfUnload MeEnd SubPrivate Sub txtItem_KeyDown(Index As Integer,KeyCode As Integer,Shift_ As Integer)‘輸入完內(nèi)容,單擊回車鍵將自動進(jìn)入下一個文本框,觸發(fā)文本框的Keydown事件 EnterToTab KeyCodeEnd Sub⑶修改客房標(biāo)準(zhǔn)窗體的創(chuàng)建Private Sub From_Load()ShowTitleShowDataflagTedit=TrueEnd SubPrivate Sub ShowTitle()‘調(diào)用showTitle函數(shù),顯示表頭Dim i As IntegerWith msgList .Cols=10 .TextMatrix(0,1)=”標(biāo)準(zhǔn)編號” .TextMatrix(0,2)=”標(biāo)準(zhǔn)名稱” .TextMatrix(0,3)=”房間面積” .TextMatrix(0,4)=”床位數(shù)量” .TextMatrix(0,5)=”是否有空調(diào)” .TextMatrix(0,6)=”是否有電話” .TextMatrix(0,7)=”是否有電視” .TextMatrix(0,8)=”是否有衛(wèi)生間” .TextMatrix(0,9)=”房間單價” .FixedRows=1‘固定表頭 For i=0 To 9 ‘設(shè)置各列的對齊方式 .ColAlignment(i)=0 Next i .FillStyle=flexFillRepeat‘表頭項(xiàng)居中 .Col=0 .Row=0 .RowSel=1 .ColSel=.Cols1 .CellAlignment=4 .ColWidth(0)=300‘設(shè)置單元大小 .ColWidth(1)=1000 .ColWidth(2)=2000 .ColWidth(3)=2000 .ColWidth(4)=1000 .ColWidth(5)=1000 .ColWidth(6)=1000 .ColWidth(7)=1000 .ColWidth(8)=1000 .ColWidth(9)=1000 .Row=1End WithEnd SubPrivate Sub ShowData()‘調(diào)用showData函數(shù),顯示記錄列表 Dim i As Integer Set mrc=ExecuteSQL(txtSQL,MsgText)‘根據(jù)需要設(shè)置SQL語句,顯示需要的記錄 With msgList .Rows=1 Do While Not .Rows=Rows+1 For i=1 To Select Case (i1).Type Case adDBDate .TextMatrix(.Rows1,i)=Format((i1)amp。”請輸入數(shù)字!”MsgBox sMeg,vbOKOnly+vbExclamation,”警告”txtItem(intCount).SeFocusExit Sub End If Next intCount If gintTmode=1 Then ‘判斷是否有相同ID記錄 txtSQL=”select*from roomtype where typeid_ =’”amp。 各個實(shí)體具體的描述ER圖如下:客房標(biāo)準(zhǔn)信息實(shí)體標(biāo)準(zhǔn)編號標(biāo)準(zhǔn)名稱床位數(shù)量客房單價客房標(biāo)準(zhǔn)信息實(shí)體ER圖客房信息實(shí)體客房標(biāo)準(zhǔn)客房編號客房位置客房單價客房信息實(shí)體ER圖訂房信息實(shí)體客房信息顧客信息折 扣入住時間訂房信息實(shí)體ER圖結(jié)算信息實(shí)體客房信息顧客信息結(jié)算時間結(jié)算金額結(jié)算信息實(shí)體ER圖客房標(biāo)準(zhǔn)信息客房登記客房信息管理訂 房訂房信息管理結(jié)算信息管理客房結(jié)算實(shí)體之間關(guān)系ER圖③數(shù)據(jù)庫邏輯結(jié)構(gòu)設(shè)計 首先將賓館管理信息系統(tǒng)的數(shù)據(jù)庫概念結(jié)構(gòu)轉(zhuǎn)化為SQL 2000數(shù)據(jù)庫系統(tǒng)所支持的實(shí)際數(shù)據(jù)模型,即:數(shù)據(jù)庫的邏輯結(jié)構(gòu)?!?訂房信息的修改和查詢,包括客房編號、客房種類、客房位置、客房單價、顧客姓名、顧客身份證號碼、入住日期、折扣、備注信息等。賓館管理信息系統(tǒng)系統(tǒng)平臺:Windows 2000數(shù)據(jù)庫服務(wù)器:Microsoft SQL Server 2000開發(fā)工具:Visual Basic 系統(tǒng)開發(fā)人員: ⒈編寫目的賓館在正常的運(yùn)營中需要對客房資源、顧客信息、結(jié)算信息進(jìn)行管理,利用賓館管理信息系統(tǒng)及時了解各個環(huán)節(jié)中信息的變更,有利于提高管理效率?!?訂房信息的輸入,包括客房編號、客房種類、客房位置、客房單價、顧客姓名、顧客身份證號碼、入住日期、折扣、備注信息等。②數(shù)據(jù)庫概念結(jié)構(gòu)設(shè)計 本系統(tǒng)根據(jù)以上的設(shè)計規(guī)劃出的實(shí)體有:客房標(biāo)準(zhǔn)信息實(shí)體、客房信息實(shí)體、訂房信息實(shí)體、結(jié)算信息實(shí)體。用戶登陸。”不能為空!” MsgBox sMeg,vbOkOnly+vbExclamation,”警告” txtItem(intCount).SetFocus Exit Sub End if Next intCount ‘判斷輸入內(nèi)容是否為數(shù)字 For intCount=2 To 4 If Not IsNumeric(Trim(txtItem(intCount))) Then Select Case intCount Case 2 sMeg=”房間面積” Case 3 sMeg=”床位數(shù)量” Case 4 sMeg=”床位單價” End Select sMeg=sMegamp。Trim(txtItem(0))amp。添加客房信息 Trim(txtItem(0))amp。刪除客房信息Private Sub menuDeleteroom_Click() Dim txtSQL As String Dim intCount As Integer Dim mrc As Dim MsgText As String If flagTedit Then If 1 Then‘判斷客房信息列表內(nèi)容是否為空 If MsgBox(“真的要刪除這條文件記錄么?”,vbOKCancel+vbExclamation,“警告”)=vbOK Then intCount=‘記載當(dāng)前記錄位置 txtSQL=”delete from rooms where roomNO=‘”amp。Trim(Combo1amp。查詢剩余客房信息””)=”” Then If Trim(Combo1(1)amp?!薄?=””And Trim(Combo1(2)amp?!薄?amp。Trim(Combo1(2)amp。”’” ElseIf Trim(Combo1(1)amp?!盿nd putup”’y’” flagSedit=True End If End SubPrivate Sub From_Load()‘添加訂房信息,載入窗體時把所有未預(yù)定的客房信息加入其中 Dim sSql As String Dim intCount As Integer Dim MsgText As String If flagSedit Then ‘判斷打開方式 Set mrc=ExecuteSQL(txtSQL,MsgText) If Not Then For intCount=0 To 3 cboItem(intCount).AddItem (intCount) cboItem(intCount).ListIndex=0 Next intCount txtItem(5)=(5) End If txtNo=GetRkno() gintBmode=1 Else If gintBmode=1 Then =amp?!安荒転榭眨 ? MsgBox sMeg,vbOKOnly+vbExclamation,“警告” cboItem(intCount).SetFocus Exit Sub End If Next intCount If IsDate(txtItem(2)) Then txtItem(2)=Format(txtItem(2),”yyyymmdd”) Else MsgBox “入庫時間應(yīng)輸入日期(yyyymmdd)!”,vbOKOnly+vbExclamation,”警告” txtItem(2).SetFocus Exit Sub End If For intCount=1 To 3 Step 2 If Not IsNumeric(txtItem(intCount)) Then MsgBox “請輸入數(shù)字”,vbOKOnly+vbExclamation,“警告” txtItem(intCount).SetFocus Exit Sub End If Next intCount If gintBmode =2 Then txtSQL=”delete from booking where bookno=’”amp?!疤砑印? txtSQL=”select DISTINCT roomno from booking where amount=’0’”‘初始化客房編號,選擇所有未結(jié)算客房編號 Set mrc=ExecuteSQL(txtSQL,MsgText) If Not Then Do While Not cboItem(0).AddItem Trim(mrc!roomno) Loop Else MsgBox “沒有顧客入住!”,vbOKOnly+vbExclamation,“警告” =False Exit Sub End If ElseIf gintCmode=2 Then‘判斷是否處于修改狀態(tài) Set mrc=ExecuteSQL(txtSQL,MsgText) If =False Then With mrc txtNo =(0) For intCount=0 To 1 txtItem(intCount)=.Fields(intCount+1) Next intCount cboItem(0).(3) cboItem(0).ListIndex=0 For intCount=2 To 3 If Not IsNull(.Fields(intCount+2)) Then txtItem(intCount)=.Fields(intCount+2) End If Next intCount txtItem(5)=.Fields(6) txtItem(4)=.Fields(7) End With End If txtSQL=”select*from rooms where roomNO=’”