宾馆客房管理系统
ublic Sub JS() '定义计算住宿天数的函数
If DTP2.Value > DTP1.Value Then
If tim2.Value > #11:59:00 PM# Then
If tim2.Value > #12:00:00 PM# Then
If tim2.Value > #6:00:00 PM# Then
Texts.Text = DTP2.Value - DTP1.Value + 1
Else
Texts.Text = DTP2.Value - DTP1.Value + 0.5
End If
Else
Texts.Text = DTP2.Value - DTP1.Value
End If
Else
Texts.Text = DTP2.Value - DTP1.Value
End If
Else
If tim1.Value < #2:00:00 AM# Then
If tim2.Value > #2:00:00 AM# Then
If tim2.Value > #12:00:00 PM# Then
If tim2.Value > #6:00:00 PM# Then
Texts.Text = 1 + 1
Else
Texts.Text = 1 + 0.5
End If
Else
Texts.Text = 1
End If
Else
Texts.Text = 1
End If
Else
Texts.Text = 1
End If
End If
End Sub
Public Sub ssje() '定义计算实收金额和退还金额的函数
Texssje.Text = Val(Texzhje.Text) + Val(Texzf.Text) + Val(Texdhf.Text) + Val(Texpcf.Text) + Val(Texhyf.Text) + Val(Textcf.Text)
Texthje.Text = Val(Texyj.Text) - Val(Texssje.Text)
End Sub
Private Sub Form_Load()
'自动识别数据库路径
Data1.DatabaseName = App.Path & "\KFGL.MDB"
Data2.DatabaseName = App.Path & "\KFGL.MDB"
Data3.DatabaseName = App.Path & "\KFGL.MDB"
Data4.DatabaseName = App.Path & "\KFGL.MDB"
Data5.DatabaseName = App.Path & "\KFGL.MDB"
End Sub
Private Sub Form_Activate()
czy.Text = main.StatusBar1.Panels(4).Text '赋值给czy
DTP2.Value = Date: tim2.Value = Time
'查询住宿登记信息
Data5.RecordSource = "select 凭证号码 from djb where 标志='1'order by 凭证号码"
Data5.Refresh
End Sub
Private Sub Form_Unload(Cancel As Integer)
main.Enabled = True '设置主窗体有效
End Sub
Private Sub DBCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then DBCombo2.SetFocus '按回车键DBCombo2获得焦点
End Sub
Private Sub DBCOMBO2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then DTP1.SetFocus '按回车键DTP1获得焦点
End Sub
Private Sub Combo2_Click()
If Combo2.Text = "折扣" Then
Texzk.Text = 100 '赋值给Texzk.text
Else
Texzk.Text = 0
End If
If Combo2.Text = "挂帐" Then
Lab10.Visible = True
Texgzdw.Visible = True
Texgzdw.Text = Texxm.Text '赋值给Texxm.text
Else
Lab10.Visible = False
Texgzdw.Visible = False '设置Texgzdw不可见
Texgzdw.Text = ""
End If
End Sub
Private Sub Combo3_Click()
Texfjf.SetFocus 'Texfjf获得焦点
Texfjf.Text = "0" '赋值给Texfjf.text
End Sub
Private Sub DBCombo4_Change()
If DBCombo4.Text <> "" Then
'查询住宿登记信息
Data1.RecordSource = "select * from djb where 凭证号码='" + DBCombo4.Text + "'"
Data1.Refresh
bh.Text = "T" & DBCombo4.Text
'赋值给texxm.text等
If Data1.Recordset.RecordCount > 0 Then
If Data1.Recordset.Fields("姓名") <> "" Then Texxm.Text = Data1.Recordset.Fields("姓名")
If Data1.Recordset.Fields("证件名称") <> "" Then Combo1.Text = Data1.Recordset.Fields("证件名称")
If Data1.Recordset.Fields("证件号码") <> "" Then Texsfz.Text = Data1.Recordset.Fields("证件号码")
If Data1.Recordset.Fields("详细地址") <> "" Then Texdz.Text = Data1.Recordset.Fields("详细地址")
If Data1.Recordset.Fields("房间号") <> "" Then DBCombo3.Text = Data1.Recordset.Fields("房间号")
If Data1.Recordset.Fields("客房类型") <> "" Then DBCombo1.Text = Data1.Recordset.Fields("客房类型")
If Data1.Recordset.Fields("客房价格") <> "" Then DBCombo2.Text = Data1.Recordset.Fields("客房价格")
If Data1.Recordset.Fields("住宿日期") <> "" Then DTP1.Value = Data1.Recordset.Fields("住宿日期")
If Data1.Recordset.Fields("住宿时间") <> "" Then tim1.Value = Data1.Recordset.Fields("住宿时间")
If Data1.Recordset.Fields("住宿天数") <> "" Then Texts.Text = Data1.Recordset.Fields("住宿天数")
If Data1.Recordset.Fields("预收金额") <> "" Then Texyj.Text = Data1.Recordset.Fields("预收金额") Else 751com.cn
'计算住宿天数
If DTP2.Value > DTP1.Value Then
If tim2.Value > #11:59:00 AM# Then
If tim2.Value > #6:00:00 PM# Then
Texts.Text = DTP2.Value - CDate(DTP1.Value) + 1
Else
Texts.Text = DTP2.Value - CDate(DTP1.Value) + 0.5
End If
Else
Texts.Text = DTP2.Value - CDate(DTP1.Value)
End If
Else
If tim1.Value < #6:00:00 PM# Then
If tim2.Value > #6:00:00 PM# Then Texts.Text = 1 Else Texts.Text = "0.5"
Else
Texts.Text = "0.5"
End If
End If
Texxf.Text = Val(Texts.Text) * Val(DBCombo2.Text) '计算宿费
Texzhje.Text = Val(Texxf.Text) * Val(Texzk.Text) / 100 '计算折后金额
Texthje.Text = Val(Texyj.Text) - Val(Texzhje.Text) - Val(Texzf.Text) - Val(Texdhf.Text) '计算退还金额
End If
End Sub
Private Sub DBCombo4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Texzk.SetFocus '按回车键Texzk获得焦点
End Sub
Private Sub TIM2_Change()
Call JS '调用函数
End Sub
Private Sub DTP2_Change()
Call JS '调用函数
End Sub
Private Sub texxm_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Texsfz.SetFocus '按回车键Texsfz获得焦点
End Sub
Private Sub texzhje_Change()
Call ssje '调用函数
End Sub
Private Sub texzf_Change()
Call ssje '调用函数
End Sub
Private Sub texdhf_Change()
Call ssje '调用函数
End Sub
Private Sub texssje_Change()
Texxf.Text = Val(Texts.Text) * Val(DBCombo2.Text) '计算宿费
Call ssje '调用函数
End Sub
Private Sub texssje_KeyDown(KeyCode As Integer, Shift As Integer)
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>
宾馆客房管理系统ER图.数据流图.功能模块图.流程图 第9页下载如图片无法显示或论文不完整,请联系qq752018766