【VB开源代码栏目提醒】:本文主要为网学会员提供FMOpenRoomTable.frm,希望对需要FMOpenRoomTable.frm网友有所帮助,学习一下!
VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDatGrd.ocx"
Begin VB.Form FMOpenRoomTable
Caption = "开房单明细表"
ClientHeight = 4875
ClientLeft = 60
ClientTop = 345
ClientWidth = 8265
LinkTopic = "Form1"
ScaleHeight = 4875
ScaleWidth = 8265
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox TextClientName
Height = 390
Left = 5040
TabIndex = 5
Top = 120
Width = 975
End
Begin VB.ComboBox CombRoomID
Height = 300
Left = 1920
TabIndex = 4
Top = 180
Width = 975
End
Begin VB.CommandButton ComdCancel
Caption = "取消"
Height = 375
Left = 7080
TabIndex = 3
Top = 4440
Width = 735
End
Begin VB.CommandButton ComdQuery
Caption = "查询"
Height = 375
Left = 7080
TabIndex = 2
Top = 120
Width = 735
End
Begin VB.Frame Frame1
Height = 3735
Left = 120
TabIndex = 0
Top = 600
Width = 7935
Begin MSDataGridLib.DataGrid DataGrid1
Height = 3375
Left = 120
TabIndex = 1
Top = 240
Width = 7695
_ExtentX = 13573
_ExtentY = 5953
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
Begin VB.Label Label2
Caption = "客户名称:"
Height = 255
Left = 3960
TabIndex = 7
Top = 240
Width = 975
End
Begin VB.Label Label1
Caption = "房间编号:"
Height = 255
Left = 840
TabIndex = 6
Top = 240
Width = 975
End
End
Attribute VB_Name = "FMOpenRoomTable"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public Conn As New Connection
Private Sub ComdCancel_Click()
Conn.Close
Unload Me
End Sub
Private Sub ComdQuery_Click()
Dim SqlStr As String
Dim rsORTable As New Recordset
Dim sRoomID As String
Dim sClientName As String
sRoomID = Trim(Me.CombRoomID.Text)
sClientName = Trim(Me.TextClientName.Text)
SqlStr = "select RoomConsumedID as 开房单编号,MemberID as 会员编号,ClientName as 客户,RoomID as 房间编号,RoomType as 房间类型,RoomPrice as 房间价格,ClientTel as 客户电话,ClientCount as 人数,OpenDate as 开房日期," & "OpenTime as 开房时间,Agio as 折扣,Prepay as 预付金额,Remake as 备注 from RoomConsumed where RoomID like " & " '%" & sRoomID & "%'" & "and ClientName like '%" & sClientName & "%'"
Set rsORTable = Conn.Execute(SqlStr)
Set DataGrid1.DataSource = rsORTable
Set rsORTable = Nothing
End Sub
Private Sub Form_Load()
Me.Top = (Screen.Height - Me.Height) / 2 '垂直方向居中
Me.Left = (Screen.Width - Me.Height) / 2 '水平方向居中
With Conn
Conn.CursorLocation = adUseClient
Conn.CommandTimeout = 10
Conn.ConnectionString = g_ConnStr
Conn.Open
End With
Dim SqlStr As String
Dim rsOpenRoomTable As New Recordset
SqlStr = "select RoomConsumedID as 开房单编号,MemberID as 会员编号" & ",ClientName as 客户,RoomID as 房间编号" & ",RoomType as 房间类型,RoomPrice as 房间价格" & ",ClientTel as 客户电话,ClientCount as 人数" & ",OpenDate as 开房日期,OpenTime as 开房时间" & ",Agio as 折扣,Prepay as 预付金额" & ",Remake as 备注 from RoomConsumed"
Set rsOpenRoomTable = Conn.Execute(SqlStr)
Me.DataGrid1.ColumnHeaders = True
Set DataGrid1.DataSource = rsOpenRoomTable
'rsDestine.Update
Set rsOpenRoomTable = Nothing
'从数据库中读取数据写入房间编号下拉列表框
Dim adoRs As New ADODB.Recordset
Dim DBStr As String
DBStr = "select RoomID from RoomInfo where RoomState='占用'"
adoRs.Open DBStr, Conn, adOpenStatic, adLockReadOnly
If adoRs.RecordCount > 0 Then
adoRs.MoveFirst
Do While Not adoRs.EOF
CombRoomID.AddItem adoRs.Fields(0).Value
adoRs.MoveNext
Loop
End If
adoRs.Close
Set adoRs = Nothing
End Sub
上一篇:
DcDemoDoc.cpp
下一篇:
4种小菜缓解孕妈咪不适