版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、附录: 毕业设计程序清单设计题目 人事管理系统 教 学 班: 学生姓名: 学 号: 指导教师: 完成日期: Option ExplicitDi米 Bupdata As BooleanDi米 i As IntegerPrivate Sub 厘米bdegree_Click() If 厘米bdegree.Text = 定制 Then Fr米Table.Show 厘米bdegree.ListIndex = 0 End If End SubPrivate Sub 厘米bdepart_Click() If 厘米bdepart.Text = 定制 Then Fr米Table.Show 厘米bdepart.L
2、istIndex = 0 End If End SubPrivate Sub 厘米dAddNew_Click() If 厘米dAddNew.Caption = 添加 Then 厘米dAddNew.Caption = 确认 厘米dDel.Enabled = False 厘米dOK.Enabled = False DataA.ReadOnly = False For i = 1 To 12 If Txt(i).Text = Then Txt(i).Text = 0 DataA.Recordset.Fields(i) = 0 Next i DataA.Recordset.AddNew Txt(0).
3、Locked = False If Fr米米ain.cutable = e米ployee Then DataA.Recordset.Fields(13) = fr米Login.E米ploID DataA.Recordset.Fields(14) = Now If Opsex(0) Then DataA.Recordset.Fields(4) = 男 Else DataA.Recordset.Fields(4) = 女 End If DataA.Recordset.Fields(7) = 厘米bdegree.Text DataA.Recordset.Fields(8) = 厘米bdepart.T
4、ext ElseIf Fr米米ain.cutable = leave Then DataA.Recordset.Fields(8) = fr米Login.E米ploID DataA.Recordset.Fields(9) = Now Else DataA.Recordset.Fields(13) = fr米Login.E米ploID DataA.Recordset.Fields(14) = Now End If Txt(0).SetFocus Else OK If Txt(0).Text = Then 米sgBox 不可以为空 Txt(0).SetFocus Exit Sub End If F
5、or i = 1 To 12 If Txt(i).Text = Then Txt(i).Text = 0 DataA.Recordset.Fields(i) = 0 Next i If Fr米米ain.cutable = e米ployee Then DataB.Recordset.FindFirst 职工编号= + Txt(0).Text If Not DataB.Recordset.No米atch Then 米sgBox 职员编号重复 Txt(0).Text = Txt(0).SetFocus Exit Sub End If ElseIf Fr米米ain.cutable = leave Th
6、en DataB.Recordset.FindFirst 假条编号= + Txt(0).Text If Not DataB.Recordset.No米atch Then 米sgBox 假条编号重复 Txt(0).Text = Txt(0).SetFocus Exit Sub End If Else For i = 4 To 10 If Not IsNu米eric(Txt(i).Text) Then 米sgBox not a nu米ber Txt(i).SetFocus Exit Sub End If Next i DataB.Recordset.FindFirst 工资编号= + Txt(0)
7、.Text If Not DataB.Recordset.No米atch Then 米sgBox 工资编号重复 Txt(0).Text = Txt(0).SetFocus Exit Sub End If End If DataA.Recordset.Update DataA.Recordset.米oveLast Fr米米ain.DataA.Refresh Fr米米ain.DataB.Refresh DataB.Refresh 厘米dAddNew.Caption = 添加 厘米dDel.Enabled = True 厘米dOK.Enabled = True End If End SubPriva
8、te Sub 厘米dCacel_Click() If 厘米dAddNew.Caption = 确认 Then DataA.Recordset.CancelUpdate End If Fr米米ain.Enabled = True Fr米米ain.SetFocus Unload 米e Fr米米ain.DataA.Refresh If Fr米米ain.cutable = e米ployee Then Fr米米ain.DBGA.Colu米ns(性别).Button = True Fr米米ain.DBGA.Colu米ns(学历).Button = True Fr米米ain.DBGA.Colu米ns(部门)
9、.Button = TrueEnd IfEnd SubPrivate Sub 厘米dDel_Click() DataA.ReadOnly = False DataA.Recordset.Delete DataA.Recordset.米oveNext If DataA.Recordset.EOF Then DataA.Recordset.米oveLast End If Fr米米ain.DataA.RefreshEnd SubPrivate Sub 厘米dOK_Click() If Txt(0).Text = Then 米sgBox 不可以为空 Txt(0).SetFocus Exit Sub E
10、nd If Bupdata = False DataA.Recordset.Edit If Fr米米ain.cutable = leave Then DataA.Recordset.Fields(8) = fr米Login.E米ploID DataA.Recordset.Fields(9) = Now ElseIf Fr米米ain.cutable = e米ployee Then DataA.Recordset.Fields(13) = fr米Login.E米ploID DataA.Recordset.Fields(14) = Now If Opsex(0) Then DataA.Records
11、et.Fields(4) = 男 Else DataA.Recordset.Fields(4) = 女 End If DataA.Recordset.Fields(7) = 厘米bdegree.Text DataA.Recordset.Fields(8) = 厘米bdepart.Text DataA.Recordset.Fields(13) = fr米Login.E米ploID DataA.Recordset.Fields(14) = Now Else For i = 4 To 10 If Not IsNu米eric(Txt(i).Text) Then 米sgBox not a nu米ber
12、Txt(i).SetFocus Exit Sub End If Next i DataA.Recordset.Fields(13) = fr米Login.E米ploID DataA.Recordset.Fields(14) = Now End If For i = 1 To 12 If Txt(i).Text = Then Txt(i).Text = 0 DataA.Recordset.Fields(i) = 0 Next i DataA.Recordset.Update Fr米米ain.DataA.Refresh DataB.Refresh End SubPrivate Sub DataA_
13、Validate(Action As Integer, Save As Integer) If Action = 11 And Bupdata Then Save = 0 End If End SubPrivate Sub Lab_Click(Index As Integer)End SubPrivate Sub Txt_KeyPress(Index As Integer, KeyAscii As Integer) If (KeyAscii 57) And KeyAscii vbKeyBack And Index = 0 Then KeyAscii = 0 Exit Sub End If If
14、 Fr米米ain.cutable = leave And Index = 1 Then If (KeyAscii 57) And KeyAscii vbKeyBack Then KeyAscii = 0 Exit Sub End If End If If Fr米米ain.cutable = salary Then If Index = 3 Then If (KeyAscii 57) And KeyAscii vbKeyBack Then KeyAscii = 0 Exit Sub End If End If If Index = 13 Then Exit Sub If (KeyAscii 57
15、) And KeyAscii vbKeyBack And KeyAscii 46 Then KeyAscii = 0 Exit Sub End If End If End SubPrivate Sub Txt_change(Index As Integer) If Bupdata = False Then Bupdata = True If Fr米米ain.cutable = salary Then If Txt(Index).Text = Then Exit Sub If Index = 4 And Index = 8 And Index -1 Then DataA.Recordset.米o
16、ve (Fr米米ain.cuAp) Else DataA.Recordset.米oveFirst End If If DataA.Recordset.Fields(4) = 男 Then Opsex(0).Value = True Else Opsex(1).Value = True End If 设置lsdegree的 显示项 For i = 0 To Fr米米ain.LsDegree.ListCount - 2 厘米bdegree.AddIte米 Fr米米ain.LsDegree.List(i) If Fr米米ain.LsDegree.List(i) = DataA.Recordset.F
17、ields(7) Then 厘米bdegree.ListIndex = i End If Next i If 厘米bdegree.ListIndex = -1 Then 厘米bdegree.AddIte米 DataA.Recordset.Fields(7) 厘米bdegree.ListIndex = 厘米bdegree.ListCount - 1 End If 厘米bdegree.AddIte米 定制 设置lsdepart的 显示项 For i = 0 To Fr米米ain.LsDepart.ListCount - 2 厘米bdepart.AddIte米 Fr米米ain.LsDepart.Li
18、st(i) If Fr米米ain.LsDepart.List(i) = DataA.Recordset.Fields(8) Then 厘米bdepart.ListIndex = i End If Next i If 厘米bdepart.ListIndex = -1 Then 厘米bdepart.AddIte米 DataA.Recordset.Fields(8) 厘米bdepart.ListIndex = 厘米bdepart.ListCount - 1 End If 厘米bdepart.AddIte米 定制 设置完毕 ElseIf Fr米米ain.cutable = leave Then lea
19、ve Txt(7).Visible = True 厘米bdegree.Visible = False 厘米bdepart.Visible = False Fra米e1.Visible = False For i = 8 To 12 Lab(i).Visible = False Txt(i).Visible = False Next i For i = 0 To 7 Lab(i).Caption = DataA.Recordset.Fields(i).Na米e Txt(i).DataField = DataA.Recordset.Fields(i).Na米e Next i Txt(13).Dat
20、aField = DataA.Recordset.Fields(10).Na米e If Fr米米ain.cuAp -1 Then DataA.Recordset.米ove (Fr米米ain.cuAp) Else DataA.Recordset.米oveFirst End If Else salary Fra米e1.Visible = False 厘米bdegree.Visible = False 厘米bdepart.Visible = False For i = 0 To 12 Lab(i).Caption = DataA.Recordset.Fields(i).Na米e Txt(i).Dat
21、aField = DataA.Recordset.Fields(i).Na米e Next i Txt(13).DataField = DataA.Recordset.Fields(15).Na米e Txt(7).Locked = True Txt(11).Locked = True Txt(12).Locked = True If Fr米米ain.cuAp -1 Then DataA.Recordset.米ove (Fr米米ain.cuAp) Else DataA.Recordset.米oveFirst End If End If End SubPrivate Sub For米_Unload(
22、Cancel As Integer) Fr米米ain.Enabled = True Fr米米ain.SetFocus Unload 米e Fr米米ain.DataB.RefreshEnd SubOption ExplicitConst 米xUser = 100Public E米ploID As IntegerPublic CurUser As StringPublic CurId As StringPublic CurPsw As StringDi米 user(米xUser), pws(米xUser), state(米xUser), E米plo(米xUser) As StringPrivate
23、 Sub For米_Load()Di米 i As Integer If App.PrevInstance Then 米sgBox (程序已经运行,不能再次装载.), vbExcla米ation Unload 米e End If 本段代码用于判定本程序是否已经装载于内存中,以避免程序的 多重启动 i = 0 Open App.Path + user.ini For Input As 号1 Do While Not EOF(1) Input 号1, user(i), pws(i), state(i), E米plo(i) If state(i) = A Then Co米bo1.AddIte米 use
24、r(i) End If i = i + 1 Loop Close 号1 Co米bo1.ListIndex = 1 在窗口装载阶段读取用户设置文件获取用户信息 并装载于用户列表框中End SubPrivate Sub 厘米dCancel_Click() Unload 米e End End SubPrivate Sub 厘米dOK_Click() If txtPassword = pws(Co米bo1.ListIndex) Then CurId = Co米bo1.ListIndex E米ploID = E米plo(CurId) CurUser = user(CurId) CurPsw = pws(
25、CurId) 米e.Hide Load Fr米米ain Fr米米ain.Show Else 米sgBox Invalid Password, try again!, , Login txtPassword.SetFocus SendKeys Ho米e+End End If End SubPrivate Sub For米_Unload(Cancel As Integer) Unload 米e EndEnd SubOption ExplicitPublic cuTabCh As BooleanPublic cutable As StringPublic cuAp As Integer 当前指针位置
26、Di米 i As IntegerPublic Pwin As StringPublic Sub showe米ployee() DataA.RecordSource = select * fro米 e米ployee DataA.Refresh DBGA.Colu米ns(性别).Button = True DBGA.Colu米ns(学历).Button = True DBGA.Colu米ns(部门).Button = True For i = 0 To 2 米tab(i).Checked = False Next i 米tab(0).Checked = True cutable = e米ploye
27、e cuTabCh = True End SubPublic Sub showleave() DataA.RecordSource = select * fro米 leave DataA.Refresh For i = 0 To 2 米tab(i).Checked = False Next i 米tab(1).Checked = True cutable = leave cuTabCh = True End SubPublic Sub showsalary() DataA.RecordSource = select * fro米 salary DataA.Refresh For i = 0 T
28、o 2 米tab(i).Checked = False Next i 米tab(2).Checked = True cutable = salary cuTabCh = TrueEnd SubPrivate Sub For米_Load() Di米 fil, tbcount, i As Integer Di米 Tbstr(50), Tbna米(50) As String DataA.DatabaseNa米e = App.Path + s米.米db DataB.DatabaseNa米e = App.Path + s米.米db DataB.RecordSource = select * fro米 e
29、米ployee Call showe米ployee If Dir(App.Path + table.ini) = Then LsDegree.AddIte米 定制 LsDepart.AddIte米 定制 Else fil = FreeFile() Open App.Path + table.ini For Input As 号fil Do While Not EOF(fil) Input 号fil, Tbna米(i), Tbstr(i) i = i + 1 Loop Close 号fil tbcount = i For i = 0 To tbcount If Tbna米(i) = lsdegr
30、ee Then LsDegree.AddIte米 Tbstr(i) ElseIf Tbna米(i) = lsdepart Then LsDepart.AddIte米 Tbstr(i) End If Next i LsDegree.AddIte米 定制 LsDepart.AddIte米 定制 End If End SubPrivate Sub For米_Unload(Cancel As Integer) EndEnd SubPrivate Sub DBGA_ButtonClick(ByVal ColIndex As Integer)Di米 Co As Colu米n Set Co = DBGA.C
31、olu米ns(ColIndex) Select Case ColIndex Case 4 Lssex.Left = DBGA.Left + Co.Left + Co.Width Lssex.Top = DBGA.Top + DBGA.RowTop(DBGA.Row) Lssex.Visible = True Lssex.ZOrder 0 Lssex.SetFocus Case 7 degree LsDegree.Left = DBGA.Left + Co.Left + Co.Width LsDegree.Top = DBGA.Top + DBGA.RowTop(DBGA.Row) LsDegr
32、ee.Visible = True LsDegree.ZOrder 0 LsDegree.SetFocus Case 8 depart米ent LsDepart.Left = DBGA.Left + Co.Left + Co.Width LsDepart.Top = DBGA.Top + DBGA.RowTop(DBGA.Row) LsDepart.Visible = True LsDepart.ZOrder 0 LsDepart.SetFocus End SelectEnd SubPrivate Sub DBGA_HeadClick(ByVal ColIndex As Integer) DB
33、GA.ClearSelColsEnd SubPrivate Sub DBGA_米ouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 2 Then Fr米米ain.Popup米enu 米p End IfEnd SubPrivate Sub DBGA_RowColChange(LastRow As Variant, ByVal LastCol As Integer) cuAp = DataA.Recordset.AbsolutePosition If cuAp -1 Then DataB.Recordset.FindFirst 职工编号= + CStr(DataA.Recordset.Fields(职工编号) If DataB.Recordset.No米atch Then Lab.Caption = 没有此职员 Else With DataB.Recor
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年湖北省仙桃市高二生物下册期末考试模拟试卷及一套参考答案
- 2026年辽宁省海城市高二生物上册期末考试试卷含答案(考试直接用)
- 2026年黑龙江省尚志市高二生物上册期末考试模拟卷(重点)附答案
- 2025年山西省汾阳市高二生物下册期末考试模拟考试卷附完整答案(考点梳理)
- 《所得税讲义》课件
- 2025年江苏省高邮市高二历史上册期末考试试卷必考附答案
- 2025年浙江省温岭市高二生物上册期末考试模拟卷【A卷】附答案
- 2026年湖北省枣阳市高二生物上册期末考试测试卷(历年真题)附答案
- 2026年辽宁省灯塔市高二生物下册期末考试模拟检测卷及完整答案【历年真题】
- 2026年山东省莱州市高二生物下册期末考试模拟试卷(真题汇编)附答案
- 急救知识科普宣传
- Ⅱ度烧伤创面治疗专家共识(2024版)
- 压力容器材料代用规范与实践
- 天府特资(四川)投资管理有限公司2026年招聘笔试参考题库及答案详解
- 5.3《9的乘法口诀》 课件 2025-2026学年二年级上册数学人教版
- 三级安全教育考试试题及答案(2025版)
- 泰国中文教师备课教案模板
- 新22J01 工程做法图集
- 学校石材工程投标书
- 下颌第一前磨牙拔除术考核评分表(2份)2024年度住院医生规范化培训评分表
- 少先队入队学少先知识做先锋少年课件
评论
0/150
提交评论