📄 frmxtgl.frm
字号:
.Delete
.UpdateBatch
If .RecordCount <> 0 Then
.MoveFirst
End If
End With
End If
Exit Sub
check:
MsgBox "记录集为空!"
End Sub
Private Sub Command2_Click()
List1.AddItem List2.Text
List2.RemoveItem List2.ListIndex
If List2.ListCount = 0 Then
Command2.Enabled = False
Command1.Enabled = True
Else
Command2.Enabled = True
Command1.Enabled = True
End If
End Sub
Private Sub Combo2_Click()
List2.AddItem Combo2.Text
List1.ListIndex = Combo2.ListIndex
List1.RemoveItem List1.ListIndex
End Sub
Private Sub Command10_Click()
If Tex1.Text = "" Or Tex2.Text = "" Or Comb1.Text = "" Or Tex3.Text = "" Or Comb2.Text = "" Or Tex4.Text = "" Then
MsgBox "请认真填完所有的表格!"
Exit Sub
Else
Dim rst As New ADODB.Recordset
txtsql = "select * from tbEmployee where cE_Id='" & Text1.Text & "'"
Set rst = ExecuteSQL(txtsql)
If Not rst.EOF Then
MsgBox "该员工代号已经存在!"
rst.Close
Exit Sub
Else
Adodc4.Recordset.AddNew
Adodc4.Recordset!cE_Id = Tex1.Text
Adodc4.Recordset!cE_Name = Tex2.Text
Adodc4.Recordset!cE_Sex = Comb1.Text
Adodc4.Recordset!vE_Address = Tex3.Text
Adodc4.Recordset!cE_Position = Comb2.Text
Adodc4.Recordset!mE_Pay = Tex4.Text
Adodc4.Recordset.Update
End If
End If
Adodc4.Refresh
Tex1.Text = ""
Tex2.Text = ""
Comb1.Text = ""
Tex3.Text = ""
Comb2.Text = ""
Tex4.Text = ""
End Sub
Private Sub Command14_Click()
frmreset.Show
End Sub
Private Sub Command15_Click()
Dim i As Integer
Dim rs As New ADODB.Recordset
If Combo1.Text = "第一层" Then
i = 1
While i <= 8
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & i & "'"
Set rs = ExecuteSQL(txtsql)
If rs.EOF Then
Combo2.AddItem i
End If
i = i + 1
Wend
ElseIf Combo1.Text = "第二层" Then
i = 9
While i <= 16
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & i & "'"
Set rs = ExecuteSQL(txtsql)
If rs.EOF Then
Combo2.AddItem i
End If
i = i + 1
Wend
ElseIf Combo1.Text = "第三层" Then
i = 17
While i <= 24
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & i & "'"
Set rs = ExecuteSQL(txtsql)
If rs.EOF Then
Combo2.AddItem i
End If
i = i + 1
Wend
ElseIf Combo1.Text = "第四层" Then
i = 25
While i <= 32
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & i & "'"
Set rs = ExecuteSQL(txtsql)
If rs.EOF Then
Combo2.AddItem i
End If
i = i + 1
Wend
End If
rs.Close
List1.Clear
List2.Clear
Dim h As Integer
Dim rst As New ADODB.Recordset
If Combo1.Text = "第一层" Then
h = 1
While h <= 8
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & h & "'"
Set rst = ExecuteSQL(txtsql)
If rst.EOF Then
List1.AddItem h
End If
h = h + 1
Wend
ElseIf Combo1.Text = "第二层" Then
h = 9
While h <= 16
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & h & "'"
Set rst = ExecuteSQL(txtsql)
If rst.EOF Then
List1.AddItem h
End If
h = h + 1
Wend
ElseIf Combo1.Text = "第三层" Then
h = 17
While h <= 24
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & h & "'"
Set rst = ExecuteSQL(txtsql)
If rst.EOF Then
List1.AddItem h
End If
h = h + 1
Wend
ElseIf Combo1.Text = "第四层" Then
h = 25
While h <= 32
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & h & "'"
Set rst = ExecuteSQL(txtsql)
If rst.EOF Then
List1.AddItem h
End If
h = h + 1
Wend
End If
rst.Close
Comok.Enabled = True
End Sub
Private Sub Command16_Click()
On Error GoTo check:
Me.Adodc1.Recordset.MovePrevious
If Me.Adodc1.Recordset.BOF Then
Me.Adodc1.Recordset.MoveNext
End If
Exit Sub
check:
MsgBox "记录集为空!"
End Sub
Private Sub Command17_Click()
On Error GoTo check:
Me.Adodc1.Recordset.MoveNext
If Me.Adodc1.Recordset.EOF Then
Me.Adodc1.Recordset.MovePrevious
End If
Exit Sub
check:
MsgBox "记录集为空!"
End Sub
Private Sub Command18_Click()
On Error GoTo check:
Dim intAnswer As Integer
If Not Me.Adodc1.Recordset.EOF Then
Dim ADOBook, ADOBook1, adoBook2, adoBook3 As Variant
If Not Adodc1.Recordset.EOF Then
adoBook2 = Me.Adodc1.Recordset.Bookmark
Me.Adodc1.Recordset.MoveFirst
Me.Adodc1.Recordset.Bookmark = adoBook2
intAnswer = MsgBox("确认删除当前记录吗?", vbYesNo + vbQuestion, "华光宾馆管理系统")
If intAnswer = vbYes Then
With Me.Adodc1.Recordset
.Delete
.UpdateBatch
If .RecordCount <> 0 Then
.MoveFirst
End If
End With
End If
End If
End If
Exit Sub
check:
MsgBox "记录集为空!"
End Sub
Private Sub Command19_Click()
On Error GoTo check:
Me.Adodc2.Recordset.MovePrevious
If Me.Adodc2.Recordset.BOF Then
Me.Adodc2.Recordset.MoveNext
End If
Exit Sub
check:
MsgBox "记录集为空!"
End Sub
Private Sub Command20_Click()
On Error GoTo check:
Me.Adodc2.Recordset.MoveNext
If Me.Adodc2.Recordset.EOF Then
Me.Adodc2.Recordset.MovePrevious
End If
Exit Sub
check:
MsgBox "记录集为空!"
End Sub
Private Sub Command21_Click()
On Error GoTo check:
Dim intAnswer As Integer
Dim ADOBook, ADOBook1, adoBook2, adoBook3 As Variant
If Not Adodc2.Recordset.EOF Then
adoBook2 = Me.Adodc2.Recordset.Bookmark
Me.Adodc2.Recordset.MoveFirst
Me.Adodc2.Recordset.Bookmark = adoBook2
intAnswer = MsgBox("确认删除当前记录吗?", vbYesNo + vbQuestion, "华光宾馆管理系统")
If intAnswer = vbYes Then
With Me.Adodc2.Recordset
.Delete
.UpdateBatch
If .RecordCount <> 0 Then
.MoveFirst
End If
End With
End If
End If
Exit Sub
Adodc2.Refresh
check:
MsgBox "记录集为空!"
End Sub
Private Sub Command3_Click()
If Combo4.Text = "" Or Text1.Text = "" Then
MsgBox "请认真填完所有的表格!"
Exit Sub
Else
Dim rst As New ADODB.Recordset
txtsql = "select * from tbRoomPrice where cRoomStory='" & Combo4.Text & "'"
Set rst = ExecuteSQL(txtsql)
If Not rst.EOF Then
MsgBox "该层的房价已经设置!"
Exit Sub
Else
Adodc2.Recordset.AddNew
Adodc2.Recordset!cRoomStory = Combo4.Text
Adodc2.Recordset!mRoomPrice = Text1.Text
Adodc2.Recordset.Update
i = i + 1
End If
End If
Adodc2.Refresh
Combo4.Text = "第一层"
Text1.Text = ""
End Sub
Private Sub Command5_Click()
Unload Me
Unload mdiHotelmain
Load mdiHotelmain
mdiHotelmain.Show
End Sub
Private Sub Command6_Click()
If Text2.Text = "" Or Text3.Text = "" Or Combo5.Text = "" Or Text4.Text = "" Or Text5.Text = "" Then
MsgBox "请认真填完所有的表格!"
Exit Sub
Else
Dim rst As New ADODB.Recordset
txtsql = "select * from tbShopping where cShoppingId='" & Text2.Text & "'"
Set rst = ExecuteSQL(txtsql)
If Not rst.EOF Then
MsgBox "该商品代号已经存在!"
Exit Sub
Else
Adodc3.Recordset.AddNew
Adodc3.Recordset!cShoppingId = Text2.Text
Adodc3.Recordset!cFoodName = Text3.Text
Adodc3.Recordset!cFoodType = Combo5.Text
Adodc3.Recordset!mFoodPrice = Text4.Text
Adodc3.Recordset!iNumber = Text5.Text
Adodc3.Recordset.Update
End If
End If
Adodc3.Refresh
Text2.Text = ""
Text3.Text = ""
Combo5.Text = ""
Text4.Text = ""
Text5.Text = ""
End Sub
Private Sub Command7_Click()
Dim intAnswer As Integer
Dim ADOBook, ADOBook1, adoBook2, adoBook3 As Variant
If Not Adodc3.Recordset.EOF Then
adoBook2 = Me.Adodc3.Recordset.Bookmark
Me.Adodc3.Recordset.MoveFirst
Me.Adodc3.Recordset.Bookmark = adoBook2
intAnswer = MsgBox("确认删除当前记录吗?", vbYesNo + vbQuestion, "华光宾馆管理系统")
If intAnswer = vbYes Then
With Me.Adodc3.Recordset
.Delete
.UpdateBatch
If .RecordCount <> 0 Then
.MoveFirst
End If
End With
End If
End If
Exit Sub
End Sub
Private Sub Command8_Click()
On Error GoTo check:
Me.Adodc3.Recordset.MovePrevious
If Me.Adodc3.Recordset.BOF Then
Me.Adodc3.Recordset.MoveNext
End If
Exit Sub
check:
MsgBox "记录集为空!"
End Sub
Private Sub Command9_Click()
On Error GoTo check:
Me.Adodc3.Recordset.MoveNext
If Me.Adodc3.Recordset.EOF Then
Me.Adodc3.Recordset.MovePrevious
End If
Exit Sub
check:
MsgBox "记录集为空!"
End Sub
Private Sub Comok_Click()
If Combo1.Text = "" Or Combo2.Text = "" Or Combo3.Text = "" Then
MsgBox "请认真填完所有的表格!"
Exit Sub
Else
Dim i As Integer
i = 1
While i <= List2.ListCount
Adodc1.Recordset.AddNew
Adodc1.Recordset!cRoomStory = Combo1.Text
Adodc1.Recordset!croomno = List2.list(i - 1)
Adodc1.Recordset!cRoomType = Combo3.Text
Adodc1.Recordset.Update
i = i + 1
Wend
End If
Adodc1.Refresh
Combo1.Text = "第一层"
Combo2.Text = ""
Combo3.Text = "停用"
Comok.Enabled = False
Command15.Enabled = True
End Sub
Private Sub Form_Load()
Call changeskin(Me, sknXTGL, strSkin)
Comb1.AddItem "男"
Comb1.AddItem "女"
Comb2.AddItem "服务员"
Comb2.AddItem "收银员"
Comb2.AddItem "经理"
Combo1.AddItem "第一层"
Combo1.AddItem "第二层"
Combo1.AddItem "第三层"
Combo1.AddItem "第四层"
Combo3.AddItem "停用"
Combo1.Text = "第一层"
Combo3.Text = "停用"
Combo4.AddItem "第一层"
Combo4.AddItem "第二层"
Combo4.AddItem "第三层"
Combo4.AddItem "第四层"
Combo5.AddItem "饮料"
Combo5.AddItem "主食"
Combo5.AddItem "副食"
Set DataGrid5.DataSource = Adodc1
Set DataGrid2.DataSource = Adodc2
Set DataGrid3.DataSource = Adodc3
Set DataGrid4.DataSource = Adodc4
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -