📄 frmzjxf.frm
字号:
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
Begin MSDataGridLib.DataGrid DataGrid3
Height = 2535
Left = 240
TabIndex = 2
Top = 3120
Width = 5415
_ExtentX = 9551
_ExtentY = 4471
_Version = 393216
AllowUpdate = -1 'True
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
Caption = "客户所选的总食品"
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 MSAdodcLib.Adodc Adodc3
Height = 375
Left = 720
Top = 6840
Visible = 0 'False
Width = 1815
_ExtentX = 3201
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DBHotel;Data Source=."
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DBHotel;Data Source=."
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "tbEat"
Caption = "Adodc3"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin ACTIVESKINLibCtl.Skin sknZJXF
Left = 4320
OleObjectBlob = "frmZJXF.frx":0132
Top = 6600
End
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 5160
Top = 6240
Visible = 0 'False
Width = 1935
_ExtentX = 3413
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DBHotel;Data Source=."
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DBHotel;Data Source=."
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "tbEat"
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
End
Attribute VB_Name = "frmZJXF"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click() '输入预定了餐饮的房间
If Text1.Text = "" Then
MsgBox "请认真填完所有的表格!"
Exit Sub
Else
Dim rst As New ADODB.Recordset
txtsql = "select * from tbSK_Book where cRoomNo='" & Trim(Text1.Text) & "'"
Set rst = ExecuteSQL(txtsql)
'If rst!cClientName = Null Then
' MsgBox "该房间没有客户!"
'Else
Text2.Text = rst!cClientName
'End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
frmZJXF.Show
End Sub
Private Sub Command6_Click()
Unload Me
End Sub
Private Sub DataGrid1_Click()
'点击需要的商品
Adodc2.Recordset.AddNew
Adodc2.Recordset.Fields(0) = Text1.Text
Adodc2.Recordset.Fields(1) = Text2.Text
Adodc2.Recordset.Fields(2) = Adodc1.Recordset.Fields(1)
Adodc2.Recordset.Fields(3) = Adodc1.Recordset.Fields(2)
Adodc2.Recordset.Fields(4) = Adodc1.Recordset.Fields(3)
Adodc2.Recordset.Fields(5) = 1
Adodc2.Recordset.Update
Adodc1.Recordset("iNumber") = Adodc1.Recordset.Fields(4) - 1
Adodc1.Recordset.Update
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = "select 房间号=cRoomNo,客户名=cClientName, 食品名=cFoodName,食品类型=cFoodType,食品价格= mFoodPrice,食品数量=iNumber from tbEat where cRoomNo='" & Trim(Text1.Text) & "'"
Set DataGrid2.DataSource = Adodc2
Adodc2.Refresh
If Adodc1.Recordset.Fields(4) = 0 Then
MsgBox "食品已经用完,请重新选择!"
Adodc1.Recordset.Delete
Adodc1.Recordset.UpdateBatch
Adodc1.Recordset.MoveNext
Exit Sub
End If
Adodc3.CommandType = adCmdText
Adodc3.RecordSource = "select 房间号 =avg(convert(int,cRoomNo)),用户名=cClientName,食品名=cFoodName,食品类型=cFoodType,食品价格=avg( mFoodPrice),食品总数量=sum(iNumber) from tbEat where cRoomNo='" & Trim(Text1.Text) & "' group by cFoodName ,cClientName,cFoodType"
Set DataGrid3.DataSource = Adodc3
Adodc3.Refresh
Adodc2.Refresh
'显示所订商品的价钱
Dim rst As New ADODB.Recordset
txtsql = "select sum(mFoodPrice) from tbEat where cRoomNo='" & Trim(Text1.Text) & "'"
Set rst = ExecuteSQL(txtsql)
txtprice.Text = rst.GetString
End Sub
Private Sub Form_Load()
Call changeskin(Me, sknZJXF, strSkin)
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1 '显示所有的商品信息
Set DataGrid2.DataSource = Adodc2 '显示所订的商品
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -