📄 frmamuseman.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FrmAmuseMan
BorderStyle = 1 'Fixed Single
Caption = "旅游娱乐厅信息管理"
ClientHeight = 6705
ClientLeft = 45
ClientTop = 330
ClientWidth = 7695
Icon = "FrmAmuseMan.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6705
ScaleWidth = 7695
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Cmd_Item
Caption = "娱乐项目"
Height = 400
Left = 4637
MouseIcon = "FrmAmuseMan.frx":0442
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 8
Top = 6000
Width = 1300
End
Begin VB.CommandButton Cmd_Add
Caption = "添 加"
Default = -1 'True
Height = 400
Left = 317
MouseIcon = "FrmAmuseMan.frx":074C
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 6
Top = 6000
Width = 1300
End
Begin VB.CommandButton Cmd_Del
Caption = "删 除"
Height = 400
Left = 3197
MouseIcon = "FrmAmuseMan.frx":0A56
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 5
Top = 6000
Width = 1300
End
Begin VB.CommandButton Cmd_Close
Caption = "关 闭"
Height = 400
Left = 6077
MouseIcon = "FrmAmuseMan.frx":0D60
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 4
Top = 6000
Width = 1300
End
Begin VB.CommandButton Cmd_Modi
Caption = "修 改"
Height = 400
Left = 1757
MouseIcon = "FrmAmuseMan.frx":106A
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 3
Top = 6000
Width = 1300
End
Begin VB.ComboBox ComboType
Height = 300
ItemData = "FrmAmuseMan.frx":1374
Left = 1440
List = "FrmAmuseMan.frx":1381
Style = 2 'Dropdown List
TabIndex = 1
Top = 240
Width = 1455
End
Begin VB.ComboBox ComboName
Height = 300
Left = 3120
Style = 2 'Dropdown List
TabIndex = 0
Top = 240
Width = 1575
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "FrmAmuseMan.frx":1397
Height = 5055
Left = 0
TabIndex = 2
Top = 720
Width = 7695
_ExtentX = 13573
_ExtentY = 8916
_Version = 393216
AllowUpdate = 0 'False
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
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 120
Top = 5760
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=Travel"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "Travel"
OtherAttributes = ""
UserName = "sa"
Password = "sa"
RecordSource = "SELECT * FROM Place"
Caption = "Adodc1"
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 VB.Label Label1
AutoSize = -1 'True
Caption = "所在地域"
Height = 180
Left = 240
TabIndex = 7
Top = 300
Width = 720
End
End
Attribute VB_Name = "FrmAmuseMan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Refresh_Amuse()
Adodc1.RecordSource = "SELECT a.AreaName 所在地域, p.Aname As 娱乐厅名称," _
+ " p.Contact As 联系人, p.Phone As 联系电话, p.Address As 通信地址," _
+ " p.Postcode As 邮政编码, p.Input_time As 录入时间" _
+ " FROM Amusement p, Area a WHERE p.AreaId=a.AreaId" _
+ " And a.AreaName='" + Trim(ComboName.Text) + "'"
Adodc1.Refresh
End Sub
Private Sub Cmd_Add_Click()
FrmAmuseEdit.Modify = False
FrmAmuseEdit.OriAreaName = ComboName.Text
FrmAmuseEdit.OriType = ComboType.ListIndex + 1
FrmAmuseEdit.OriId = 0
FrmAmuseEdit.Show 1
Refresh_Amuse
End Sub
Private Sub Cmd_Del_Click()
Dim TmpId As Long
If Adodc1.Recordset.EOF = True Then
MsgBox "请选择记录"
Exit Sub
End If
p = Adodc1.Recordset.AbsolutePosition
TmpId = MyAmuse.GetId(Trim(Adodc1.Recordset.Fields(1)))
'判断娱乐厅是否包含娱乐项目
If MyAitem.HaveItem(TmpId) <> "" Then
MsgBox "此娱乐厅包含娱乐项目,不能删除"
Exit Sub
End If
'确认删除
If MsgBox("是否删除当前行?", vbYesNo, "确认") = vbYes Then
MyAmuse.Delete (TmpId)
Refresh_Amuse
If p - 1 > 0 Then
Adodc1.Recordset.Move p - 1
End If
End If
End Sub
Private Sub Cmd_Item_Click()
'要进入娱乐项目管理界面,必须首先选择一个娱乐厅
If Adodc1.Recordset.EOF = True Then
MsgBox "请选择记录"
Exit Sub
End If
'读取选择好的娱乐厅娱乐,并赋值到FrmAitemMan.OriAid中
FrmAitemMan.OriAid = MyAmuse.GetId(Trim(Adodc1.Recordset.Fields(1)))
'打开娱乐项目管理窗体
FrmAitemMan.Show 1
End Sub
Private Sub Cmd_Modi_Click()
If Adodc1.Recordset.EOF = True Then
MsgBox "请选择记录"
Exit Sub
End If
p = Adodc1.Recordset.AbsolutePosition
'娱乐厅编号
FrmAmuseEdit.OriId = MyAmuse.GetId(Adodc1.Recordset.Fields(1))
'地域信息
FrmAmuseEdit.OriAreaName = ComboName.Text
FrmAmuseEdit.OriType = ComboType.ListIndex + 1
'娱乐厅名称
FrmAmuseEdit.OriAmuseName = Trim(Adodc1.Recordset.Fields(1))
FrmAmuseEdit.txtAmuse = Trim(Adodc1.Recordset.Fields(1))
'联系人
FrmAmuseEdit.txtContact = Trim(Adodc1.Recordset.Fields(2))
'联系电话
FrmAmuseEdit.txtPhone = Trim(Adodc1.Recordset.Fields(3))
'通信地址
FrmAmuseEdit.txtAddress = Trim(Adodc1.Recordset.Fields(4))
'邮政编码
FrmAmuseEdit.txtCode = Trim(Adodc1.Recordset.Fields(5))
FrmAmuseEdit.Modify = True
FrmAmuseEdit.Show 1
Refresh_Amuse
Adodc1.Recordset.Move p
End Sub
Private Sub Cmd_Close_Click()
Unload Me
End Sub
Private Sub ComboName_Click()
Refresh_Amuse
End Sub
Private Sub ComboType_Click()
Call Loadarea(ComboType.ListIndex + 1, ComboName)
If ComboName.ListCount > 0 Then
ComboName.ListIndex = 0
End If
Refresh_Amuse
End Sub
Private Sub Command1_Click()
End Sub
Private Sub Form_Load()
ComboType.ListIndex = 0
Call Loadarea(1, ComboName)
If ComboName.ListCount > 0 Then
ComboName.ListIndex = 0
End If
Refresh_Amuse
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -