frmRoomsurplus.frm
资源名称:宾馆管理信息系统1.rar [点击查看]
上传用户:fulizhu2
上传日期:2007-06-21
资源大小:34k
文件大小:6k
源码类别:
酒店行业
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form frmRoomsurplus
- Caption = "剩余客房查询"
- ClientHeight = 3120
- ClientLeft = 48
- ClientTop = 348
- ClientWidth = 4080
- LinkTopic = "Form1"
- ScaleHeight = 3120
- ScaleWidth = 4080
- StartUpPosition = 2 'CenterScreen
- Begin VB.ComboBox Combo1
- Height = 288
- Index = 2
- Left = 1440
- Style = 2 'Dropdown List
- TabIndex = 10
- Top = 1680
- Width = 1692
- End
- Begin VB.Frame Frame1
- Caption = "客房单价"
- Height = 1572
- Left = 600
- TabIndex = 6
- Top = 720
- Width = 2652
- Begin VB.ComboBox Combo1
- Height = 288
- Index = 1
- Left = 840
- Style = 2 'Dropdown List
- TabIndex = 9
- Top = 360
- Width = 1692
- End
- Begin VB.Label lblitem
- Caption = "大于"
- Height = 252
- Index = 2
- Left = 240
- TabIndex = 8
- Top = 960
- Width = 372
- End
- Begin VB.Label lblitem
- Caption = "小于"
- Height = 252
- Index = 0
- Left = 240
- TabIndex = 7
- Top = 360
- Width = 372
- End
- End
- Begin VB.CommandButton cmdExit
- Caption = "取消 (&X)"
- Height = 375
- Left = 2280
- TabIndex = 4
- Top = 2520
- Width = 1215
- End
- Begin VB.CommandButton cmdOk
- Caption = "确定 (&O)"
- Default = -1 'True
- Height = 375
- Left = 720
- TabIndex = 3
- Top = 2520
- Width = 1215
- End
- Begin VB.CheckBox chkItem
- Caption = "Check1"
- Height = 180
- Index = 0
- Left = 240
- TabIndex = 2
- TabStop = 0 'False
- Top = 240
- Value = 1 'Checked
- Width = 132
- End
- Begin VB.ComboBox Combo1
- Height = 288
- Index = 0
- Left = 1440
- Style = 2 'Dropdown List
- TabIndex = 1
- Top = 240
- Width = 1692
- End
- Begin VB.CheckBox chkItem
- Caption = "Check1"
- Height = 180
- Index = 1
- Left = 240
- TabIndex = 0
- TabStop = 0 'False
- Top = 840
- Width = 132
- End
- Begin VB.Label lblitem
- Caption = "客房种类:"
- Height = 252
- Index = 1
- Left = 600
- TabIndex = 5
- Top = 240
- Width = 1092
- End
- End
- Attribute VB_Name = "frmRoomsurplus"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub chkItem_Click(Index As Integer)
- If Index = 0 Then
- If chkItem(Index).Value = vbChecked Then
- Combo1(Index).Enabled = True
- End If
- Else
- If chkItem(Index).Value = vbChecked Then
- Combo1(1).Enabled = True
- Combo1(2).Enabled = True
- End If
- End If
- End Sub
- Private Sub cmdExit_Click()
- Me.Hide
- End Sub
- Private Sub cmdOk_Click()
- Dim sQSql As String
- If chkItem(0).Value = vbChecked Then
- sQSql = " roomtype = '" & Trim(Combo1(0) & " ") & "'"
- End If
- If chkItem(1).Value = vbChecked Then
- If Trim(sQSql & " ") = "" Then
- If Trim(Combo1(1) & " ") <> "" And Trim(Combo1(2) & " ") <> "" Then
- sQSql = " roomprice <='" & Trim(Combo1(1) & " ") & "'and roomprice >= '" & Trim(Combo1(2) & " ") & "'"
- ElseIf Trim(Combo1(1) & " ") = "" And Trim(Combo1(2) & " ") <> "" Then
- sQSql = " roomprice >='" & Trim(Combo1(2) & " ") & "'"
- ElseIf Trim(Combo1(1) & " ") <> "" And Trim(Combo1(2) & " ") = "" Then
- sQSql = " roomprice <='" & Trim(Combo1(1) & " ") & "'"
- End If
- Else
- If Trim(Combo1(1) & " ") <> "" And Trim(Combo1(2) & " ") <> "" Then
- sQSql = sQSql & " and roomprice >='" & Trim(Combo1(1) & " ") & "'and roomprice >= '" & Trim(Combo1(2) & " ") & "'"
- ElseIf Trim(Combo1(1) & " ") = "" And Trim(Combo1(2) & " ") <> "" Then
- sQSql = sQSql & " and roomprice >='" & Trim(Combo1(2) & " ") & "'"
- ElseIf Trim(Combo1(1) & " ") <> "" And Trim(Combo1(2) & " ") = "" Then
- sQSql = sQSql & " and roomprice <='" & Trim(Combo1(1) & " ") & "'"
- End If
- End If
- End If
- If Trim(sQSql) = "" Then
- MsgBox "请设置查询条件!", vbOKOnly + vbExclamation, "警告"
- Exit Sub
- Else
- If flagRedit Then
- Unload frmRoom
- End If
- frmRoom.txtSQL = "select * from rooms where" & sQSql & "and putup <> 'y'"
- frmRoom.Show
- flagSedit = True
- End If
- Me.Hide
- End Sub
- Private Sub Form_Load()
- Dim txtSQL As String
- Dim MsgText As String
- Dim mrc As ADODB.Recordset
- txtSQL = "select distinct typename from roomtype"
- Set mrc = ExecuteSQL(txtSQL, MsgText)
- If Not mrc.EOF Then
- Do While Not mrc.EOF
- Combo1(0).AddItem mrc.Fields(0)
- mrc.MoveNext
- Loop
- End If
- mrc.Close
- txtSQL = "select distinct price from roomtype"
- Set mrc = ExecuteSQL(txtSQL, MsgText)
- If Not mrc.EOF Then
- Do While Not mrc.EOF
- Combo1(1).AddItem mrc.Fields(0)
- Combo1(2).AddItem mrc.Fields(0)
- mrc.MoveNext
- Loop
- End If
- mrc.Close
- End Sub