📄 frmfloor.frm
字号:
Top = 4680
Width = 975
_ExtentX = 1720
_ExtentY = 609
Enabled = 0 'False
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "保存"
ForeColor = -2147483630
ForeHover = 0
End
Begin VB.TextBox txtBoon
Height = 300
Left = 2640
TabIndex = 13
Top = 4185
Width = 2175
End
Begin MSFlexGridLib.MSFlexGrid MSF2
Height = 3855
Left = 0
TabIndex = 11
Top = 120
Width = 6375
_ExtentX = 11245
_ExtentY = 6800
_Version = 393216
SelectionMode = 1
End
Begin VB.Label lblBoon
Caption = "福利项目名称"
Height = 255
Left = 1200
TabIndex = 12
Top = 4200
Width = 1095
End
End
Begin VB.CommandButton Command1
Caption = "参数设置"
Height = 315
Left = 1020
TabIndex = 5
Top = 0
Width = 1335
End
Begin MSComctlLib.TreeView tvwManage
Height = 5055
Left = 120
TabIndex = 6
Top = 480
Width = 3000
_ExtentX = 5292
_ExtentY = 8916
_Version = 393217
HideSelection = 0 'False
Indentation = 529
LabelEdit = 1
LineStyle = 1
Sorted = -1 'True
Style = 7
FullRowSelect = -1 'True
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Label lblInfo
Alignment = 1 'Right Justify
AutoSize = -1 'True
Height = 180
Index = 3
Left = 3990
TabIndex = 7
Top = 3720
Width = 30
End
End
End
Attribute VB_Name = "frmFloor"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim adoEditLink As New ADODB.Recordset
Dim txtsql As String
Dim intManage As Integer
Private Sub cmdCancel_Click()
'福利中的取消功能
txtBoon.Text = ""
cmdSave.Enabled = False
End Sub
Private Sub CmdCancelThird_Click()
txtValue.Text = ""
cmdSave.Enabled = False
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdDel_Click()
'删除选中行的福利项目值
Dim mrc1 As New ADODB.Recordset
If MSF2.Rows > 1 Then
If MSF2.Row <> 0 Then
With MSF2
If MsgBox("确定要删除福利名称为 " & Trim(.TextMatrix(.Row, 0)) & " 的值吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then
txtsql = "delete from pb_employeeboon where id =" & Val(.TextMatrix(.Row, 1)) & ""
If mrc1.State = adStateOpen Then mrc1.Close
mrc1.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
.TextMatrix(.Row, 4) = ""
txtBoon.Text = ""
Sleep 500 '延时500毫秒
'更新员工工资福利各项统计表中该员工的个人部分或公司部分福利总和,税收总和,工资总和
If MSF2.TextMatrix(MSF2.Row, 5) = "个人部分" Then
txtsql = "update pb_employeesum set sumBoon1=" & SumBoon1(tempNumber) & "," & "sumRevenue=" & Sumrevenue(tempNumber) & "," & "sumPay=" & sumPay(tempNumber) & Space(1) & "where employeeid =" & "'" & MSF2.TextMatrix(.Row, 2) & "'"
Else
txtsql = "update pb_employeesum set sumBoon2=" & SumBoon2(tempNumber) & "," & "sumRevenue=" & Sumrevenue(tempNumber) & "," & "sumPay=" & sumPay(tempNumber) & Space(1) & "where employeeid =" & "'" & MSF2.TextMatrix(.Row, 2) & "'"
End If
If mrc1.State = adStateOpen Then mrc1.Close
mrc1.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
cmdDel.Enabled = False
End If
End With
End If
End If
End Sub
Private Sub cmdDelThird_Click()
Dim mrc1 As New ADODB.Recordset
Dim tempNumber As String
tempNumber = Trim(Mid(tvwManage.SelectedItem.Parent.Key, 3)) '从它的上级目录的key中得出员工编号
If MSF1.Rows > 0 Then
With MSF1
Select Case .Tag
Case "1" '收入项目
If MsgBox("确定要删除收入名称为 " & Trim(.TextMatrix(.Row, 0)) & " 的值吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then
txtsql = "delete from pb_employeeincome where id =" & Val(.TextMatrix(.Row, 1)) & ""
If mrc1.State = adStateOpen Then mrc1.Close
mrc1.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
.TextMatrix(.Row, 4) = ""
txtValue.Text = ""
Sleep 500 '延时500毫秒
'更新员工工资福利各项统计表中该员工的收入总和,税收总和,工资总和
txtsql = "update pb_employeesum set sumIncome=" & SumIncome(tempNumber) & "," & "sumRevenue=" & Sumrevenue(tempNumber) & "," & "sumPay=" & sumPay(tempNumber) & Space(1) & "where employeeid =" & "'" & tempNumber & "'"
If mrc1.State = adStateOpen Then mrc1.Close
mrc1.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
cmdDelThird.Enabled = False
End If
Case "2" '支出项目
If MsgBox("确定要删除支出名称为 " & Trim(.TextMatrix(.Row, 0)) & " 的值吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then
txtsql = "delete from pb_employeepayout where id =" & Val(.TextMatrix(.Row, 1)) & ""
If mrc1.State = adStateOpen Then mrc1.Close
mrc1.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
.TextMatrix(.Row, 4) = ""
txtValue.Text = ""
Sleep 500 '延时500毫秒
'更新员工工资福利各项统计表中该员工的支出总和,税收总和,工资总和
txtsql = "update pb_employeesum set sumPayout=" & SumPayout(tempNumber) & "," & "sumRevenue=" & Sumrevenue(tempNumber) & "," & "sumPay=" & sumPay(tempNumber) & Space(1) & "where employeeid =" & "'" & tempNumber & "'"
If mrc1.State = adStateOpen Then mrc1.Close
mrc1.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
cmdDelThird.Enabled = False
End If
Case "3" '调整工资项目
If MsgBox("确定要删除调整工资名称为 " & Trim(.TextMatrix(.Row, 0)) & " 的值吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then
txtsql = "delete from pb_employeepayadjust where id =" & Val(.TextMatrix(.Row, 1)) & ""
If mrc1.State = adStateOpen Then mrc1.Close
mrc1.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
.TextMatrix(.Row, 4) = ""
txtValue.Text = ""
cmdDelThird.Enabled = False
End If
End Select
End With
End If
End Sub
'添加修改福利项目
Private Sub cmdSave_Click()
Dim mrc1 As New ADODB.Recordset
Dim tempNumber As String
If txtBoon.Text = "" Then
MsgBox "内容为空,请检查!"
txtBoon.SetFocus
Exit Sub
End If
tempNumber = Trim(Mid(tvwManage.SelectedItem.Parent.Key, 3)) '从它的上级目录的key中得出员工编号
With MSF2
If .TextMatrix(.Row, 1) = "" Then '保存该福利项目
txtsql = "select * from pb_employeeboon"
If mrc1.State = adStateOpen Then mrc1.Close
mrc1.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
mrc1.AddNew
mrc1.Fields("employeeid").Value = tempNumber '员工编号
mrc1.Fields("boonid").Value = .TextMatrix(.Row, 3) '福利序列号
mrc1.Fields("boontype").Value = IIf(.TextMatrix(.Row, 5) = "个人部分", 1, 2) '福利类型值
mrc1.Fields("boonvalue").Value = Val((Trim(txtBoon.Text))) '福利值
mrc1.Update
mrc1.Close
.TextMatrix(.Row, 8) = Trim(txtBoon.Text)
MsgBox "信息已保存", vbInformation, App.Title
Else '修改该项目
txtsql = "update pb_employeeboon set boonvalue=" & Val(Trim(txtBoon.Text)) & Space(1) & "where id =" & Val(.TextMatrix(.Row, 1)) & ""
If mrc1.State = adStateOpen Then mrc1.Close
mrc1.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
.TextMatrix(.Row, 8) = Trim(txtBoon.Text)
MsgBox "信息已修改", vbInformation, App.Title
End If
End With
Sleep 500 '延时500毫秒
'更新员工工资福利各项统计表中该员工的个人部分或公司部分福利总和,税收综合,工资总和
If MSF2.TextMatrix(MSF2.Row, 5) = "个人部分" Then
txtsql = "update pb_employeesum set sumBoon1=" & SumBoon1(tempNumber) & "," & "sumRevenue=" & Sumrevenue(tempNumber) & "," & "sumPay=" & sumPay(tempNumber) & Space(1) & "where employeeid =" & "'" & tempNumber & "'"
Else
txtsql = "update pb_employeesum set sumBoon2=" & SumBoon2(tempNumber) & "," & "sumRevenue=" & Sumrevenue(tempNumber) & "," & "sumPay=" & sumPay(tempNumber) & Space(1) & "where employeeid =" & "'" & tempNumber & "'"
End If
If mrc1.State = adStateOpen Then mrc1.Close
mrc1.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
cmdSave.Enabled = False
End Sub
Private Sub cmdSaveThird_Click()
Dim mrc1 As New ADODB.Recordset
Dim tempNumber As String
If txtValue.Text = "" Then
MsgBox "内容为空,请检查!"
txtValue.SetFocus
Exit Sub
End If
tempNumber = Trim(Mid(tvwManage.SelectedItem.Parent.Key, 3)) '从它的上级目录的key中得出员工编号
With MSF1
Select Case .Tag
Case "1" '收入项目
If .TextMatrix(.Row, 1) = "" Then '保存该收入项目
txtsql = "select * from pb_employeeincome"
If mrc1.State = adStateOpen Then mrc1.Close
mrc1.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
mrc1.AddNew
mrc1.Fields("employeeid").Value = tempNumber '员工编号
mrc1.Fields("incomeid").Value = .TextMatrix(.Row, 3) '收入序列号
mrc1.Fields("incomevalue").Value = Val((Trim(txtValue.Text))) '收入值
mrc1.Update
mrc1.Close
.TextMatrix(.Row, 4) = Trim(txtValue.Text)
MsgBox "信息已保存", vbInformation, App.Title
Else '修改该项目
txtsql = "update pb_employeeincome set incomevalue=" & Val(Trim(txtValue.Text)) & Space(1) & "where id =" & Val(.TextMatrix(.Row, 1)) & ""
If mrc1.State = adStateOpen Then mrc1.Close
mrc1.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
.TextMatrix(.Row, 4) = Trim(txtValue.Text)
MsgBox "信息已修改", vbInformation, App.Title
End If
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -