📄 gongzi.frm
字号:
Width = 900
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "工作部门:"
Height = 180
Left = 120
TabIndex = 37
Top = 840
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "员工姓名:"
Height = 180
Left = 2880
TabIndex = 3
Top = 360
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "员工编号:"
Height = 180
Left = 120
TabIndex = 2
Top = 360
Width = 900
End
End
Begin VB.Label Label23
AutoSize = -1 'True
Caption = "条记录"
Height = 180
Left = 4320
TabIndex = 50
Top = 6120
Width = 540
End
Begin VB.Label TiaoShu_GZ
AutoSize = -1 'True
Height = 180
Left = 4080
TabIndex = 49
Top = 6120
Width = 90
End
Begin VB.Label Label21
AutoSize = -1 'True
Caption = "一共"
Height = 180
Left = 3600
TabIndex = 48
Top = 6120
Width = 360
End
End
End
Attribute VB_Name = "GongZi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim LieShu_GongZi As Integer
Dim NianShu_GongZi As Integer
Dim YueShu_GongZi As Integer
Dim RiShu_GongZi As Integer
Dim QueDingShu As Integer
Dim RiQi1 As String
Dim RiQi2 As String
'Dim SQLstr As String
Dim KouChu As Integer
Dim DengJi As Integer
Dim LShbiao_GZ As New ADODB.Recordset
Private Sub Command1_Click()
GongZibiaoCZ.MoveNext
If GongZibiaoCZ.EOF Then GongZibiaoCZ.MovePrevious
textFuZhi_GongZi
End Sub
Private Sub Command2_Click()
GongZibiaoCZ.MovePrevious
If GongZibiaoCZ.BOF Then GongZibiaoCZ.MoveNext
textFuZhi_GongZi
End Sub
Private Sub Form_Load()
Me.Height = 7620
Me.Width = 5790
NianShu_GongZi = 1980
Do While NianShu_GongZi < 2006
TexNian_GongZi.AddItem NianShu_GongZi
NianShu_GongZi = NianShu_GongZi + 1
Loop
For YueShu_GongZi = 1 To 12
TexYue_GongZi.AddItem YueShu_GongZi
Next YueShu_GongZi
For RiShu_GongZ = 1 To 31
TexRi_GongZi.AddItem RiShu_GongZ
Next RiShu_GongZ
If GongZibiaoCZ.State = adStateOpen Then GongZibiaoCZ.Close
GongZibiaoCZ.Open "select * from pay", MySQL, adOpenKeyset, adLockPessimistic
If LShbiao_GZ.State = adStateOpen Then LShbiao_GZ.Close
LShbiao_GZ.Open "select gzid from pay group by gzid", MySQL, adOpenKeyset, adLockPessimistic
' Set YGbianhao_GongZi.RowSource = GongZibiaoCZ
' YGbianhao_GongZi.BoundColumn = "员工编号"
' YGbianhao_GongZi.ListField = "员工编号"
If GongZiChK_PD Then
YGbianhaoFuZhi_GongZi
GongZi.Caption = "查看员工工资信息"
QueDing_GongZi.Visible = False
QuXiao_GongZi.Left = 2400
JiSuan_GongZi.Visible = False
textFuZhi_GongZi
' ElseIf GongZiXG_PD Then
' YGbianhaoFuZhi_GongZi
' GongZi.Caption = "修改员工工资信息"
' QueDing_GongZi.Caption = "修 改"
' textFuZhi_GongZi
ElseIf GongZiShCh_PD Then
YGbianhaoFuZhi_GongZi
GongZi.Caption = "删除员工工资信息"
QueDing_GongZi.Caption = "删 除"
JiSuan_GongZi.Visible = False
textFuZhi_GongZi
ElseIf GongZiTJ_PD Then
YGbianhaoFuZhi_GongZi
GongZi.Caption = "添加员工工资信息"
QueDing_GongZi.Caption = "添 加"
Label21.Visible = False: TiaoShu_GZ.Visible = False: Label23.Visible = False
Command2.Visible = False
Command1.Visible = False
' Text_GongZi(1).Enabled = False
' Text_GongZi(5).Enabled = False
' Text_GongZi(6).Enabled = False
End If
End Sub
Sub YGbianhaoFuZhi_GongZi()
If GongZiTJ_PD Then
If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
ChaKanJB.Open "select ygid from manrecord", MySQL, adOpenKeyset, adLockPessimistic
Do While Not ChaKanJB.EOF
YGbianhao_GongZi.AddItem ChaKanJB.Fields(0)
ChaKanJB.MoveNext
Loop
Else
Do While Not LShbiao_GZ.EOF
YGbianhao_GongZi.AddItem LShbiao_GZ.Fields(0)
LShbiao_GZ.MoveNext
Loop
' LShbiao_GZ.MoveFirst
End If
End Sub
Sub textFuZhi_GongZi()
For LieShu_GongZi = 1 To 10
If GongZibiaoCZ.Fields(LieShu_GongZi) <> "" Then
Text_GongZi(LieShu_GongZi) = GongZibiaoCZ.Fields(LieShu_GongZi)
Else
Text_GongZi(LieShu_GongZi) = ""
End If
Next LieShu_GongZi
YGbianhao_GongZi.Text = GongZibiaoCZ.Fields(0)
JiBen_GongZi
RiQiFuZhi (Trim(Str(GongZibiaoCZ.Fields(11))))
TexNian_GongZi.Text = Nian
TexYue_GongZi.Text = Yue
RishuBH
' TexRi_GongZi.Text = Ri
TiaoShu_GZ.Caption = GongZibiaoCZ.RecordCount
End Sub
Sub RishuBH()
TexRi_GongZi.Clear
For RiShu_GongZi = 1 To RiShu
TexRi_GongZi.AddItem RiShu_GongZi
Next RiShu_GongZi
TexRi_GongZi.Text = Ri
End Sub
Private Sub Form_Unload(Cancel As Integer)
If GongZibiaoCZ.State = adStateOpen Then GongZibiaoCZ.Close
If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
If KQbiaoCZ.State = adStateOpen Then KQbiaoCZ.Close
Set GongZibiaoCZ = Nothing
Set ChaKanJB = Nothing
Set KQbiaoCZ = Nothing
End Sub
Private Sub JiSuan_GongZi_Click()
QueDingShu = MsgBox("请确定你所选择的员工编号和计算时间!", 67, "公司员工管理系统")
If QueDingShu = 6 Then
' DengJibiaoCZ.CursorLocation = adUseClient
If DengJibiaoCZ.State = adStateOpen Then DengJibiaoCZ.Close
DengJibiaoCZ.Open "select Djgrading from ranking where DJbusi='" & ZhiWei_GoZi & "'", MySQL, adOpenKeyset, adLockPessimistic
If DengJibiaoCZ.RecordCount = 0 Then
MsgBox "此职位不存在于职位等级表中!请添加相关项!", 48, "公司员工管理系统"
Exit Sub
Else
DengJi = DengJibiaoCZ.Fields(0)
Text_GongZi(1) = 800 * DengJibiaoCZ.Fields(0)
Text_GongZi(3) = 10 * DengJibiaoCZ.Fields(0)
Text_GongZi(6) = Val(Text_GongZi(1)) * 0.05
Text_GongZi(7) = Val(Text_GongZi(1)) * 0.02
Text_GongZi(8) = Val(Text_GongZi(1)) * 0.03
End If
RiQi1 = Trim(TexNian_GongZi.Text) & "-" & Trim(TexYue_GongZi.Text) & "-" & 1
RiQi1 = Format(RiQi1, "yyyy-m-d")
RiQi2 = Trim(TexNian_GongZi.Text) & "-" & Trim(TexYue_GongZi.Text) & "-" & Trim(TexRi_GongZi)
RiQi2 = Format(RiQi2, "yyyy-m-d")
SQLstr = "select * from checkin where kqid='" & YGbianhao_GongZi & "'and (kqdata>='" & RiQi1 & "'and kqdata<='" & RiQi2 & "') "
If KQbiaoCZ.State = adStateOpen Then KQbiaoCZ.Close
KQbiaoCZ.Open SQLstr, MySQL, adOpenKeyset, adLockPessimistic
If KQbiaoCZ.RecordCount = 0 Then
' Text_GongZi(2) = 100
Text_GongZi(4) = 0
Text_GongZi(5) = 0
Else
Do While Not KQbiaoCZ.EOF
If GuiZebiaoCZ.State = adStateOpen Then GuiZebiaoCZ.Close: Set GuiZebiaoCZ = Nothing
GuiZebiaoCZ.Open "select gdmoney,gdrank,gdjiajian from regulate where gdterm='" & KQbiaoCZ.Fields(1) & "'", MySQL, adOpenKeyset, adLockPessimistic
If GuiZebiaoCZ.RecordCount = 0 Then
MsgBox "规则表里没有相关奖罚规定!请添加相关规定!", 48, "公司员工管理系统"
Exit Sub
Else
If GuiZebiaoCZ.Fields(2) = 1 Then
Text_GongZi(4) = Val(Text_GongZi(4)) + GuiZebiaoCZ.Fields(0)
Else
If GuiZebiaoCZ.Fields(1) = 1 Then
Text_GongZi(5) = Val(Text_GongZi(5)) + Val(GuiZebiaoCZ.Fields(0)) * DengJi
Else
Text_GongZi(5) = Val(Text_GongZi(5)) + Val(GuiZebiaoCZ.Fields(0))
End If
End If
End If
KQbiaoCZ.MoveNext
Loop
End If
If Text_GongZi(5) = Str(0) Or Text_GongZi(5) = "" Then
Text_GongZi(2) = 100
Else
Text_GongZi(2) = 0
End If
If Val(Text_GongZi(1)) > 1000 Then
Text_GongZi(9) = Val(Text_GongZi(1)) * 0.08
Else
Text_GongZi(9) = 0
End If
Text_GongZi(10) = Val(Text_GongZi(1)) + Val(Text_GongZi(2)) + Val(Text_GongZi(3)) + Val(Text_GongZi(4)) - Val(Text_GongZi(5)) - Val(Text_GongZi(6)) _
- Val(Text_GongZi(7)) - Val(Text_GongZi(8)) - Val(Text_GongZi(9))
' KQjisuan
' If KQbiaoCZ.RecordCount <> 0 Then KouChu = KouChu + 10 * KQbiaoCZ.RecordCount
' SQLstr = "select * from checkin where kqid='" & YGbianhao_GongZi & "'and kqoutline='迟到' and (kqdata>='" & RiQi1 & "'and kqdata<='" & RiQi2 & "') "
' KQjisuan
' If KQbiaoCZ.RecordCount <> 0 Then KouChu = KouChu + 20 * KQbiaoCZ.RecordCount
' SQLstr = "select * from checkin where kqid='" & YGbianhao_GongZi & "'and kqoutline='早退' and (kqdata>='" & RiQi1 & "'and kqdata<='" & RiQi2 & "') "
' KQjisuan
' If KQbiaoCZ.RecordCount <> 0 Then KouChu = KouChu + 30 * KQbiaoCZ.RecordCount
' SQLstr = "select * from checkin where kqid='" & YGbianhao_GongZi & "'and kqoutline='旷工' and (kqdata>='" & RiQi1 & "'and kqdata<='" & RiQi2 & "') "
' KQjisuan
' If KQbiaoCZ.RecordCount <> 0 Then KouChu = KouChu + 50 * KQbiaoCZ.RecordCount
End If
End Sub
Private Sub QueDing_GongZi_Click()
' If QueDing_GongZi.Caption = "修 改" Then
' QueDingShu = MsgBox("确定修改相关项吗?", 51, "公司员工管理系统")
' If QueDingShu = 6 Then
' If YGbianhao_GongZi.Text <> GongZibiaoCZ.Fields(0) Then
' MsgBox "不能修改员工编号!", 48, "公司员工管理系统"
' Exit Sub
' End If
' ShuJuFuZhi_GongZi
' GongZibiaoCZ.Update
' End If
If QueDing_GongZi.Caption = "删 除" Then
QueDingShu = MsgBox("确定删除此条记录么?", 51, "公司员工管理系统")
If QueDingShu = 6 Then
GongZibiaoCZ.Delete
GongZibiaoCZ.MoveFirst
textFuZhi_GongZi
End If
ElseIf QueDing_GongZi.Caption = "添 加" Then
QueDingShu = MsgBox("确定添加此条记录吗?", 51, "公司员工管理系统")
If QueDingShu = 6 Then
' If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
' ChaKanJB.Open "select ygid from manrecord where ygid='" & YGbianhao_GongZi & "'", MySQL, adOpenKeyset, adLockPessimistic
' If ChaKanJB.RecordCount = -1 Then
' MsgBox "不存在此编号员工的基本信息!" & vbCrLf & "请先添加此编号的员工基本信息!", 48, "公司员工管理系统"
' Exit Sub
' End If
If GongZibiaoCZ.State = adStateOpen Then GongZibiaoCZ.Close
GongZibiaoCZ.Open "select gzdata from pay where gzid='" & YGbianhao_GongZi & "'", MySQL, adOpenKeyset, adLockPessimistic
If GongZibiaoCZ.RecordCount <> 0 Then
Do While Not GongZibiaoCZ.EOF
RiQiFuZhi (GongZibiaoCZ.Fields("gzdata"))
If TexNian_GongZi = Nian And TexYue_GongZi = Yue Then
MsgBox "此编号员工的这个月工资信息已经存在!", 48, "公司员工管理系统"
Exit Sub
Else
GongZibiaoCZ.MoveNext
End If
Loop
End If
If GongZibiaoCZ.State = adStateOpen Then GongZibiaoCZ.Close
GongZibiaoCZ.Open "pay", MySQL, adOpenKeyset, adLockPessimistic
GongZibiaoCZ.AddNew
ShuJuFuZhi_GongZi
GongZibiaoCZ.Update
End If
End If
End Sub
Private Sub QuXiao_GongZi_Click()
Unload Me
End Sub
Private Sub TexNian_GongZi_Click()
RiShu = RiJS(Trim(TexNian_GongZi), Trim(TexYue_GongZi))
RishuBH
End Sub
'Private Sub Text_GongZi_Change(Index As Integer)
' If Index <> 1 Then
' Text_GongZi(10) = Val(Trim(Text_GongZi(2))) + Val(Trim(Text_GongZi(3))) + Val(Trim(Text_GongZi(4))) _
' + Val(Trim(Text_GongZi(5))) - Val(Trim(Text_GongZi(6))) - Val(Trim(Text_GongZi(7))) - Val(Trim(Text_GongZi(8))) - Val(Trim(Text_GongZi(9)))
' Text_GongZi(11) = Text_GongZi(10)
' End If
'End Sub
Private Sub TexYue_GongZi_Click()
RiShu = RiJS(Trim(TexNian_GongZi), Trim(TexYue_GongZi))
RishuBH
End Sub
Private Sub YGbianhao_GongZi_Click()
If GongZiTJ_PD Then
' If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
' ChaKanJB.Open "select ygname from manrecord where ygid='" & YGbianhao_GongZi & "'", MySQL, adOpenKeyset, adLockPessimistic
' Text_GongZi(1).Text = ChaKanJB.Fields(0)
JiBen_GongZi
JiSuan_GongZi.Enabled = True
Else
If GongZibiaoCZ.State = adStateOpen Then GongZibiaoCZ.Close
GongZibiaoCZ.Open "select * from pay where gzid='" & YGbianhao_GongZi & "'", MySQL, adOpenKeyset, adLockPessimistic
textFuZhi_GongZi
End If
End Sub
Sub ShuJuFuZhi_GongZi()
For LieShu_GongZi = 1 To 10
GongZibiaoCZ.Fields(LieShu_GongZi) = Trim(Text_GongZi(LieShu_GongZi))
Next LieShu_GongZi
GongZibiaoCZ.Fields(0) = YGbianhao_GongZi.Text
GongZibiaoCZ.Fields(11) = Trim(TexNian_GongZi) & "-" & Trim(TexYue_GongZi) & "-" & Trim(TexRi_GongZi)
End Sub
Sub JiBen_GongZi()
If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
ChaKanJB.Open "select ygname from manrecord where ygid='" & YGbianhao_GongZi & "'", MySQL, adOpenKeyset, adLockPessimistic
If ChaKanJB.RecordCount = 0 Then
MsgBox "没有此编号的员工基本信息!请先添加相关的员工基本信息!", 48, "公司员工管理系统"
JiSuan_GongZi.Enabled = False
Exit Sub
Else
XingMing_GongZi = ChaKanJB.Fields(0)
End If
If GZbiaoCZ.State = adStateOpen Then GZbiaoCZ.Close
GZbiaoCZ.Open "select wdept,wbusi from manappraise where wid='" & YGbianhao_GongZi & "'", MySQL, adOpenKeyset, adLockPessimistic
If GZbiaoCZ.RecordCount = 0 Then
MsgBox "没有此编号的员工工作信息!请先添加相关的员工工作信息!", 48, "公司员工管理系统"
BuMen_GoZi = ""
ZhiWei_GoZi = ""
JiSuan_GongZi.Enabled = False
Exit Sub
Else
BuMen_GoZi = GZbiaoCZ.Fields(0)
ZhiWei_GoZi = GZbiaoCZ.Fields(1)
End If
End Sub
Private Sub YGbianhao_GongZi_LostFocus()
JiSuan_GongZi.Enabled = True
JiBen_GongZi
End Sub
'Sub KQjisuan()
' If KQbiaoCZ.State = adStateOpen Then KQbiaoCZ.Close: Set KQbiaoCZ = Nothing
' KQbiaoCZ.Open SQLstr, MySQL, adOpenKeyset, adLockPessimistic
'End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -