XianGaiKQ.frm
资源名称:20080403.rar [点击查看]
上传用户:linhua1013
上传日期:2014-12-05
资源大小:375k
文件大小:30k
源码类别:
SQL Server
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form XiuGaiKQ
- Caption = "修改员工考勤"
- ClientHeight = 5535
- ClientLeft = 60
- ClientTop = 450
- ClientWidth = 6360
- LinkTopic = "Form1"
- MDIChild = -1 'True
- ScaleHeight = 5535
- ScaleWidth = 6360
- Begin VB.CommandButton Shang_KQ
- Caption = "上 一 条"
- Height = 375
- Left = 240
- TabIndex = 23
- Top = 5040
- Visible = 0 'False
- Width = 1095
- End
- Begin VB.CommandButton Next_KQ
- Caption = "下 一 条"
- Height = 375
- Left = 5040
- TabIndex = 22
- Top = 5040
- Visible = 0 'False
- Width = 1095
- End
- Begin VB.CommandButton QuXiao_KQ
- Caption = "取 消"
- Height = 375
- Left = 3600
- TabIndex = 8
- Top = 5040
- Width = 1095
- End
- Begin VB.CommandButton QueDing_KQ
- Caption = "修 改"
- Height = 375
- Left = 1680
- TabIndex = 7
- Top = 5040
- Width = 1095
- End
- Begin VB.Frame Frame2
- Caption = "考勤信息"
- Height = 1215
- Left = 120
- TabIndex = 11
- Top = 1320
- Width = 6135
- Begin VB.ComboBox KQleixing
- Height = 300
- ItemData = "XianGaiKQ.frx":0000
- Left = 1680
- List = "XianGaiKQ.frx":0016
- TabIndex = 19
- Top = 240
- Width = 1455
- End
- Begin VB.ComboBox texRi_KQ
- Height = 300
- Left = 4080
- TabIndex = 6
- Text = "31"
- Top = 660
- Width = 615
- End
- Begin VB.ComboBox texYue_KQ
- Height = 300
- Left = 3000
- TabIndex = 5
- Text = "12"
- Top = 660
- Width = 615
- End
- Begin VB.ComboBox texNian_KQ
- Height = 300
- Left = 1680
- TabIndex = 4
- Text = "1984"
- Top = 660
- Width = 855
- End
- Begin VB.Label Label13
- AutoSize = -1 'True
- Caption = "*"
- ForeColor = &H008080FF&
- Height = 180
- Left = 5160
- TabIndex = 29
- Top = 720
- Width = 90
- End
- Begin VB.Label Label12
- AutoSize = -1 'True
- Caption = "*"
- ForeColor = &H008080FF&
- Height = 180
- Left = 3240
- TabIndex = 28
- Top = 300
- Width = 90
- End
- Begin VB.Label Label11
- AutoSize = -1 'True
- Caption = "条记录"
- Height = 180
- Left = 4560
- TabIndex = 26
- Top = 300
- Visible = 0 'False
- Width = 540
- End
- Begin VB.Label TiaoShu_KQ
- AutoSize = -1 'True
- Height = 180
- Left = 4320
- TabIndex = 25
- Top = 300
- Visible = 0 'False
- Width = 90
- End
- Begin VB.Label Label9
- AutoSize = -1 'True
- Caption = "该员工有"
- Height = 180
- Left = 3480
- TabIndex = 24
- Top = 300
- Visible = 0 'False
- Width = 720
- End
- Begin VB.Label Label8
- AutoSize = -1 'True
- Caption = "考勤结果:"
- Height = 180
- Left = 480
- TabIndex = 18
- Top = 300
- Width = 900
- End
- Begin VB.Label Label6
- AutoSize = -1 'True
- Caption = "日"
- Height = 180
- Left = 4800
- TabIndex = 15
- Top = 720
- Width = 180
- End
- Begin VB.Label Label5
- AutoSize = -1 'True
- Caption = "月"
- Height = 180
- Left = 3720
- TabIndex = 14
- Top = 720
- Width = 180
- End
- Begin VB.Label Label4
- AutoSize = -1 'True
- Caption = "年"
- Height = 180
- Left = 2640
- TabIndex = 13
- Top = 720
- Width = 180
- End
- Begin VB.Label Label3
- AutoSize = -1 'True
- Caption = "考勤时间:"
- Height = 180
- Left = 480
- TabIndex = 12
- Top = 720
- Width = 900
- End
- End
- Begin VB.Frame Frame1
- Caption = "员工信息"
- Height = 1095
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 6135
- Begin VB.ComboBox YGbianhao_KQ
- Height = 300
- Left = 1440
- TabIndex = 1
- Top = 240
- Width = 1455
- End
- Begin VB.TextBox BuMen_KQ
- BackColor = &H80000011&
- Enabled = 0 'False
- Height = 270
- Left = 1440
- TabIndex = 3
- Top = 650
- Width = 4335
- End
- Begin VB.TextBox XingMing_KQ
- BackColor = &H80000011&
- Enabled = 0 'False
- Height = 270
- Left = 4320
- TabIndex = 2
- Top = 240
- Width = 1455
- End
- Begin VB.Label Label10
- AutoSize = -1 'True
- Caption = "*"
- ForeColor = &H008080FF&
- Height = 180
- Left = 3000
- TabIndex = 27
- Top = 280
- Width = 90
- End
- Begin VB.Label Label7
- AutoSize = -1 'True
- Caption = "工作部门:"
- Height = 180
- Left = 360
- TabIndex = 17
- Top = 720
- Width = 900
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "员工编号:"
- Height = 180
- Left = 360
- TabIndex = 10
- Top = 285
- Width = 900
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- Caption = "员工姓名:"
- Height = 180
- Left = 3240
- TabIndex = 9
- Top = 285
- Width = 900
- End
- End
- Begin VB.Frame Frame3
- Height = 4695
- Left = 120
- TabIndex = 16
- Top = 120
- Width = 6135
- Begin VB.Frame Frame4
- Caption = "备注"
- Height = 1815
- Left = 0
- TabIndex = 20
- Top = 2520
- Width = 6135
- Begin VB.TextBox KQbeizhu
- Height = 1335
- Left = 240
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 21
- Top = 360
- Width = 5655
- End
- End
- Begin VB.Label Label15
- AutoSize = -1 'True
- Caption = "*"
- ForeColor = &H008080FF&
- Height = 180
- Left = 4800
- TabIndex = 31
- Top = 4380
- Width = 90
- End
- Begin VB.Label Label14
- AutoSize = -1 'True
- Caption = "为必填项!"
- Height = 180
- Left = 5040
- TabIndex = 30
- Top = 4380
- Width = 900
- End
- End
- End
- Attribute VB_Name = "XiuGaiKQ"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- 'Dim LieShu As Integer
- 'Dim Nian_KQ As Integer
- 'Dim Yue_KQ As Integer
- ''Dim Ri_KQ As Integer
- 'Dim RiShu_KQ As Integer
- 'Dim ShJquzhi_KQ As Integer
- 'Dim ShJzancun_KQ As String
- 'Dim ShJnianPD_KQ As Boolean
- 'Dim ShiJian_KQ As String
- 'Dim LShmima_KQ As String
- Dim CaoZuo_KQ As Integer
- 'Dim ZongJieRiQi_KQ As String
- 'Dim PDriqiTex_KQ As String
- 'Dim LPDriqiTex_KQ As String
- 'Dim PDriqiShu_KQ As Integer
- Dim LShbiao_KQ As New ADODB.Recordset
- '
- 'Private Sub Form_Load()
- ' Me.Height = 6495
- ' Me.Width = 6480
- ' Nian_KQ = 1990
- '
- ' If KQbiaoCZ.State = adStateOpen Then KQbiaoCZ.Close
- ' KQbiaoCZ.Open "select * from checkin", MySQL, adOpenKeyset, adLockPessimistic
- ' Do While Not KQbiaoCZ.EOF
- ' YGbianhao_KQ.AddItem KQbiaoCZ.Fields(0)
- ' KQbiaoCZ.MoveNext
- ' Loop
- ' KQbiaoCZ.MoveFirst
- '' YGbianhao_KQ.ListIndex = 0
- ' Do While Nian_KQ < 2010
- ' texNian_KQ.AddItem Nian_KQ
- ' Nian_KQ = Nian_KQ + 1
- ' Loop
- ' For Yue_KQ = 1 To 12
- ' texYue_KQ.AddItem Yue_KQ
- ' Next Yue_KQ
- ' For RiShu_KQ = 1 To 31
- ' texRi_KQ.AddItem RiShu_KQ
- ' Next RiShu_KQ
- ' If TianJiaKQ_PD Then
- ' If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
- ' ChaKanJB.Open "select ygid,ygname from manrecord", MySQL, adOpenKeyset, adLockPessimistic
- ' YGbianhao_KQ.Clear
- ' Do While Not ChaKanJB.EOF
- ' YGbianhao_KQ.AddItem ChaKanJB.Fields(0)
- ' ChaKanJB.MoveNext
- ' Loop
- ' XiuGaiKQ.Caption = "添加员工考勤信息"
- ' QueDing_KQ.Caption = "添 加"
- ' ElseIf XiuGaiKQ_PD Then
- ' XiuGaiKQ.Caption = "修改员工考勤信息"
- ' QueDing_KQ.Caption = "修 改"
- ' textFuZhi_KQ
- ' ElseIf ShanChuKQ_PD Then
- ' XiuGaiKQ.Caption = "删除员工考勤信息"
- ' QueDing_KQ.Caption = "删 除"
- ' textFuZhi_KQ
- ' End If
- 'End Sub
- '
- 'Sub textFuZhi_KQ()
- ' For LieShu = 0 To 16
- ' If LieShu = 0 Or LieShu = 3 Then
- ' Else
- ' If KQbiaoCZ.Fields(LieShu) <> "" Then
- ' text_KQ(LieShu) = KQbiaoCZ.Fields(LieShu)
- ' Else
- ' If LieShu = 2 Then
- ' text_KQ(LieShu) = ""
- ' Else
- ' text_KQ(LieShu) = "0"
- ' End If
- ' End If
- ' End If
- ' Next LieShu
- ' YGbianhao_KQ.Text = KQbiaoCZ.Fields(0)
- '' For ShJquzhi_KQ = 1 To Len(KQbiaoCZ.Fields(3)) + 1
- '' ShJzancun_KQ = Mid(KQbiaoCZ.Fields(3), ShJquzhi_KQ, 1)
- '' If ShJzancun_KQ = "-" Then
- '' If ShJnianPD_KQ Then
- '' texYue_KQ.Text = ShiJian_KQ
- '' ShiJian_KQ = ""
- '' ShJnianPD_KQ = False
- '' Else
- '' texNian_KQ.Text = ShiJian_KQ
- '' ShiJian_KQ = ""
- '' ShJnianPD_KQ = True
- '' End If
- '' ElseIf ShJzancun_KQ = "" Then
- '' RiShu_KQ = RiJS(Trim(texNian_KQ), Trim(texYue_KQ))
- '' texRi_KQ.Clear
- '' For Ri_KQ = 1 To RiShu_KQ
- '' texRi_KQ.AddItem Ri_KQ
- '' Next Ri_KQ
- '' texRi_KQ.Text = ShiJian_KQ
- '' ShiJian_KQ = ""
- '' Else
- '' ShiJian_KQ = ShiJian_KQ & ShJzancun_KQ
- '' End If
- '' Next ShJquzhi_KQ
- ' RiQiFuZhi (Trim(Str(KQbiaoCZ.Fields(3))))
- ' texNian_KQ.Text = Nian
- ' texYue_KQ.Text = Yue
- ' texRi_KQ.Clear
- ' For RiShu_KQ = 1 To RiShu
- ' texRi_KQ.AddItem RiShu_KQ
- ' Next RiShu_KQ
- ' texRi_KQ.Text = Ri
- ' If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
- ' ChaKanJB.Open "select ygname from manrecord where ygid='" & YGbianhao_KQ & "'", MySQL, adOpenKeyset, adLockPessimistic
- '
- 'End Sub
- '
- 'Private Sub Form_Unload(Cancel As Integer)
- ' Set ChaKanJB = Nothing
- ' Set KQbiaoCZ = Nothing
- ' Set GZbiaoCZ = Nothing
- 'End Sub
- '
- 'Private Sub QueDing_KQ_Click()
- ' LShmima_KQ = InputBox("请输入当前管理员密码!", "公司员工管理系统")
- ' If LShmima_KQ <> DLyonghuMM Then
- ' MsgBox "密码错误!无法执行操作!", 48, "公司员工管理系统"
- ' Else
- ' If QueDing_KQ.Caption = "修 改" Then
- ' CaoZuo_KQ = MsgBox("密码正确!" & vbCrLf & "确定修改相关项吗?", 67, "公司员工管理系统")
- ' Select Case CaoZuo_KQ
- ' Case 6
- ' If YGbianhao_KQ.Text = "" Or texNian_KQ.Text = "" Or texYue_KQ.Text = "" Or texRi_KQ.Text = "" Then
- ' MsgBox "员工编号、考勤总结日期的年月日,均不能为空!" & vbCrLf & "请检查数据的正确完整性!", 48, "公司员工管理系统"
- ' Else
- '' LShbiao_KQ.Open "select 总结日期 from checkin where 员工编号='" & YGbianhao_KQ.Text & "'", MySQL, adOpenKeyset, adLockPessimistic
- '' If LShbiao_KQ.RecordCount = 0 Then
- '' Set LShbiao_KQ = Nothing
- '' ShuJuKufuzhi_KQ
- '' Else
- '' Do While Not LShbiao_KQ.EOF
- '' If ZongJieRiQi_KQ = LShbiao_KQ.Fields(0) Then
- ''
- '' Loop
- ' ShuJuKufuzhi_KQ
- ' End If
- '' Case 7
- '' KQbiaoCZ.MoveFirst
- '' Case 2
- '' KQbiaoCZ.MoveFirst
- ' End Select
- ' ElseIf QueDing_KQ.Caption = "添 加" Then
- ' CaoZuo_KQ = MsgBox("密码正确!" & vbCrLf & "确定添加相关项吗?", 67, "公司员工管理系统")
- ' Select Case CaoZuo_KQ
- ' Case 6
- ' If YGbianhao_KQ.Text = "" Or texNian_KQ.Text = "" Or texYue_KQ.Text = "" Or texRi_KQ.Text = "" Then
- ' MsgBox "员工编号、考勤总结日期的年月日,均不能为空!" & vbCrLf & "请检查数据的正确完整性!", 48, "公司员工管理系统"
- ' Else
- ' ZongJieRiQi_KQ = texNian_KQ.Text & "-" & texYue_KQ.Text
- ' LShbiao_KQ.Open "select ygid from manrecord where ygid='" & YGbianhao_KQ.Text & "'", MySQL, adOpenKeyset, adLockPessimistic
- ' If LShbiao_KQ.RecordCount = 0 Then
- ' MsgBox "数据库里面不存在这个编码的员工!请先添加员工的基本信息!", 48, "公司员工管理系统"
- ' Set LShbiao_KQ = Nothing
- ' Exit Sub
- ' Else
- ' Set LShbiao_KQ = Nothing
- ' End If
- ' LShbiao_KQ.Open "select kqdata from checkin where kqid='" & YGbianhao_KQ.Text & "'", MySQL, adOpenKeyset, adLockPessimistic
- ' If LShbiao_KQ.RecordCount = 0 Then
- ' Set LShbiao_KQ = Nothing
- ' KQbiaoCZ.AddNew
- ' ShuJuKufuzhi_KQ
- ' KQbiaoCZ.Update
- ' Else
- ' Do While Not LShbiao_KQ.EOF
- ' PDriqiShu_KQ = 0
- ' For ShJquzhi_KQ = 1 To Len(LShbiao_KQ.Fields(0))
- ' LPDriqiTex_KQ = Mid(LShbiao_KQ.Fields(0), ShJquzhi_KQ, 1)
- ' If LPDriqiTex_KQ = "-" Then
- ' If PDriqiShu_KQ = 0 Then
- ' PDriqiShu_KQ = 1
- ' PDriqiTex_KQ = PDriqiTex_KQ & LPDriqiTex_KQ
- ' Else
- ' Exit For
- ' End If
- ' Else
- ' PDriqiTex_KQ = PDriqiTex_KQ & LPDriqiTex_KQ
- ' End If
- ' Next ShJquzhi_KQ
- ' If ZongJieRiQi_KQ = PDriqiTex_KQ Then
- ' MsgBox "此人此月的考勤信息已经存在!", 48, "公司员工管理系统"
- ' Set LShbiao_KQ = Nothing
- ' Exit Sub
- ' Else
- ' LShbiao_KQ.MoveFirst
- ' End If
- ' Loop
- ' Set LShbiao_KQ = Nothing
- ' KQbiaoCZ.AddNew
- ' ShuJuKufuzhi_KQ
- ' KQbiaoCZ.Update
- ' End If
- ' End If
- '' Case 2
- '' KQbiaoCZ.MoveFirst
- ' End Select
- ' ElseIf QueDing_KQ.Caption = "删 除" Then
- ' CaoZuo_KQ = MsgBox("密码正确!" & vbCrLf & "确定删除此条记录吗?", 67, "公司员工管理系统")
- ' Select Case CaoZuo_KQ
- ' Case 6
- ' KQbiaoCZ.Delete
- ' KQbiaoCZ.MoveFirst
- ' textFuZhi_KQ
- ' End Select
- ' End If
- ' End If
- 'End Sub
- '
- 'Private Sub QuXiao_KQ_Click()
- ' Unload Me
- 'End Sub
- '
- 'Private Sub texNian_KQ_Click()
- ' BenYueTSh
- ' RiShu = RiJS(Trim(texNian_KQ), Trim(texYue_KQ))
- ' texRi_KQ.Clear
- ' For RiShu_KQ = 1 To RiShu
- ' texRi_KQ.AddItem RiShu_KQ
- ' Next RiShu_KQ
- ' texRi_KQ.Text = "1"
- 'End Sub
- '
- 'Private Sub texRi_KQ_Click()
- ' BenYueTSh
- 'End Sub
- '
- 'Private Sub text_KQ_Change(Index As Integer)
- ' Select Case Index
- ' Case 16
- ' text_KQ(12) = Val(Trim(text_KQ(16))) - 4 - Val(Trim(text_KQ(9)))
- ' Case 12
- ' text_KQ(13) = Val(Trim(text_KQ(12))) - Val(Trim(text_KQ(4))) - Val(Trim(text_KQ(5))) - Val(Trim(text_KQ(6))) - Val(Trim(text_KQ(8))) + Val(Trim(text_KQ(10))) + Val(Trim(text_KQ(11)))
- ' Case 9
- ' text_KQ(12) = Val(Trim(text_KQ(16))) - 4 - Val(Trim(text_KQ(9)))
- ' Case 4
- ' text_KQ(13) = Val(Trim(text_KQ(12))) - Val(Trim(text_KQ(4))) - Val(Trim(text_KQ(5))) - Val(Trim(text_KQ(6))) - Val(Trim(text_KQ(8))) + Val(Trim(text_KQ(10))) + Val(Trim(text_KQ(11)))
- ' text_KQ(15) = Val(Trim(text_KQ(4))) * 10 + Val(Trim(text_KQ(5))) * 15 + Val(Trim(text_KQ(6))) * 30 + Val(Trim(text_KQ(8))) * 100
- ' Case 5
- ' text_KQ(13) = Val(Trim(text_KQ(12))) - Val(Trim(text_KQ(4))) - Val(Trim(text_KQ(5))) - Val(Trim(text_KQ(6))) - Val(Trim(text_KQ(8))) + Val(Trim(text_KQ(10))) + Val(Trim(text_KQ(11)))
- ' text_KQ(15) = Val(Trim(text_KQ(4))) * 10 + Val(Trim(text_KQ(5))) * 15 + Val(Trim(text_KQ(6))) * 30 + Val(Trim(text_KQ(8))) * 100
- ' Case 6
- ' text_KQ(13) = Val(Trim(text_KQ(12))) - Val(Trim(text_KQ(4))) - Val(Trim(text_KQ(5))) - Val(Trim(text_KQ(6))) - Val(Trim(text_KQ(8))) + Val(Trim(text_KQ(10))) + Val(Trim(text_KQ(11)))
- ' text_KQ(15) = Val(Trim(text_KQ(4))) * 10 + Val(Trim(text_KQ(5))) * 15 + Val(Trim(text_KQ(6))) * 30 + Val(Trim(text_KQ(8))) * 100
- ' Case 7
- ' text_KQ(14) = Val(Trim(text_KQ(10))) * 200 + Val(Trim(text_KQ(11))) * 150 + Val(Trim(text_KQ(7))) * 20
- ' Case 8
- ' text_KQ(13) = Val(Trim(text_KQ(12))) - Val(Trim(text_KQ(4))) - Val(Trim(text_KQ(5))) - Val(Trim(text_KQ(6))) - Val(Trim(text_KQ(8))) + Val(Trim(text_KQ(10))) + Val(Trim(text_KQ(11)))
- ' text_KQ(15) = Val(Trim(text_KQ(4))) * 10 + Val(Trim(text_KQ(5))) * 15 + Val(Trim(text_KQ(6))) * 30 + Val(Trim(text_KQ(8))) * 100
- ' Case 10
- ' text_KQ(13) = Val(Trim(text_KQ(12))) - Val(Trim(text_KQ(4))) - Val(Trim(text_KQ(5))) - Val(Trim(text_KQ(6))) - Val(Trim(text_KQ(8))) + Val(Trim(text_KQ(10))) + Val(Trim(text_KQ(11)))
- ' text_KQ(14) = Val(Trim(text_KQ(10))) * 200 + Val(Trim(text_KQ(11))) * 150 + Val(Trim(text_KQ(7))) * 20
- ' Case 11
- ' text_KQ(13) = Val(Trim(text_KQ(12))) - Val(Trim(text_KQ(4))) - Val(Trim(text_KQ(5))) - Val(Trim(text_KQ(6))) - Val(Trim(text_KQ(8))) + Val(Trim(text_KQ(10))) + Val(Trim(text_KQ(11)))
- ' text_KQ(14) = Val(Trim(text_KQ(10))) * 200 + Val(Trim(text_KQ(11))) * 150 + Val(Trim(text_KQ(7))) * 20
- ' End Select
- 'End Sub
- '
- 'Private Sub texYue_KQ_Click()
- ' BenYueTSh
- ' RiShu = RiJS(Trim(texNian_KQ), Trim(texYue_KQ))
- ' texRi_KQ.Clear
- ' For RiShu_KQ = 1 To RiShu
- ' texRi_KQ.AddItem RiShu_KQ
- ' Next RiShu_KQ
- ' texRi_KQ.Text = "1"
- 'End Sub
- '
- 'Private Sub YGbianhao_KQ_Click()
- ' If TianJiaKQ_PD Then
- ' Set ChaKanJB = Nothing
- ' ChaKanJB.Open "select ygname from manrecord where ygid='" & YGbianhao_KQ.Text & "'", MySQL, adOpenKeyset, adLockPessimistic
- '' For LieShu = 1 To 2
- '' If ChaKanJB.Fields(LieShu) <> "" Then
- '' text_KQ(LieShu) = ChaKanJB.Fields(LieShu)
- '' Else
- '' text_KQ(LieShu) = ""
- '' End If
- '' Next LieShu
- ' text_KQ(1) = ChaKanJB.Fields("ygname")
- ' Set GZbiaoCZ = Nothing
- ' GZbiaoCZ.Open "select * from manappraise where wid='" & YGbianhao_KQ.Text & "'", MySQL, adOpenKeyset, adLockPessimistic
- ' If GZbiaoCZ.RecordCount = 0 Then
- ' MsgBox "没有此编号员工的工作信息!请及时添加或询问管理员!", 48, "公司员工管理系统"
- ' Else
- ' If GZbiaoCZ.Fields("wdept") = "" Then
- ' MsgBox "此编号员工的工作信息不全,请及时添加或询问管理员!", 48, "公司员工管理系统"
- ' Else
- ' text_KQ(2) = GZbiaoCZ.Fields("wdept")
- ' End If
- ' End If
- ' Else
- ' Set KQbiaoCZ = Nothing
- ' KQbiaoCZ.Open "select * from checkin where kqid='" & YGbianhao_KQ.Text & "'", MySQL, adOpenKeyset, adLockPessimistic
- ' textFuZhi_KQ
- ' End If
- 'End Sub
- '
- 'Sub ShuJuKufuzhi_KQ()
- ' KQbiaoCZ.Fields(0) = YGbianhao_KQ.Text
- ' For LieShu = 0 To 16
- ' If LieShu = 0 Or LieShu = 3 Then
- ' Else
- ' If text_KQ(LieShu).Text = "" Then
- ' KQbiaoCZ.Fields(LieShu) = 0
- ' Else
- ' KQbiaoCZ.Fields(LieShu) = Trim(text_KQ(LieShu).Text)
- ' End If
- ' End If
- ' Next LieShu
- ' KQbiaoCZ.Fields(3) = texNian_KQ.Text & "-" & texYue_KQ.Text & "-" & texRi_KQ.Text
- ' KQbiaoCZ.Update
- 'End Sub
- '
- 'Sub BenYueTSh()
- ' RiQi1 = texNian_KQ & "/" & texYue_KQ & "/" & 1
- ' RiQi2 = texNian_KQ & "/" & texYue_KQ & "/" & texRi_KQ
- ' text_KQ(16).Text = Trim(Str(DateDiff("d", RiQi1, RiQi2)))
- '
- '
- 'End Sub
- Sub TextFuZhi_KQ()
- YGbianhao_KQ.Text = KQbiaoCZ.Fields(0)
- KQleixing.Text = KQbiaoCZ.Fields(1)
- KQbeizhu = IIf(KQbiaoCZ.Fields(3) = Null, "", KQbiaoCZ.Fields(3))
- RiQiFuZhi (Trim(Str(KQbiaoCZ.Fields(2))))
- texNian_KQ.Text = Nian
- texYue_KQ.Text = Yue
- texRi_KQ.Clear
- For RiShu_KQ = 1 To RiShu
- texRi_KQ.AddItem RiShu_KQ
- Next RiShu_KQ
- texRi_KQ.Text = Ri
- If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
- ChaKanJB.Open "select ygname from manrecord where ygid='" & YGbianhao_KQ & "'", MySQL, adOpenKeyset, adLockPessimistic
- XingMing_KQ = IIf(ChaKanJB.Fields(0) = Null, "", ChaKanJB.Fields(0))
- If GZbiaoCZ.State = adStateOpen Then GZbiaoCZ.Close
- GZbiaoCZ.Open "select wdept from manappraise where wid='" & YGbianhao_KQ & "'", MySQL, adOpenKeyset, adLockPessimistic
- If GZbiaoCZ.RecordCount <> 0 Then
- BuMen_KQ = IIf(GZbiaoCZ.Fields(0) = Null, "", GZbiaoCZ.Fields(0))
- Else
- MsgBox "此编号员工没有相应的工作信息!请及时向管理员反映!", 48, "公司员工管理系统"
- BuMen_KQ = ""
- End If
- If LShbiao_KQ.State = adStateOpen Then LShbiao_KQ.Close
- LShbiao_KQ.Open "select * from checkin where kqid='" & YGbianhao_KQ & "'", MySQL, adOpenKeyset, adLockPessimistic
- TiaoShu_KQ.Caption = LShbiao_KQ.RecordCount
- End Sub
- Private Sub Form_Load()
- Me.Height = 6045
- Me.Width = 6480
- Nian_KQ = 1990
- If KQbiaoCZ.State = adStateOpen Then KQbiaoCZ.Close
- KQbiaoCZ.Open "select * from checkin", MySQL, adOpenKeyset, adLockPessimistic
- If LShbiao_KQ.State = adStateOpen Then LShbiao_KQ.Close
- LShbiao_KQ.Open "select kqid from checkin group by kqid", MySQL, adOpenKeyset, adLockPessimistic
- Do While Not LShbiao_KQ.EOF
- YGbianhao_KQ.AddItem LShbiao_KQ.Fields(0)
- LShbiao_KQ.MoveNext
- Loop
- KQbiaoCZ.MoveFirst
- Do While Nian_KQ < 2010
- texNian_KQ.AddItem Nian_KQ
- Nian_KQ = Nian_KQ + 1
- Loop
- For Yue_KQ = 1 To 12
- texYue_KQ.AddItem Yue_KQ
- Next Yue_KQ
- For RiShu_KQ = 1 To 31
- texRi_KQ.AddItem RiShu_KQ
- Next RiShu_KQ
- If TianJiaKQ_PD Then
- If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
- ChaKanJB.Open "select ygid,ygname from manrecord", MySQL, adOpenKeyset, adLockPessimistic
- YGbianhao_KQ.Clear
- Do While Not ChaKanJB.EOF
- YGbianhao_KQ.AddItem ChaKanJB.Fields(0)
- ChaKanJB.MoveNext
- Loop
- XiuGaiKQ.Caption = "添加员工考勤信息"
- QueDing_KQ.Caption = "添 加"
- QuXiao_KQ.Visible = False
- QueDing_KQ.Left = 2760
- ElseIf XiuGaiKQ_PD Then
- XiuGaiKQ.Caption = "修改员工考勤信息"
- QueDing_KQ.Caption = "修 改"
- Next_KQ.Visible = True
- Shang_KQ.Visible = True
- TiaoShu_KQ.Visible = True
- Label11.Visible = True
- Label9.Visible = True
- TextFuZhi_KQ
- ElseIf ShanChuKQ_PD Then
- XiuGaiKQ.Caption = "删除员工考勤信息"
- QueDing_KQ.Caption = "删 除"
- Next_KQ.Visible = True
- Shang_KQ.Visible = True
- TiaoShu_KQ.Visible = True
- Label11.Visible = True
- Label9.Visible = True
- TextFuZhi_KQ
- End If
- End Sub
- Private Sub Next_KQ_Click()
- KQbiaoCZ.MoveNext
- If KQbiaoCZ.EOF Then KQbiaoCZ.MovePrevious
- ' KQbiaoCZ.MoveLast
- ' TextFuZhi_KQ
- TextFuZhi_KQ
- End Sub
- Private Sub QueDing_KQ_Click()
- If QueDing_KQ.Caption = "添 加" Then
- CaoZuo_KQ = MsgBox("确定添加此条记录么?", 51, "公司员工管理系统")
- If CaoZuo_KQ = 6 Then
- If YGbianhao_KQ.Text = "" Or KQleixing.Text = "" Or texNian_KQ.Text = "" Or texYue_KQ.Text = "" Or texRi_KQ.Text = "" Then
- MsgBox "员工编号、考勤结果、考勤时间均为考勤信息的基本项目!不能为空!", 48, "公司员工管理系统"
- YGbianhao_KQ.SetFocus
- YGbianhao_KQ.SelStart = 0
- YGbianhao_KQ.SelLength = Len(YGbianhao_KQ)
- Else
- ' If LShbiao_KQ.State = adstaeopen Then LShbiao_KQ.Close
- ' If KQbiaoCZ.State = adStateOpen Then KQbiaoCZ.Close
- ' KQbiaoCZ.Open ""
- ' If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
- ' ChaKanJB.Open "select * from manrecord where ygid='" & YGbianhao_KQ & "'", MySQL, adOpenKeyset, adLockPessimistic
- ' If ChaKanJB.RecordCount = 0 Then
- ' MsgBox "没有此编号员工的基本信息!请先添加员工基本信息!", 48, "公司员工管理系统"
- ' Exit Sub
- ' Else
- KQbiaoCZ.AddNew
- KQbiaoCZ.Fields(0) = Trim(YGbianhao_KQ.Text)
- KQbiaoCZ.Fields(1) = Trim(KQleixing.Text)
- KQbiaoCZ.Fields(2) = Trim(texNian_KQ.Text) & "-" & Trim(texYue_KQ.Text) & "-" & Trim(texRi_KQ.Text)
- KQbiaoCZ.Fields(3) = Trim(KQbeizhu)
- KQbiaoCZ.Update
- MsgBox "添加成功!", , "恭喜!^_^"
- YGbianhao_KQ.Text = ""
- XingMing_KQ = ""
- BuMen_KQ = ""
- KQleixing.Text = ""
- ' exNian_KQ.Text = ""
- KQbeizhu = ""
- ' End If
- End If
- End If
- ElseIf QueDing_KQ.Caption = "修 改" Then
- CaoZuo_KQ = MsgBox("确定修改么?", 51, "公司员工管理系统")
- If CaoZuo_KQ = 6 Then
- If YGbianhao_KQ.Text = "" Or KQleixing.Text = "" Or texNian_KQ.Text = "" Or texYue_KQ.Text = "" Or texRi_KQ.Text = "" Then
- MsgBox "员工编号、考勤结果、考勤时间均为考勤信息的基本项目!不能为空!", 48, "公司员工管理系统"
- YGbianhao_KQ.SetFocus
- YGbianhao_KQ.SelStart = 0
- YGbianhao_KQ.SelLength = Len(YGbianhao_KQ)
- Else
- KQbiaoCZ.Fields(0) = Trim(YGbianhao_KQ.Text)
- KQbiaoCZ.Fields(1) = Trim(KQleixing.Text)
- KQbiaoCZ.Fields(2) = Trim(texNian_KQ.Text) & "-" & Trim(texYue_KQ.Text) & "-" & Trim(texRi_KQ.Text)
- KQbiaoCZ.Fields(3) = Trim(KQbeizhu)
- KQbiaoCZ.Update
- MsgBox "修改成功!", , "恭喜!^_^"
- End If
- End If
- ElseIf QueDing_KQ.Caption = "删 除" Then
- CaoZuo_KQ = MsgBox("确定要删除此条记录么?", 51, "公司员工管理系统")
- If CaoZuo_KQ = 6 Then
- KQbiaoCZ.Delete
- KQbiaoCZ.MoveNext
- If KQbiaoCZ.EOF Then KQbiaoCZ.MovePrevious
- TextFuZhi_KQ
- End If
- End If
- End Sub
- Private Sub QuXiao_KQ_Click()
- Unload Me
- End Sub
- Private Sub Shang_KQ_Click()
- KQbiaoCZ.MovePrevious
- If KQbiaoCZ.BOF Then KQbiaoCZ.MoveNext
- ' KQbiaoCZ.MoveFirst
- ' TextFuZhi_KQ
- TextFuZhi_KQ
- End Sub
- Private Sub YGbianhao_KQ_Click()
- If TianJiaKQ_PD Then
- If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
- ChaKanJB.Open "select ygname from manrecord where ygid='" & YGbianhao_KQ & "'", MySQL, adOpenKeyset, adLockPessimistic
- XingMing_KQ = IIf(ChaKanJB.Fields(0) = Null, "", ChaKanJB.Fields(0))
- If GZbiaoCZ.State = adStateOpen Then GZbiaoCZ.Close
- GZbiaoCZ.Open "select wdept from manappraise where wid='" & YGbianhao_KQ & "'", MySQL, adOpenKeyset, adLockPessimistic
- If GZbiaoCZ.RecordCount <> 0 Then
- BuMen_KQ = IIf(GZbiaoCZ.Fields(0) = Null, "", GZbiaoCZ.Fields(0))
- Else
- MsgBox "此编号员工没有相应的工作信息!请及时向管理员反映!", 48, "公司员工管理系统"
- BuMen_KQ = ""
- End If
- Else
- If KQbiaoCZ.State = adStateOpen Then KQbiaoCZ.Close
- KQbiaoCZ.Open "select * from checkin where kqid='" & YGbianhao_KQ & "'", MySQL, adOpenKeyset, adLockPessimistic
- TextFuZhi_KQ
- End If
- End Sub
- Private Sub YGbianhao_KQ_LostFocus()
- If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
- ChaKanJB.Open "select ygname from manrecord where ygid='" & YGbianhao_KQ & "'", MySQL, adOpenKeyset, adLockPessimistic
- If ChaKanJB.RecordCount = 0 Then
- MsgBox "没有此编号员工的基本信息!请先添加员工基本信息!", 48, "公司员工管理系统"
- YGbianhao_KQ.SetFocus
- YGbianhao_KQ.SelStart = 0
- YGbianhao_KQ.SelLength = Len(YGbianhao_KQ)
- ' Exit Sub
- Else
- XingMing_KQ = IIf(ChaKanJB.Fields(0) = Null, "", ChaKanJB.Fields(0))
- End If
- If GZbiaoCZ.State = adStateOpen Then GZbiaoCZ.Close
- GZbiaoCZ.Open "select wdept from manappraise where wid='" & YGbianhao_KQ & "'", MySQL, adOpenKeyset, adLockPessimistic
- If GZbiaoCZ.RecordCount <> 0 Then
- BuMen_KQ = IIf(GZbiaoCZ.Fields(0) = Null, "", GZbiaoCZ.Fields(0))
- Else
- MsgBox "此编号员工没有相应的工作信息!请及时向管理员反映!", 48, "公司员工管理系统"
- BuMen_KQ = ""
- End If
- End Sub