




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、附錄: 畢業(yè)設計程序清單設計題目 人事管理系統(tǒng) 教 學 班: 學生姓名: 學 號: 指導教師: 完成日期: 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 (程序已經(jīng)運行,不能再次裝載.), vbExcla米ation Unload 米e End If 本段代碼用于判定本程序是否已經(jīng)裝載于內(nèi)存中,以避免程序的 多重啟動 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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年民間借貸合同模板月息
- 六年級下冊數(shù)學教案-5.2 數(shù)與代數(shù) ︳西師大版
- 二年級下冊數(shù)學教案-4.4勤勞工作-筆算三位數(shù)加減三位數(shù)(一次進位、退位) 青島版
- 2025年城鄉(xiāng)結(jié)對共建協(xié)議書范
- 2025年河北旅游職業(yè)學院單招職業(yè)適應性測試題庫及答案一套
- 化學-云南省三校2025屆高三2月高考備考聯(lián)考卷(六)試題和答案
- 2025江西省建筑安全員A證考試題庫及答案
- 2025年鶴崗師范高等??茖W校單招職業(yè)傾向性測試題庫完整版
- 2025年度個人股份轉(zhuǎn)讓與員工分紅權(quán)合同模板
- 2025年度企業(yè)數(shù)字化轉(zhuǎn)型技術(shù)顧問合作協(xié)議
- 小學科學新課標科學課程標準解讀
- DeepSeek科普課件深度解析
- 湖南省長沙市北雅中學2024-2025學年九年級下學期開學考試英語試題(含答案含聽力原文無音頻)
- 2025年駐村個人工作計劃
- 化工企業(yè)安全生產(chǎn)信息化系統(tǒng)管理解決方案
- 供電工程施工方案(技術(shù)標)
- 2023屆江西省九江市高三第一次高考模擬統(tǒng)一考試(一模)文綜試題 附答案
- 2024年共青團入團積極分子、發(fā)展對象考試題庫及答案
- 2024廣西公務員考試及答案(筆試、申論A、B類、行測)4套 真題
- 2024年山東省濟南市中考英語試題卷(含答案解析)
- 2022年版初中物理課程標準解讀-課件
評論
0/150
提交評論