xiugaiXX.frm
资源名称:20080403.rar [点击查看]
上传用户:linhua1013
上传日期:2014-12-05
资源大小:375k
文件大小:25k
源码类别:
SQL Server
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form xiugaiXX
- Caption = "修改基本信息"
- ClientHeight = 5730
- ClientLeft = 60
- ClientTop = 450
- ClientWidth = 5895
- LinkTopic = "Form1"
- MDIChild = -1 'True
- ScaleHeight = 5730
- ScaleWidth = 5895
- Begin VB.CommandButton FangHui
- Caption = "返 回"
- Height = 375
- Left = 3120
- TabIndex = 36
- Top = 5160
- Width = 975
- End
- Begin VB.CommandButton XiuGai
- Caption = "修 改"
- Height = 375
- Left = 1920
- TabIndex = 35
- Top = 5160
- Width = 975
- End
- Begin VB.CommandButton XiaYW
- Caption = "下 一 位"
- Height = 375
- Left = 4560
- TabIndex = 34
- Top = 5160
- Width = 975
- End
- Begin VB.CommandButton ShangYW
- Caption = "上 一 位"
- Height = 375
- Left = 360
- TabIndex = 33
- Top = 5160
- Width = 975
- End
- Begin VB.Frame Frame1
- Height = 4935
- Left = 240
- TabIndex = 0
- Top = 120
- Width = 5415
- Begin VB.PictureBox Picture2
- Height = 1695
- Left = 120
- ScaleHeight = 1635
- ScaleWidth = 5115
- TabIndex = 15
- Top = 2880
- Width = 5175
- Begin VB.ComboBox XGriJ
- Height = 300
- Left = 3840
- TabIndex = 37
- Text = "1"
- Top = 1150
- Width = 735
- End
- Begin VB.ComboBox XGyueJ
- Height = 300
- Left = 2760
- TabIndex = 31
- Text = "1"
- Top = 1150
- Width = 735
- End
- Begin VB.ComboBox XGnianJ
- Height = 300
- ItemData = "xiugaiXX.frx":0000
- Left = 1440
- List = "xiugaiXX.frx":0002
- TabIndex = 29
- Text = "1990"
- Top = 1150
- Width = 975
- End
- Begin VB.ComboBox XGxueli
- Height = 300
- ItemData = "xiugaiXX.frx":0004
- Left = 1200
- List = "xiugaiXX.frx":0026
- TabIndex = 21
- Text = "本科"
- Top = 680
- Width = 1215
- End
- Begin VB.TextBox XGzhuanye
- Height = 270
- Left = 3240
- TabIndex = 20
- Top = 680
- Width = 1575
- End
- Begin VB.TextBox XGbiye
- Height = 270
- Left = 1320
- TabIndex = 17
- Top = 200
- Width = 3495
- End
- Begin VB.Label Label20
- AutoSize = -1 'True
- Caption = "日"
- Height = 180
- Left = 4680
- TabIndex = 38
- Top = 1200
- Width = 180
- End
- Begin VB.Label Label17
- AutoSize = -1 'True
- Caption = "月"
- Height = 180
- Left = 3600
- TabIndex = 32
- Top = 1200
- Width = 180
- End
- Begin VB.Label Label16
- AutoSize = -1 'True
- Caption = "年"
- Height = 180
- Left = 2520
- TabIndex = 30
- Top = 1215
- Width = 180
- End
- Begin VB.Label Label12
- AutoSize = -1 'True
- Caption = "进入公司时间:"
- Height = 180
- Left = 120
- TabIndex = 22
- Top = 1200
- Width = 1260
- End
- Begin VB.Label Label11
- AutoSize = -1 'True
- Caption = "专 业:"
- Height = 180
- Left = 2520
- TabIndex = 19
- Top = 720
- Width = 630
- End
- Begin VB.Label Label10
- AutoSize = -1 'True
- Caption = "学 历:"
- Height = 180
- Left = 360
- TabIndex = 18
- Top = 720
- Width = 630
- End
- Begin VB.Label Label9
- Caption = "毕业院校:"
- Height = 255
- Left = 240
- TabIndex = 16
- Top = 240
- Width = 975
- End
- End
- Begin VB.PictureBox Picture1
- Height = 2055
- Left = 120
- ScaleHeight = 1995
- ScaleWidth = 5115
- TabIndex = 5
- Top = 600
- Width = 5175
- Begin VB.ComboBox XGriCH
- Height = 300
- Left = 3650
- TabIndex = 27
- Text = "1"
- Top = 690
- Width = 735
- End
- Begin VB.ComboBox XGyueCH
- Height = 300
- Left = 2640
- TabIndex = 25
- Text = "1"
- Top = 690
- Width = 735
- End
- Begin VB.ComboBox XGnianCH
- Height = 300
- ItemData = "xiugaiXX.frx":006E
- Left = 1320
- List = "xiugaiXX.frx":0070
- TabIndex = 23
- Text = "1930"
- Top = 690
- Width = 975
- End
- Begin VB.ComboBox XGxingbie
- Height = 300
- ItemData = "xiugaiXX.frx":0072
- Left = 1080
- List = "xiugaiXX.frx":007C
- TabIndex = 14
- Text = "男"
- Top = 195
- Width = 735
- End
- Begin VB.TextBox XGjiguan
- Height = 270
- Left = 1080
- TabIndex = 13
- Top = 1560
- Width = 3735
- End
- Begin VB.TextBox XGzhuzhi
- Height = 270
- Left = 1320
- TabIndex = 11
- Top = 1155
- Width = 3495
- End
- Begin VB.TextBox XGdianhua
- Height = 270
- Left = 3000
- MaxLength = 13
- TabIndex = 9
- Top = 240
- Width = 1695
- End
- Begin VB.Label Label24
- AutoSize = -1 'True
- Caption = "*"
- ForeColor = &H008080FF&
- Height = 180
- Left = 4800
- TabIndex = 45
- Top = 240
- Width = 90
- End
- Begin VB.Label Label21
- AutoSize = -1 'True
- Caption = "*"
- ForeColor = &H008080FF&
- Height = 180
- Left = 4800
- TabIndex = 42
- Top = 720
- Width = 90
- End
- Begin VB.Label Label19
- AutoSize = -1 'True
- Caption = "*"
- ForeColor = &H008080FF&
- Height = 180
- Left = 1920
- TabIndex = 41
- Top = 240
- Width = 90
- End
- Begin VB.Label Label15
- AutoSize = -1 'True
- Caption = "日"
- Height = 180
- Left = 4440
- TabIndex = 28
- Top = 765
- Width = 180
- End
- Begin VB.Label Label14
- AutoSize = -1 'True
- Caption = "月"
- Height = 180
- Left = 3380
- TabIndex = 26
- Top = 750
- Width = 180
- End
- Begin VB.Label Label13
- AutoSize = -1 'True
- Caption = "年"
- Height = 180
- Left = 2330
- TabIndex = 24
- Top = 750
- Width = 180
- End
- Begin VB.Label Label8
- AutoSize = -1 'True
- Caption = "籍 贯:"
- Height = 180
- Left = 240
- TabIndex = 12
- Top = 1590
- Width = 630
- End
- Begin VB.Label Label7
- AutoSize = -1 'True
- Caption = "家庭住址:"
- Height = 180
- Left = 240
- TabIndex = 10
- Top = 1200
- Width = 900
- End
- Begin VB.Label Label6
- AutoSize = -1 'True
- Caption = "电 话:"
- Height = 180
- Left = 2280
- TabIndex = 8
- Top = 270
- Width = 630
- End
- Begin VB.Label Label5
- AutoSize = -1 'True
- Caption = "出生年月:"
- Height = 180
- Left = 240
- TabIndex = 7
- Top = 720
- Width = 900
- End
- Begin VB.Label Label3
- AutoSize = -1 'True
- Caption = "性 别:"
- Height = 180
- Left = 240
- TabIndex = 6
- Top = 240
- Width = 630
- End
- End
- Begin VB.TextBox XGxingming
- Height = 270
- Left = 3840
- TabIndex = 4
- Top = 260
- Width = 1215
- End
- Begin VB.TextBox XGbianhao
- Height = 270
- Left = 1200
- MaxLength = 10
- TabIndex = 2
- Top = 240
- Width = 1215
- End
- Begin VB.Label Label23
- AutoSize = -1 'True
- Caption = "为必填项"
- Height = 180
- Left = 4440
- TabIndex = 44
- Top = 4680
- Width = 720
- End
- Begin VB.Label Label22
- AutoSize = -1 'True
- Caption = "*"
- ForeColor = &H008080FF&
- Height = 180
- Left = 4320
- TabIndex = 43
- Top = 4680
- Width = 90
- End
- Begin VB.Label Label18
- AutoSize = -1 'True
- Caption = "*"
- ForeColor = &H008080FF&
- Height = 180
- Left = 5160
- TabIndex = 40
- Top = 280
- Width = 90
- End
- Begin VB.Label Label4
- AutoSize = -1 'True
- Caption = "*"
- ForeColor = &H008080FF&
- Height = 180
- Left = 2520
- TabIndex = 39
- Top = 280
- Width = 90
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- Caption = "员工姓名:"
- Height = 180
- Left = 2760
- TabIndex = 3
- Top = 300
- Width = 900
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "员工编号:"
- Height = 180
- Left = 120
- TabIndex = 1
- Top = 300
- Width = 900
- End
- End
- End
- Attribute VB_Name = "xiugaiXX"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim ZJRriqi As String
- Dim ZChShriqi As String
- Dim JRriqi As String
- Dim ChShriqi As String
- Dim PDJRriqiN As Boolean
- Dim PDChShriqiN As Boolean
- Dim NianChSh As Integer
- Dim NianJR As Integer
- Dim YueShu As Integer
- 'Dim Ri As Integer
- Dim RiShu_XX As Integer
- Dim MyBook As Variant
- Dim LShbiao As New ADODB.Recordset
- Private Sub FangHui_Click()
- Unload Me
- End Sub
- Private Sub Form_Load()
- Me.Width = 6015
- Me.Height = 6645
- NianChSh = 1930
- NianJR = 1990
- Do While NianChSh < 1989
- XGnianCH.AddItem NianChSh
- NianChSh = NianChSh + 1
- Loop
- Do While NianJR < 2006
- XGnianJ.AddItem NianJR
- NianJR = NianJR + 1
- Loop
- For YueShu = 1 To 12
- XGyueCH.AddItem YueShu
- XGyueJ.AddItem YueShu
- Next YueShu
- For RiShu_XX = 1 To 31
- XGriCH.AddItem RiShu_XX
- XGriJ.AddItem RiShu_XX
- Next RiShu_XX
- If XiuGaiJB.State = adStateOpen Then XiuGaiJB.Close
- XiuGaiJB.Open "select * from manrecord", MySQL, adOpenKeyset, adLockPessimistic
- If TianJiaJB Then
- xiugaiXX.Caption = "添加基本信息"
- XiuGai.Caption = "添 加"
- ElseIf XiuGaiJB_PD Then
- xiugaiXX.Caption = "修改基本信息"
- XiuGai.Caption = "修 改"
- TextFuZhi
- ElseIf ShanChuJB Then
- xiugaiXX.Caption = "删除基本信息"
- XiuGai.Caption = "删 除"
- TextFuZhi
- End If
- ' MyBook = XiuGaiJB.Bookmark
- End Sub
- Sub TextFuZhi()
- ' On Error GoTo FZhcuowu
- ' On Error Resume Next
- If XiuGaiJB.Fields(0) <> "" Then
- XGbianhao.Text = XiuGaiJB.Fields(0).Value
- Else
- XGbianhao.Text = ""
- End If
- If XiuGaiJB.Fields(1) <> "" Then
- XGxingming.Text = XiuGaiJB.Fields(1).Value
- Else
- XGxingming.Text = ""
- End If
- ' If XiuGaiJB.Fields(2) <> "" Then
- ' XGbumen.Text = XiuGaiJB.Fields(2).Value
- ' Else
- ' XGbumen.Text = ""
- ' End If
- ' If XiuGaiJB.Fields(3) <> "" Then
- ' XGzhicheng.Text = XiuGaiJB.Fields(3).Value
- ' Else
- ' XGzhicheng.Text = ""
- ' End If
- If XiuGaiJB.Fields(3) <> "" Then
- XGxingbie.Text = XiuGaiJB.Fields(3).Value
- Else
- XGxingbie.Text = ""
- End If
- ' If XiuGaiJB.Fields(4) <> "" Then
- ' XGnianling.Text = XiuGaiJB.Fields(4).Value
- ' Else
- ' XGnianling.Text = ""
- ' End If
- If XiuGaiJB.Fields(5) <> "" Then
- XGzhuzhi.Text = XiuGaiJB.Fields(5).Value
- Else
- XGzhuzhi.Text = ""
- End If
- If XiuGaiJB.Fields(6) <> "" Then
- XGdianhua.Text = XiuGaiJB.Fields(6).Value
- Else
- XGdianhua.Text = ""
- End If
- If XiuGaiJB.Fields(7) <> "" Then
- XGbiye.Text = XiuGaiJB.Fields(7).Value
- Else
- XGbiye.Text = ""
- End If
- If XiuGaiJB.Fields(8) <> "" Then
- XGxueli.Text = XiuGaiJB.Fields(8).Value
- Else
- XGxueli.Text = ""
- End If
- If XiuGaiJB.Fields(9) <> "" Then
- XGzhuanye.Text = XiuGaiJB.Fields(9).Value
- Else
- XGzhuanye.Text = ""
- End If
- If XiuGaiJB.Fields(10) <> "" Then
- XGjiguan.Text = XiuGaiJB.Fields(10).Value
- Else
- XGjiguan.Text = ""
- End If
- If XiuGaiJB.Fields(2) <> "" Then
- ' For a = 1 To Len(XiuGaiJB.Fields(4)) + 1
- ' ZJRriqi = Mid(XiuGaiJB.Fields(4), a, 1)
- ' If ZJRriqi = "-" Then
- ' If PDJRriqiN Then
- ' XGyueJ.Text = JRriqi
- ' JRriqi = ""
- ' PDJRriqiN = False
- ' Else
- ' XGnianJ.Text = JRriqi
- ' JRriqi = ""
- ' PDJRriqiN = True
- ' End If
- ' ElseIf ZJRriqi = "" Then
- ' RiShu_XX = RiJS(Trim(XGnianJ), Trim(XGyueJ))
- ' XGriJ.Clear
- ' For Ri = 1 To RiShu_XX
- ' XGriJ.AddItem Ri
- ' Next Ri
- ' XGriJ.Text = JRriqi
- ' JRriqi = ""
- ' Else
- ' JRriqi = JRriqi & ZJRriqi
- ' End If
- ' Next a
- RiQiFuZhi (Trim(Str(XiuGaiJB.Fields(2))))
- XGnianJ.Text = Nian
- XGyueJ.Text = Yue
- XGriJ.Clear
- For RiShu_XX = 1 To RiShu
- XGriJ.AddItem RiShu_XX
- Next RiShu_XX
- XGriJ.Text = Ri
- End If
- If XiuGaiJB.Fields(4) <> "" Then
- ' For b = 1 To Len(XiuGaiJB.Fields(7)) + 1
- ' ZChShriqi = Mid(XiuGaiJB.Fields(7), b, 1)
- ' If ZChShriqi = "-" Then
- ' If PDChShriqiN Then
- ' XGyueCH.Text = ChShriqi
- ' ChShriqi = ""
- ' PDChShriqiN = False
- ' Else
- ' XGnianCH.Text = ChShriqi
- ' ChShriqi = ""
- ' PDChShriqiN = True
- ' End If
- ' ElseIf ZChShriqi = "" Then
- ' RiShu_XX = RiJS(Trim(XGnianCH), Trim(XGyueCH))
- ' XGriCH.Clear
- ' For Ri = 1 To RiShu_XX
- ' XGriCH.AddItem Ri
- ' Next Ri
- ' XGriCH.Text = ChShriqi
- ' ChShriqi = ""
- ' Else
- ' ChShriqi = ChShriqi & ZChShriqi
- ' End If
- ' Next b
- RiQiFuZhi (Trim(Str(XiuGaiJB.Fields(4))))
- XGnianCH.Text = Nian
- XGyueCH.Text = Yue
- XGriCH.Clear
- For RiShu_XX = 1 To RiShu
- XGriCH.AddItem RiShu_XX
- Next RiShu_XX
- XGriCH.Text = Ri
- End If
- ' Exit Sub
- 'FZhcuowu:
- ' If Err.Number = 94 Then
- ' Resume Next
- ' Else
- ' MsgBox "抱歉!程序发生未知错误,即将关闭本窗口!请退出后,查看程序目录下的错误日志文件“error.text”,并把错误及时通知作者!谢谢合作!", , "程序错误"
- ' Unload Me
- ' End If
- End Sub
- Private Sub ShangYW_Click()
- XiuGaiJB.MovePrevious
- If XiuGaiJB.BOF Then XiuGaiJB.MoveFirst
- TextFuZhi
- End Sub
- Private Sub XGnianCH_Click()
- RiShu = RiJS(Trim(XGnianCH.Text), Trim(XGyueCH.Text))
- XGriCH.Clear
- For RiShu_XX = 1 To RiShu
- XGriCH.AddItem RiShu_XX
- Next RiShu_XX
- XGriCH = "1"
- End Sub
- Private Sub XGnianJ_Click()
- RiShu = RiJS(Trim(XGnianJ.Text), Trim(XGyueJ.Text))
- XGriJ.Clear
- For RiShu_XX = 1 To RiShu
- XGriJ.AddItem RiShu_XX
- Next RiShu_XX
- XGriJ = "1"
- End Sub
- Private Sub XGyueCH_Click()
- RiShu = RiJS(Trim(XGnianCH.Text), Trim(XGyueCH.Text))
- XGriCH.Clear
- For RiShu_XX = 1 To RiShu
- XGriCH.AddItem RiShu_XX
- Next RiShu_XX
- XGriCH = "1"
- End Sub
- Private Sub XGyueJ_Click()
- RiShu = RiJS(Trim(XGnianJ.Text), Trim(XGyueJ.Text))
- XGriJ.Clear
- For RiShu_XX = 1 To RiShu
- XGriJ.AddItem RiShu_XX
- Next RiShu_XX
- XGriJ = "1"
- End Sub
- Private Sub XiaYW_Click()
- XiuGaiJB.MoveNext
- If XiuGaiJB.EOF Then XiuGaiJB.MoveLast
- TextFuZhi
- End Sub
- Private Sub XiuGai_Click()
- ' On Error GoTo ChaoZuoErr
- If XiuGai.Caption = "修 改" Then
- XG = MsgBox("确定修改么?", 52, "提醒")
- If XG = 6 Then
- If Len(XGbianhao.Text) <> 10 Then
- MsgBox "员工编号为10位数!请检查数据正确性!", 48, "公司员工管理系统"
- Exit Sub
- ' XiuGaiJB.Bookmark = MyBook
- Else
- If XGxingming.Text = "" Then
- MsgBox "员工姓名不能为空!请检查数据正确性!", 48, "公司员工管理系统"
- Exit Sub
- ' XiuGaiJB.Bookmark = MyBook
- Else
- ' JianCha
- If XiuGaiJB.Fields(0) <> XGbianhao Then
- MsgBox "员工编码不能修改!如有需要可以删除此条记录再执行添加!", 48, "公司员工管理系统"
- Exit Sub
- Else
- XiuGaiJB.Fields(0).Value = XGbianhao.Text
- XiuGaiJB.Fields(1).Value = XGxingming.Text
- ' XiuGaiJB.Fields(2).Value = XGbumen.Text
- ' XiuGaiJB.Fields(3).Value = XGzhicheng.Text
- XiuGaiJB.Fields(3).Value = XGxingbie.Text
- ' XiuGaiJB.Fields(4).Value = XGnianling.Text
- XiuGaiJB.Fields(5).Value = XGzhuzhi.Text
- XiuGaiJB.Fields(6).Value = XGdianhua.Text
- XiuGaiJB.Fields(7).Value = XGbiye.Text
- XiuGaiJB.Fields(8).Value = XGxueli.Text
- XiuGaiJB.Fields(9).Value = XGzhuanye.Text
- XiuGaiJB.Fields(10).Value = XGjiguan.Text
- XiuGaiJB.Fields(2).Value = XGnianJ.Text & "-" & XGyueJ.Text & "-" & XGriJ.Text
- XiuGaiJB.Fields(4).Value = XGnianCH.Text & "-" & XGyueCH.Text & "-" & XGriCH.Text
- XiuGaiJB.Update
- ' LShbiao.Close
- ' MsgBox "员工编码为数据表主键!所以此数据不可重复!请检查数据正确性!", 48, "公司人事管理系统"
- ' LShbiao.Close
- ' Exit Sub
- End If
- End If
- End If
- Else
- XiuGaiJB.MoveFirst
- TextFuZhi
- End If
- ElseIf XiuGai.Caption = "添 加" Then
- TJ = MsgBox("确定添加此信息么?", 52, "提示")
- If TJ = 6 Then
- If Len(XGbianhao.Text) <> 10 Then
- MsgBox "员工编号为10位数!请检查数据正确性!", 48, "公司员工管理系统"
- Exit Sub
- Else
- If XGxingming.Text = "" Then
- MsgBox "员工姓名不能为空!请检查数据正确性!", 48, "公司员工管理系统"
- Exit Sub
- Else
- JianCha
- If LShbiao.RecordCount = 0 Then
- XiuGaiJB.AddNew
- XiuGaiJB.Fields(0) = XGbianhao.Text
- XiuGaiJB.Fields(1) = XGxingming.Text
- ' XiuGaiJB.Fields(2).Value = XGbumen.Text
- ' XiuGaiJB.Fields(3).Value = XGzhicheng.Text
- XiuGaiJB.Fields(3) = XGxingbie.Text
- ' XiuGaiJB.Fields(4).Value = XGnianling.Text
- XiuGaiJB.Fields(5) = XGzhuzhi.Text
- XiuGaiJB.Fields(6) = XGdianhua.Text
- XiuGaiJB.Fields(7) = XGbiye.Text
- XiuGaiJB.Fields(8) = XGxueli.Text
- XiuGaiJB.Fields(9) = XGzhuanye.Text
- XiuGaiJB.Fields(10) = XGjiguan.Text
- XiuGaiJB.Fields(2) = XGnianJ.Text & "-" & XGyueJ.Text & "-" & XGriJ.Text
- XiuGaiJB.Fields(4) = XGnianCH.Text & "-" & XGyueCH.Text & "-" & XGriCH.Text
- XiuGaiJB.Update
- LShbiao.Close
- Else
- MsgBox "员工编码为数据表主键!所以此数据不可重复!请检查数据正确性!", 48, "公司人事管理系统"
- LShbiao.Close
- Exit Sub
- End If
- End If
- End If
- End If
- ElseIf XiuGai.Caption = "删 除" Then
- ShCh = MsgBox("确定删除此相关信息么?", 52, "提醒")
- If ShCh = 6 Then
- XiuGaiJB.Delete
- XiuGaiJB.MoveNext
- If XiuGaiJB.EOF Then XiuGaiJB.MoveLast
- TextFuZhi
- Else
- End If
- End If
- ' Exit Sub
- 'ChaoZuoErr:
- ' If Err.Number = -2147217873 Then
- ' MsgBox "员工编码为数据表主键!所以此数据不可重复!请检查数据正确性!", 48, "公司人事管理系统"
- '' XiuGaiJB.Requery
- '' ChongKai
- '' XiuGaiJB.Bookmark = MyBook
- '' XiuGaiJB.Close
- '' XiuGaiJB.Open "select * from manrecord", MySQL, adOpenKeyset, adLockPessimistic
- ' Exit Sub
- ' End If
- End Sub
- 'Sub ChongKai()
- ' XiuGaiJB.Requery
- 'End Sub
- Sub JianCha()
- If LShbiao.State = adStateOpen Then LShbiao.Close
- LShbiao.Open "select * from manrecord where ygid='" & XGbianhao.Text & "'", MySQL, adOpenKeyset, adLockPessimistic
- End Sub