Form1.frm
资源名称:20080403.rar [点击查看]
上传用户:linhua1013
上传日期:2014-12-05
资源大小:375k
文件大小:19k
源码类别:
SQL Server
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form GongZuoXinXi
- Caption = "Form1"
- ClientHeight = 5460
- ClientLeft = 60
- ClientTop = 450
- ClientWidth = 5835
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MDIChild = -1 'True
- ScaleHeight = 5460
- ScaleWidth = 5835
- Begin VB.CommandButton QuXiao_GZ
- Caption = "取 消"
- Height = 375
- Left = 3720
- TabIndex = 23
- Top = 4920
- Width = 975
- End
- Begin VB.CommandButton QueDing_GZ
- Caption = "添 加"
- Height = 375
- Left = 1200
- TabIndex = 22
- Top = 4920
- Width = 975
- End
- Begin VB.PictureBox Picture1
- Height = 4695
- Left = 120
- ScaleHeight = 4635
- ScaleWidth = 5535
- TabIndex = 5
- Top = 120
- Width = 5600
- Begin VB.PictureBox Picture2
- Height = 2895
- Left = 120
- ScaleHeight = 2835
- ScaleWidth = 5235
- TabIndex = 7
- Top = 1320
- Width = 5295
- Begin VB.Frame Frame2
- Caption = "工作信息"
- Height = 2655
- Left = 120
- TabIndex = 8
- Top = 120
- Width = 5000
- Begin VB.TextBox Text_GZ
- Height = 975
- Index = 4
- Left = 240
- ScrollBars = 2 'Vertical
- TabIndex = 21
- Top = 1560
- Width = 4455
- End
- Begin VB.ComboBox textNian_GZ
- Height = 300
- ItemData = "Form1.frx":0000
- Left = 1080
- List = "Form1.frx":0002
- TabIndex = 16
- Text = "1990"
- Top = 720
- Width = 975
- End
- Begin VB.ComboBox textYue_GZ
- Height = 300
- Left = 2400
- TabIndex = 15
- Text = "1"
- Top = 720
- Width = 735
- End
- Begin VB.ComboBox textRi_GZ
- Height = 300
- Left = 3480
- TabIndex = 14
- Text = "1"
- Top = 720
- Width = 735
- End
- Begin VB.TextBox Text_GZ
- Height = 270
- Index = 2
- Left = 3600
- TabIndex = 12
- Top = 360
- Width = 1095
- End
- Begin VB.TextBox Text_GZ
- Height = 270
- Index = 1
- Left = 1080
- TabIndex = 10
- Top = 330
- Width = 1095
- End
- Begin VB.Label Label15
- AutoSize = -1 'True
- Caption = "*"
- ForeColor = &H008080FF&
- Height = 180
- Left = 4800
- TabIndex = 33
- Top = 360
- Width = 90
- End
- Begin VB.Label Label11
- AutoSize = -1 'True
- Caption = "*"
- ForeColor = &H008080FF&
- Height = 180
- Left = 4680
- TabIndex = 29
- Top = 765
- Width = 90
- End
- Begin VB.Label Label9
- AutoSize = -1 'True
- Caption = "*"
- ForeColor = &H008080FF&
- Height = 180
- Left = 2280
- TabIndex = 28
- Top = 360
- Width = 90
- End
- Begin VB.Label Label8
- AutoSize = -1 'True
- Caption = "工作评价:"
- Height = 180
- Left = 120
- TabIndex = 20
- Top = 1320
- Width = 900
- End
- Begin VB.Label Label16
- AutoSize = -1 'True
- Caption = "年"
- Height = 180
- Left = 2160
- TabIndex = 19
- Top = 780
- Width = 180
- End
- Begin VB.Label Label17
- AutoSize = -1 'True
- Caption = "月"
- Height = 180
- Left = 3240
- TabIndex = 18
- Top = 765
- Width = 180
- End
- Begin VB.Label Label20
- AutoSize = -1 'True
- Caption = "日"
- Height = 180
- Left = 4320
- TabIndex = 17
- Top = 765
- Width = 180
- End
- Begin VB.Label Label7
- AutoSize = -1 'True
- Caption = "工作时间:"
- Height = 180
- Left = 120
- TabIndex = 13
- Top = 840
- Width = 900
- End
- Begin VB.Label Label6
- AutoSize = -1 'True
- Caption = "工作职位:"
- Height = 180
- Left = 2640
- TabIndex = 11
- Top = 390
- Width = 900
- End
- Begin VB.Label Label5
- AutoSize = -1 'True
- Caption = "工作部门:"
- Height = 180
- Left = 120
- TabIndex = 9
- Top = 360
- Width = 900
- End
- End
- End
- Begin VB.Frame Frame1
- Caption = "基本信息"
- Height = 1095
- Left = 120
- TabIndex = 4
- Top = 120
- Width = 5295
- Begin VB.TextBox ChuSheng_GZ
- BackColor = &H80000011&
- Enabled = 0 'False
- Height = 270
- Left = 3480
- TabIndex = 27
- Top = 600
- Width = 1695
- End
- Begin VB.TextBox XingBie_GZ
- BackColor = &H80000011&
- Enabled = 0 'False
- Height = 270
- Left = 1200
- TabIndex = 25
- Top = 600
- Width = 735
- End
- Begin VB.ComboBox YGbianhao_GZ
- Height = 300
- Left = 1200
- TabIndex = 3
- Top = 200
- Width = 1455
- End
- Begin VB.TextBox XingMing_GZ
- BackColor = &H80000011&
- Enabled = 0 'False
- Height = 270
- Left = 4080
- TabIndex = 2
- Top = 200
- Width = 1095
- End
- Begin VB.Label Label4
- AutoSize = -1 'True
- Caption = "出生年月:"
- Height = 180
- Left = 2400
- TabIndex = 26
- Top = 640
- Width = 900
- End
- Begin VB.Label Label10
- AutoSize = -1 'True
- Caption = "*"
- ForeColor = &H008080FF&
- Height = 180
- Left = 2760
- TabIndex = 24
- Top = 240
- Width = 90
- End
- Begin VB.Label Label3
- AutoSize = -1 'True
- Caption = "性别:"
- Height = 180
- Left = 480
- TabIndex = 6
- Top = 640
- Width = 540
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- Caption = "员工姓名:"
- Height = 180
- Left = 3120
- TabIndex = 0
- Top = 240
- Width = 900
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "员工编号:"
- Height = 180
- Left = 120
- TabIndex = 1
- Top = 240
- Width = 900
- End
- End
- Begin VB.Label Label14
- AutoSize = -1 'True
- Caption = "!相应的个人信息可以到员工基本信息处修改!"
- Height = 180
- Left = 240
- TabIndex = 32
- Top = 4320
- Width = 3780
- End
- Begin VB.Label Label13
- AutoSize = -1 'True
- Caption = "为必填项"
- Height = 180
- Left = 4560
- TabIndex = 31
- Top = 4320
- Width = 720
- End
- Begin VB.Label Label12
- AutoSize = -1 'True
- Caption = "*"
- ForeColor = &H008080FF&
- Height = 180
- Left = 4320
- TabIndex = 30
- Top = 4320
- Width = 90
- End
- End
- End
- Attribute VB_Name = "GongZuoXinXi"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim NianShu_GZ As Integer
- Dim YueShu_GZ As Integer
- Dim RiShu_GZ As Integer
- Dim LieShu_GZ As Integer
- 'Dim ShJzancun_GZ As String
- 'Dim ShJquzhi_GZ As Integer
- Dim QDShu As Integer
- Private Sub Form_Load()
- Me.Height = 5970
- Me.Width = 5940
- NianShu_GZ = 1980
- Do While NianShu_GZ < 2006
- textNian_GZ.AddItem NianShu_GZ
- NianShu_GZ = NianShu_GZ + 1
- Loop
- For YueShu_GZ = 1 To 12
- textYue_GZ.AddItem YueShu_GZ
- Next YueShu_GZ
- For RiShu_GZ = 1 To 31
- textRi_GZ.AddItem RiShu_GZ
- Next RiShu_GZ
- If GZbiaoCZ.State = adStateOpen Then GZbiaoCZ.Close
- GZbiaoCZ.CursorLocation = adUseClient
- GZbiaoCZ.Open "select * from manappraise", MySQL, adOpenKeyset, adLockPessimistic
- Do While Not GZbiaoCZ.EOF
- YGbianhao_GZ.AddItem GZbiaoCZ.Fields(0)
- GZbiaoCZ.MoveNext
- Loop
- GZbiaoCZ.MoveFirst
- If ChakanGZ_PD Then
- ' BianHaoFuZhi (GZbiaoCZ)
- GongZuoXinXi.Caption = "查看员工工作信息"
- QueDing_GZ.Visible = False
- QuXiao_GZ.Left = 2400
- textFuZhi_GZ
- ElseIf XiuGaiGZ_PD Then
- ' BianHaoFuZhi (GZbiaoCZ)
- GongZuoXinXi.Caption = "修改员工工作信息"
- QueDing_GZ.Caption = "修 改"
- textFuZhi_GZ
- ElseIf ShanChuGZ_PD Then
- GongZuoXinXi.Caption = "删除员工工作信息"
- QueDing_GZ.Caption = "删 除"
- textFuZhi_GZ
- ElseIf TianJiaGZ_PD Then
- If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
- ChaKanJB.Open "select ygid,ygname,ygsex from manrecord", MySQL, adOpenKeyset, adLockPessimistic
- ' BianHaoFuZhi (ChaKanJB)
- YGbianhao_GZ.Clear
- Do While Not ChaKanJB.EOF
- YGbianhao_GZ.AddItem ChaKanJB.Fields(0)
- ChaKanJB.MoveNext
- Loop
- ChaKanJB.MoveFirst
- GongZuoXinXi.Caption = "添加员工工作信息"
- QueDing_GZ.Caption = "添 加"
- End If
- End Sub
- Sub textFuZhi_GZ()
- For LieShu_GZ = 1 To 4
- If LieShu_GZ = 3 Then
- Else
- If GZbiaoCZ.Fields(LieShu_GZ) <> "" Then
- Text_GZ(LieShu_GZ) = GZbiaoCZ.Fields(LieShu_GZ)
- Else
- Text_GZ(LieShu_GZ) = ""
- End If
- End If
- Next LieShu_GZ
- YGbianhao_GZ.Text = GZbiaoCZ.Fields(0)
- JiBen_GZ (Trim(YGbianhao_GZ))
- ' Xingie_GZ.Text = GZbiaoCZ.Fields(2)
- RiQiFuZhi (GZbiaoCZ.Fields(3))
- textNian_GZ.Text = Nian
- textYue_GZ.Text = Yue
- RiFuZhi
- textRi_GZ.Text = Ri
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Set ChaKanJB = Nothing
- Set GZbiaoCZ = Nothing
- End Sub
- Private Sub QueDing_GZ_Click()
- If QueDing_GZ.Caption = "修 改" Then
- QDShu = MsgBox("确定修改相关项吗?", 51, "公司员工管理系统")
- If QDShu = 6 Then
- If Text_GZ(1) = "" Or Text_GZ(2) = "" Or textNian_GZ.Text = "" Or textYue_GZ.Text = "" Or textRi_GZ.Text = "" Then
- MsgBox "红星号项目不能为空!", 48, "公司员工管理系统"
- ' If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
- ' ChaKanJB.Open "SELECT ygid,ygname,ygsex from manrecord where ygid='" & YGbianhao_GZ.Text & "'", MySQL, adOpenKeyset, adLockPessimistic
- ' If ChaKanJB.RecordCount = -1 Then
- ' MsgBox "不存在此编号的员工基本信息!请先添加相关的基本信息!", 48, "公司员工管理系统"
- ' ChaKanJB.Close
- ' Set ChaKanJB = Nothing
- ' Exit Sub
- Else
- ' If Text_GZ(1) <> ChaKanJB.Fields(1) Or XingBie_GZ.Text <> ChaKanJB.Fields(2) Or Text_GZ(3) <> ChaKanJB.Fields(3) Then
- ' MsgBox "员工的基本信息与原始基本信息不符!", 48, "公司员工管理系统"
- ' Else
- ShuJuFuZhi
- GZbiaoCZ.Update
- End If
- ' End If
- End If
- ElseIf QueDing_GZ.Caption = "删 除" Then
- QDShu = MsgBox("确定删除此条记录吗?", 51, "公司员工管理系统")
- If QDShu = 6 Then
- GZbiaoCZ.Delete
- ' GZbiaoCZ.Update
- ' GZbiaoCZ.MoveNext
- ' If GZbiaoCZ.EOF Then GZbiaoCZ.MoveFirst
- GZbiaoCZ.Close
- GZbiaoCZ.Open "manappraise", MySQL, adOpenKeyset, adLockPessimistic
- textFuZhi_GZ
- End If
- ElseIf QueDing_GZ.Caption = "添 加" Then
- QDShu = MsgBox("确定添加此条记录吗?", 51, "公司员工管理系统")
- If QDShu = 6 Then
- If Text_GZ(1) = "" Or Text_GZ(2) = "" Or textNian_GZ.Text = "" Or textYue_GZ.Text = "" Or textRi_GZ.Text = "" Then
- MsgBox "红星号项目不能为空!", 48, "公司员工管理系统"
- ' If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
- ' ChaKanJB.Open "SELECT ygid,ygname,ygsex from manrecord where ygid='" & YGbianhao_GZ.Text & "'", MySQL, adOpenKeyset, adLockPessimistic
- ' If ChaKanJB.RecordCount = -1 Then
- ' MsgBox "不存在此编号的员工基本信息!请先添加相关的基本信息!", 48, "公司员工管理系统"
- ' ChaKanJB.Close
- ' Set ChaKanJB = Nothing
- Exit Sub
- Else
- If DengJibiaoCZ.State = adStateOpen Then DengJibiaoCZ.Close
- DengJibiaoCZ.Open "select * from ranking where DJbusi='" & Text_GZ(2) & "'", MySQL, adOpenKeyset, adLockPessimistic
- If DengJibiaoCZ.RecordCount = 0 Then
- MsgBox "职位等级信息不存在!请先添加相关的等级信息!", 48, "公司员工管理系统"
- Exit Sub
- Else
- If GZbiaoCZ.State = adStateOpen Then GZbiaoCZ.Close
- GZbiaoCZ.Open "select * from manappraise where wid='" & YGbianhao_GZ.Text & "'", MySQL, adOpenKeyset, adLockPessimistic
- If GZbiaoCZ.RecordCount <> 0 Then
- MsgBox "已经存在此编号员工的工作信息!" & vbCrLf & "你可以进行修改!", 48, "公司员工管理系统"
- Exit Sub
- End If
- End If
- End If
- GZbiaoCZ.AddNew
- ShuJuFuZhi
- GZbiaoCZ.Update
- End If
- End If
- End Sub
- Private Sub QuXiao_GZ_Click()
- Unload Me
- End Sub
- Private Sub textNian_GZ_Click()
- RiShu = RiJS(Trim(Val(textNian_GZ)), Trim(Val(textYue_GZ)))
- RiFuZhi
- End Sub
- Sub RiFuZhi()
- textRi_GZ.Clear
- For RiShu_GZ = 1 To RiShu
- textRi_GZ.AddItem RiShu_GZ
- Next RiShu_GZ
- textRi_GZ.Text = Ri
- End Sub
- Private Sub textYue_GZ_Click()
- RiShu = RiJS(Trim(Val(textNian_GZ)), Trim(Val(textYue_GZ)))
- RiFuZhi
- End Sub
- Sub ShuJuFuZhi()
- For LieShu_GZ = 1 To 4
- If LieShu_GZ = 3 Then
- Else
- GZbiaoCZ.Fields(LieShu_GZ) = Text_GZ(LieShu_GZ)
- End If
- Next LieShu_GZ
- ' GZbiaoCZ.Fields(2) = XingBie_GZ.Text
- GZbiaoCZ.Fields(0) = YGbianhao_GZ.Text
- GZbiaoCZ.Fields(3) = textNian_GZ & "-" & textYue_GZ & "-" & textRi_GZ
- End Sub
- 'Sub BianHaoFuZhi(ShuJuBiao As ADODB.Recordset)
- ' YGbianhao_GZ.Clear
- ' Do While Not ShuJuBiao.EOF
- ' YGbianhao_GZ.AddItem ShuJuBiao.Fields(0)
- ' ShuJuBiao.MoveNext
- ' Loop
- ' ShuJuBiao.MoveFirst
- 'End Sub
- Private Sub YGbianhao_GZ_Click()
- If TianJiaGZ_PD Then
- JiBen_GZ (Trim(YGbianhao_GZ))
- Else
- If GZbiaoCZ.State = adStateOpen Then GZbiaoCZ.Close
- GZbiaoCZ.Open "SELECT * from manappraise where wid='" & YGbianhao_GZ.Text & "'", MySQL, adOpenKeyset, adLockPessimistic
- textFuZhi_GZ
- End If
- End Sub
- Sub JiBen_GZ(ChZhbianhao As String)
- ' Dim ChZhstr As String
- If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
- ' ChZhstr = "select ygname,ygsex,ygbirthday from manrecord where ygid=" & ChZhbianhao
- ChaKanJB.Open "select ygname,ygsex,ygbirthday from manrecord where ygid=" & ChZhbianhao, MySQL, adOpenKeyset, adLockPessimistic
- XingMing_GZ = ChaKanJB.Fields(0)
- XingBie_GZ = ChaKanJB.Fields(1)
- ChuSheng_GZ = ChaKanJB.Fields(2)
- End Sub
- Private Sub YGbianhao_GZ_LostFocus()
- If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
- ChaKanJB.Open "select ygname,ygsex,ygbirthday from manrecord where ygid='" & YGbianhao_GZ & "'", MySQL, adOpenKeyset, adLockPessimistic
- If ChaKanJB.RecordCount = 0 Then
- MsgBox "没有此编号员工基本信息!请先添加员工基本信息!", 48, "公司员工管理系统"
- Else
- JiBen_GZ (Trim(YGbianhao_GZ))
- End If
- End Sub