宾馆客房管理系统
Private Sub ZSDJ_Change(Index As Integer)
Select Case Index
Case 6
ZSDJ(7).Text = Format(Val(ZSDJ(6).Text) * Val(ZSDJ(5).Text), "0.00") '计算折前宿费
ZSDJ(9).Text = ZSDJ(7).Text '赋值给ZSDJ(9)
ZSDJ(8).Text = 100
DTP3.Value = DTP1.Value + Val(ZSDJ(6).Text) '计算退宿日期
Case 8
ZSDJ(9).Text = Format(Val(ZSDJ(7).Text) * Val(ZSDJ(8).Text) / 100, "0.00") '计算实际宿费
Case 10
If ZSDJ(10).Text <> "" Then
ZSDJ(10).Text = Val(ZSDJ(10).Text) '用val函数将字符串转换为数字
DTP2.Value = DTP1.Value + Int(Val(ZSDJ(10).Text) / Val(ZSDJ(5).Text)) '计算提醒日期
If (Val(ZSDJ(10).Text) - Int(Val(ZSDJ(10).Text) / Val(ZSDJ(5).Text))) > 0.5 * Val(ZSDJ(5).Text) Then
tim2.Value = #6:00:00 PM#
Else
tim2.Value = #12:00:00 AM#
End If
End If
End Select
End Sub
Private Sub ZSDJ_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
Select Case Index
Case 0
If KeyCode = vbKeyReturn Then Combo1.SetFocus '按回车键Combo1获得焦点
Case 1
If KeyCode = vbKeyReturn Then ZSDJ(2).SetFocus '按回车键ZSDJ(2)获得焦点
Case 2
If KeyCode = vbKeyReturn Then ZSDJ(3).SetFocus '按回车键ZSDJ(3)获得焦点
Case 3
If KeyCode = vbKeyReturn Then DBCombo1.SetFocus '按回车键ZSDJ(2)获得焦点
Case 4
If KeyCode = vbKeyReturn Then ZSDJ(5).SetFocus '按回车键ZSDJ(5)获得焦点
Case 5
If KeyCode = vbKeyReturn Then ZSDJ(6).SetFocus '按回车键ZSDJ(6)获得焦点
Case 6
If KeyCode = vbKeyReturn Then ZSDJ(10).SetFocus
Case 8
If KeyCode = vbKeyReturn Then ZSDJ(10).SetFocus '按回车键ZSDJ(10)获得焦点
Case 10
If KeyCode = vbKeyReturn Then ZSDJ(11).SetFocus 'ZSDJ(11)获得焦点
Case 11
If KeyCode = vbKeyReturn Then Comok.SetFocus '按回车键Comok获得焦点
End Select
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then ZSDJ(1).SetFocus '按回车键ZSDJ(1)获得焦点
End Sub
Private Sub DTP2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then tim3.SetFocus '按回车键tim3获得焦点
End Sub
Private Sub DTP3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then tim4.SetFocus '按回车键tim4获得焦点
End Sub
Private Sub tim3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then DTP3.SetFocus '按回车键DTP3获得焦点
End Sub
Private Sub tim4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text10.SetFocus '按回车键Text10获得焦点
End Sub
Private Sub DBCombo1_Change()
'查询空闲房间信息
Data2.RecordSource = "select * from kf where 房间号='" & DBCombo1.Text & "'and 房态='空房'"
Data2.Refresh
'查询住宿登记信息
Data1.RecordSource = "select * from djb where 房间号='" & DBCombo1.Text & "'and 标志='1'"
Data1.Refresh
If Data2.Recordset.RecordCount > 0 Then
If Data1.Recordset.RecordCount = 0 Then
ZSDJ(4).Text = Data2.Recordset.Fields("房间类型") '赋值给ZSDJ(4)
ZSDJ(5).Text = Data2.Recordset.Fields("价格") '赋值给ZSDJ(5)
Else
MsgBox ("此房间已占用或停止使用!!")
End If
End If
End Sub
Private Sub DBCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then ZSDJ(5).SetFocus 'ZSDJ(5)获得焦点
End Sub
Private Sub comdj_Click()
'查询空闲房间信息
Data2.RecordSource = "select * from kf where 房态='空房'"
Data2.Refresh
Data3.RecordSource = "select * from kf where 房态='空房'"
Data3.Refresh
'生成凭证号码
Data1.RecordSource = "select * from djb order by 凭证号码"
Data1.Refresh
If Not Data1.Recordset.EOF Then Data1.Recordset.MoveLast
If lsph.Text = "" Then bh.Text = Date & "d" & Format(1, "###000")
If lsph.Text <> "" Then
y1.Text = Month(Date)
y2.Text = Month(Left(lsph.Text, 10))
If y1.Text = y2.Text Then
bh.Text = Date & "d" & Format(Val(Right(lsph.Text, 3)) + 1, "###000")
End If
If y1.Text <> y2.Text Then
bh.Text = Date & "d" & Format(1, "###000")
End If
End If
'清空数据
For i = 0 To 6
ZSDJ(i).Text = ""
ZSDJ(i).Enabled = True
Next i
ZSDJ(8).Text = "": ZSDJ(10).Text = "": ZSDJ(11).Text = "": DBCombo1.Text = "": DBCombo1.Text = ""
'设置控件有效或无效
Comok.Enabled = True: Comdj.Enabled = False: Comprint.Enabled = False: ZSDJ(8).Enabled = True
ZSDJ(10).Enabled = True: ZSDJ(11).Enabled = True: DBCombo1.Enabled = True: Combo1.Enabled = True
Combo2.Enabled = True: ZSDJ(0).SetFocus 'ZSDJ(0)获得焦点
End Sub
Private Sub comok_Click()
Dim mydb1 As Database
Dim myrs1 As Recordset
Set mydb1 = Workspaces(0).OpenDatabase(App.Path & "\kfgl.mdb")
Set myrs1 = mydb1.OpenRecordset("djys", dbOpenTable)
Data1.Recordset.FindFirst "房间号 like" + Chr(34) + DBCombo1.Text + Chr(34) + "and 标志 like" + Chr(34) + "1" + Chr(34) + ""
If Data1.Recordset.NoMatch Then
'添加住宿信息
Data1.Recordset.AddNew
If bh.Text <> "" Then Data1.Recordset.Fields("凭证号码") = bh.Text
If ZSDJ(0).Text <> "" Then Data1.Recordset.Fields("姓名") = ZSDJ(0).Text
If Combo1.Text <> "" Then Data1.Recordset.Fields("证件名称") = Combo1.Text
If ZSDJ(1).Text <> "" Then Data1.Recordset.Fields("证件号码") = ZSDJ(1).Text
If ZSDJ(2).Text <> "" Then Data1.Recordset.Fields("详细地址") = ZSDJ(2).Text
If ZSDJ(3).Text <> "" Then Data1.Recordset.Fields("出差事由") = ZSDJ(3).Text
If DBCombo1.Text <> "" Then Data1.Recordset.Fields("房间号") = Val(DBCombo1.Text)
If ZSDJ(4).Text <> "" Then Data1.Recordset.Fields("客房类型") = ZSDJ(4).Text
If DTP1.Value <> "" Then Data1.Recordset.Fields("住宿日期") = DTP1.Value
If tim1.Value <> "" Then Data1.Recordset.Fields("住宿时间") = tim1.Value
If ZSDJ(5).Text <> "" Then Data1.Recordset.Fields("客房价格") = Val(ZSDJ(5).Text)
If ZSDJ(6).Text <> "" Then Data1.Recordset.Fields("住宿天数") = ZSDJ(6).Text
If ZSDJ(8).Text <> "" Then Data1.Recordset.Fields("折扣") = ZSDJ(8).Text
If ZSDJ(7).Text <> "" Then Data1.Recordset.Fields("宿费") = ZSDJ(7).Text
If Combo2.Text <> "" Then Data1.Recordset.Fields("结款方式") = Combo2.Text
If ZSDJ(9).Text <> "" Then Data1.Recordset.Fields("应收宿费") = ZSDJ(9).Text
If ZSDJ(10).Text <> "" Then Data1.Recordset.Fields("预收金额") = Val(ZSDJ(10).Text)
If DTP2.Value <> "" Then Data1.Recordset.Fields("提醒日期") = DTP2.Value
If tim2.Value <> "" Then Data1.Recordset.Fields("提醒时间") = tim2.Value
If DTP3.Value <> "" Then Data1.Recordset.Fields("退宿日期") = DTP3.Value
If tim3.Value <> "" Then Data1.Recordset.Fields("退宿时间") = tim3.Value
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>
宾馆客房管理系统ER图.数据流图.功能模块图.流程图 第6页下载如图片无法显示或论文不完整,请联系qq752018766