📄 bthdinfo.frm
字号:
Caption = "餐会时间:"
Height = 180
Left = 120
TabIndex = 19
Top = 660
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "ID:"
Height = 180
Left = 120
TabIndex = 18
Top = 300
Width = 360
End
End
End
Attribute VB_Name = "BthdInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'''''''''''''''''''''''''
'''''''生日餐会框''''''''
'''''''''''''''''''''''''
'''''''''''''''''''''''''
Private fBthdInfoFlag As Integer '记录号,-2为完成,-1为新增,>=0为详细
Public Function SetBthdInfoFlag(flag As Integer)
fBthdInfoFlag = flag
End Function
Private Sub Command1_Click()
SaveBthdInfoW
SaveBthdInfoNum
If fBthdInfoFlag = JP_SET_NUM_FIN Then
ViewForm.SetCheck1 (True)
ViewForm.CBookTime
ViewForm.EBookTime (False)
ViewForm.DelBookData
End If
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
DelBthdInfoW
SaveBthdInfoNum
Unload Me
End Sub
Private Sub Form_Load()
'初始化数据
InitBthdInfoWData
'框架
ModifyBthdInfoW
'清空数据
'ClearBthdInfoW
'得到数据
GetBthdInfoW
End Sub
'''''''''''''''''''''''''''''''
''初始化数据
Private Sub InitBthdInfoWData()
Data1.DatabaseName = App.Path & "\BSystem.mdb"
If tyUserStru.sUserLev >= JP_SET_USER_LEVEL2 Then
Command3.Enabled = True
Else
Command3.Enabled = False
End If
End Sub
'''''''''''''''''''''''''''''''
''关闭数据
Private Sub CloseBthdInfoWData()
Data1.Database.Close
End Sub
'''''''''''''''''''''''''''''''
''框架
Private Function ModifyBthdInfoW()
Me.Top = ViewForm.Frame2.Top + ViewForm.Top
Me.Left = ViewForm.Frame2.Left + ViewForm.Left
Me.Height = 5775
Me.Width = 4575
End Function
'''''''''''''''''''''''''''''''
''得到数据
Private Function GetBthdInfoW()
Dim strSel As String
strSel = "Select * from 餐会信息 where ID = " & CStr(ViewForm.SetFlagViewForm) & " AND PARTY_ID = " & CStr(fBthdInfoFlag)
Data1.RecordSource = strSel
Data1.ReadOnly = True
Data1.Refresh
With Data1.Recordset
If .RecordCount = 0 Then '没有数据
Command3.Visible = False
Check3.Enabled = False
Text1.text = ViewForm.Text9.text
ClearBthdInfoW
If fBthdInfoFlag = JP_SET_NUM_FIN Then
' GetBookInfoT
GetBookInfoFin
End If
Else
Command3.Visible = True
Check3.Enabled = True
Text1.text = .Fields("PARTY_ID")
Text2.text = .Fields("大人数量")
Text3.text = .Fields("小孩数量")
Text4.text = .Fields("游戏")
Text5.text = .Fields("礼物")
Text6.text = .Fields("定餐内容")
Text7.text = .Fields("特殊服务")
Text8.text = .Fields("接待人员")
Text9.text = .Fields("满意度")
Text11.text = .Fields("花费")
Text10.text = .Fields("备注")
DTPicker1.Value = .Fields("餐会时间")
Check1.Value = ButtonCheckStatus(.Fields("定蛋糕"))
Check2.Value = ButtonCheckStatus(.Fields("预定"))
Check3.Value = ButtonCheckStatus(.Fields("餐会是否进行"))
End If
End With
End Function
'''''''''''''''''''''''''''''''
''清空数据
Private Function ClearBthdInfoW()
Text1.Enabled = False
Text2.text = ""
Text3.text = ""
Text4.text = ""
Text5.text = ""
Text6.text = ""
Text7.text = ""
Text8.text = ""
Text9.text = ""
Text10.text = ""
Text11.text = ""
DTPicker1.Value = Date
Check1.Value = Unchecked
Check2.Value = Unchecked
Check3.Value = Unchecked
End Function
'''''''''''''''''''''''''''''''
''保存数据
Private Function SaveBthdInfoW()
Dim strSel As String
Dim num As Integer
If ViewForm.SetFlagViewForm = JP_SET_NUM_ADD Then
ViewForm.SaveBaseInfo
End If
num = ViewForm.SetFlagViewForm
strSel = "Select * from 餐会信息 where ID = " & CStr(num) & " AND PARTY_ID = " & CStr(fBthdInfoFlag)
Data1.RecordSource = strSel
Data1.ReadOnly = False
Data1.Refresh
With Data1.Recordset
If .RecordCount = 0 Then '没有数据
ViewForm.Text9.text = ViewForm.Text9.text + 1
.AddNew
.Fields("ID") = num
Else
.Edit
End If
.Fields("PARTY_ID") = Text1.text
.Fields("大人数量") = SetNullToZero(Text2.text)
.Fields("小孩数量") = SetNullToZero(Text3.text)
.Fields("游戏") = Text4.text
.Fields("礼物") = Text5.text
.Fields("定餐内容") = Text6.text
.Fields("特殊服务") = Text7.text
.Fields("接待人员") = Text8.text
.Fields("满意度") = SetNullToZero(Text9.text)
.Fields("花费") = SetNullToZeroSng(Text11.text)
.Fields("备注") = Text10.text
.Fields("餐会时间") = DTPicker1.Value
.Fields("定蛋糕") = Check1.Value
.Fields("预定") = Check2.Value
.Fields("餐会是否进行") = Check3.Value
.Update
End With
End Function
'''''''''''''''''''''''''''''''
''删除数据
Private Function DelBthdInfoW()
Dim num As Integer
num = ViewForm.SetFlagViewForm
strSel = "Select * from 餐会信息 where ID = " & CStr(num) & " AND PARTY_ID = " & CStr(fBthdInfoFlag)
Data1.RecordSource = strSel
Data1.ReadOnly = False
Data1.Refresh
With Data1.Recordset
If .RecordCount = 0 Then '没有数据
Exit Function
Else
' .Delete
.Edit
.Fields("餐会是否进行") = True
' ViewForm.Text9.text = CStr(CInt(ViewForm.Text9.text) - 1) '记录删除,总记录不减
.Update
End If
End With
End Function
''''''''''''''''''''''''''''''''
'''保存次数
Private Function SaveBthdInfoNum()
Dim strSel As String
Dim num As Integer
num = ViewForm.SetFlagViewForm
strSel = "Select 参加次数 from 基本资料 where ID = " & CStr(num)
Data1.RecordSource = strSel
Data1.ReadOnly = False
Data1.Refresh
With Data1.Recordset
If .RecordCount = 0 Then '没有数据
Exit Function
Else
.Edit
End If
.Fields("参加次数") = CInt(ViewForm.Text9.text)
.Update
End With
End Function
'''''''''''''''''
''得到预定信息
Public Function GetBookInfoT()
Dim strSel As String
strSel = "Select * from 预定信息 where ID = " & CStr(ViewForm.SetFlagViewForm)
Data1.RecordSource = strSel
Data1.ReadOnly = True
Data1.Refresh
With Data1.Recordset
If .RecordCount = 0 Then
End If
DTPicker1.Value = .Fields("预定日期")
Text2.text = .Fields("大人人数")
Text3.text = .Fields("小孩人数")
Text6.text = .Fields("定餐内容")
Text7.text = .Fields("特殊要求")
Text10.text = .Fields("备注")
Check1.Value = SetCheckValue(.Fields("定蛋糕"))
Check2.Value = Checked
End With
End Function
Public Function GetBookInfoFin()
DTPicker1.Value = ViewForm.DTPicker2.Value '预定日期
Text2.text = ViewForm.Text12.text '大人人数
Text3.text = ViewForm.Text11.text '小孩人数
Text6.text = ViewForm.Text15.text '定餐内容
Text7.text = ViewForm.Text13.text '特殊要求
Text10.text = ViewForm.Text14.text '备注
Check1.Value = ViewForm.Check2.Value '定蛋糕
Check2.Value = ViewForm.Check1.Value '定餐会
End Function
Private Sub Form_Unload(Cancel As Integer)
CloseBthdInfoWData
ViewForm.ModifyBthdInfo
ViewForm.GetBthdData
End Sub
Private Sub Text11_KeyPress(KeyAscii As Integer)
KeyAscii = EnterNumValue(KeyAscii, Text11.text, 8, 2)
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
KeyAscii = TextNumEnterKey(KeyAscii, Text2.text, 2)
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
KeyAscii = TextNumEnterKey(KeyAscii, Text3.text, 2)
End Sub
Private Sub Text4_Change()
Text4.text = FixTextLen(Text4.text, "游戏", 10)
End Sub
Private Sub Text5_Change()
Text5.text = FixTextLen(Text5.text, "礼物", 10)
End Sub
Private Sub Text6_Change()
Text6.text = FixTextLen(Text6.text, "定餐内容", 150)
End Sub
Private Sub Text7_Change()
Text7.text = FixTextLen(Text7.text, "特殊服务", 30)
End Sub
Private Sub Text8_Change()
Text8.text = FixTextLen(Text8.text, "接持人员", 10)
End Sub
Private Sub Text9_KeyPress(KeyAscii As Integer)
KeyAscii = TextNumEnterKey(KeyAscii, Text9.text, 3)
If Text9.text <> "" And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii <> 0 Then
If CInt(Text9.text + CStr(Chr(KeyAscii))) > 100 Then
KeyAscii = 0
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -