frmRoom2.frm
资源名称:宾馆管理信息系统1.rar [点击查看]
上传用户:fulizhu2
上传日期:2007-06-21
资源大小:34k
文件大小:5k
源码类别:
酒店行业
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form frmRoom2
- BorderStyle = 3 'Fixed Dialog
- Caption = "客房信息查询"
- ClientHeight = 2112
- ClientLeft = 48
- ClientTop = 336
- ClientWidth = 4056
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2112
- ScaleWidth = 4056
- ShowInTaskbar = 0 'False
- StartUpPosition = 1 'CenterOwner
- Begin VB.CheckBox chkItem
- Caption = "Check1"
- Height = 180
- Index = 1
- Left = 240
- TabIndex = 7
- TabStop = 0 'False
- Top = 720
- Width = 132
- End
- Begin VB.ComboBox Combo1
- Height = 288
- Left = 1560
- Style = 2 'Dropdown List
- TabIndex = 5
- Top = 720
- Width = 2172
- End
- Begin VB.CheckBox chkItem
- Caption = "Check1"
- Height = 180
- Index = 0
- Left = 240
- TabIndex = 4
- TabStop = 0 'False
- Top = 240
- Value = 1 'Checked
- Width = 132
- End
- Begin VB.CommandButton cmdOk
- Caption = "确定 (&O)"
- Default = -1 'True
- Height = 375
- Left = 840
- TabIndex = 1
- Top = 1440
- Width = 1215
- End
- Begin VB.CommandButton cmdExit
- Caption = "取消 (&X)"
- Height = 375
- Left = 2280
- TabIndex = 2
- Top = 1440
- Width = 1215
- End
- Begin VB.TextBox txtItem
- Height = 270
- Index = 0
- Left = 1560
- TabIndex = 0
- Top = 240
- Width = 2172
- End
- Begin VB.Label lblitem
- Caption = "客房种类:"
- Height = 252
- Index = 1
- Left = 600
- TabIndex = 6
- Top = 720
- Width = 1092
- End
- Begin VB.Label lblitem
- Caption = "客房编号:"
- Height = 252
- Index = 0
- Left = 600
- TabIndex = 3
- Top = 240
- Width = 1092
- End
- End
- Attribute VB_Name = "frmRoom2"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- '用于传递查询块
- Private Sub chkItem_Click(Index As Integer)
- If Index = 0 Then
- txtItem(0).SetFocus
- Else
- Combo1.SetFocus
- 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 = " roomNO = '" & Trim(txtItem(0) & " ") & "'"
- End If
- If chkItem(1).Value = vbChecked Then
- If Trim(sQSql & " ") = "" Then
- sQSql = " roomtype ='" & Trim(Combo1 & " ") & "'"
- Else
- sQSql = sQSql & " and roomtype ='" & Trim(Combo1 & " ") & "'"
- 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
- frmRoom.Show
- End If
- Me.Hide
- End Sub
- Private Sub Form_Load()
- Dim i As Integer
- Dim j As Integer
- Dim sSql As String
- 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.AddItem Trim(mrc.Fields(0))
- mrc.MoveNext
- Loop
- Combo1.ListIndex = 0
- Else
- MsgBox "请先进行客房标准设置!", vbOKOnly + vbExclamation, "警告"
- Exit Sub
- End If
- mrc.Close
- End Sub
- Private Sub lblitem_Click(Index As Integer)
- chkItem(Index).Value = vbChecked
- End Sub
- Private Sub txtItem_GotFocus(Index As Integer)
- txtItem(Index).SelStart = 0
- txtItem(Index).SelLength = Len(txtItem(Index))
- End Sub