【正文】
b Else RowNumber = (0).CellValue() End If RowNumber ShowErr: Exit Sub End Sub . . Private Sub dgDepManage_DblClick() On Error GoTo ShowErr: If IsNull() Then RowNumber = 1 Exit Sub Else RowNumber = (0).CellValue() End If RowNumber vbModal ShowErr: Exit Sub End Sub Private Sub Form_Load() RowNumber = 1 End Sub 更新部門 Option Explicit Dim strSql As String Dim rsDep As New Dim m_irownumber As Integer Dim m_iDepartId As Integer Dim m_strDepartName As String Private Sub cmdOk_Click() If = Then MsgBox 登記項目不能有空值 Exit Sub Else m_iDepartId = CInt() m_strDepartName = Trim() strSql = update TDepartment set departmentName=39。 m_txtdepartName amp。 from TDepartment where departmentName like 39。 ElseIf (m_txtdepartID ) Then strSql = select departmentId as 部門編號 , departmentName as 部門名稱 from TDepartment where departmentId = amp。 m_txtdepartName amp。 and departmentName like 39。 from TDepartment where departmentId = amp。) TransactSQL (strSql) MsgBox 添加成功 End If End Sub Public Sub init() = num = 0 strSql = select * from TDepartment order by departmentId Set rs = TransactSQL(strSql) If Not And Not Then num = rs(0) num = num + 1 = CStr(num) Else . . = 1 End If End Sub Private Sub cmdreadd_Click() Call init End Sub Private Sub Form_Load() num = 0 strSql = select * from TDepartment order by departmentId Set rs = TransactSQL(strSql) If Not And Not Then num = rs(0) num = num + 1 = CStr(num) Else = 1 End If End Sub 部門管理 Dim strSql As String Dim RowNumber As Integer Private Sub cmdadd_Click() vbModal End Sub Private Sub cmddel_Click() If ConnectToDB() = False Then MsgBox 數(shù)據(jù)庫連接失敗 ! Exit Sub End If If MsgBox(你真的要刪除嗎 , vbInformation + vbYesNo, ) = vbYes Then strSql = delete from TDepartment where departmentId = amp。 departName amp。 ,39。 . . ConnectToDB RefushDataGrid adodcChuChai, dgChuChai, strSql DisConnect End Sub Private Sub Form_Load() strSql = Select * from TDepartment order by departmentId Set rs = TransactSQL(strSql) Do While Not ((1).Value) () = (0).Value Loop = 0 End Sub 添加部門 Dim departId As Integer Dim departName As String If = Then MsgBox 部門名稱不能有空值 Exit Sub Else departId = Trim() departName = Trim() strSql = insert into TDepartment (departmentId,departmentName) values( _ amp。 and amp。 and = and = and = and between amp。 and = amp。 order by workerId Set rs = TransactSQL(strSql) Do While Not ((2).Value) () = (1).Value Loop = 0 End Sub Private Sub cmdPrint_Click() Set = (1).Controls(1).Caption = 請假情況統(tǒng)計表 (2).Controls(1).Caption = 部門名稱 (2).Controls(2).Caption = 員工名稱 (2).Controls(3).Caption = 出差時間 (2).Controls(4).Caption = 出差地點 (2).Controls(5).Caption = 出差天數(shù) (2).Controls(6).Caption = 登記時間 (2).Controls(7).Caption = 銷差時間 (2).Controls(8).Caption = 出差備注 (3).Controls(1).DataField = 部門名稱 (3).Controls(2).DataField = 員工名稱 (3).Controls(3).DataField = 出差時間 (3).Controls(4).DataField = 出差地點 (3).Controls(5).DataField = 出差天數(shù) (3).Controls(6).DataField = 登記時間 (3).Controls(7).DataField = 銷差時間 (3).Controls(8).DataField = 出差備注 End Sub Private Sub cmdQuery_Click() strSql = select as 部門名稱 , as 員工名稱 , as 出差時間 , as 出差地點 , as 出差天數(shù) , as 登記時間 , as 銷差時間 , as 出差備注 from TDepartment a, TWorker b,TChuChai c where = amp。 . . 第四章 信息系統(tǒng)實施 源程序 添加用戶 Dim m_clsUser As clsUser Private Sub cmdReg_Click() Set m_clsUser = New clsUser txtUserName, txtPassword, txtPasswordConfirm, txtRealName, boPermission, txtRegTime, frmAddUser End Sub Private Sub Form_Load() 管理員 , 0 普通用戶 , 1 = 0 End Sub Private Sub cmdClose_Click() Unload Me End Sub 修改密碼 Dim m_clsUser As clsUser Private Sub cmdChPwdOk_Click() Set m_clsUser = New clsUser txtChUser, txtOldPwd, txtNewPwd, txtNewPwdagain, frmChPwd End Sub Private Sub Form_Load() End Sub Private Sub cmdChPwdCancel_Click() Unload Me End Sub 出差情況 Dim strSql As String Dim rs As New Recordset . . Private Sub cboDept_Click() strSql = Select * from TWorker where departmentId= amp。例如:婁京兆是 2020 年生產(chǎn)部招收的第一位員工,那么他的 ID 就是 071301。例如:生 產(chǎn)部為第七個創(chuàng)建的部門,所以他的編號為 07。 該數(shù)據(jù)庫 由 5 個表組成,部門表、超級用戶表、用戶表、考勤表、考勤歷史表。 邏輯結(jié)構(gòu)設(shè)計設(shè)計 根據(jù)職工考勤管理系統(tǒng)的功能要求,選取 SQLServer 2020 作為后臺數(shù)據(jù)庫。 。 信息 。 。 信息 。 信息 。 信息 。 通過對職工出勤管理系統(tǒng)的內(nèi)容和數(shù)據(jù)流程分析及 ER 圖,設(shè)計如下數(shù)據(jù)項和數(shù)據(jù)結(jié)構(gòu): 信息 。 輸出 提示登錄成功進(jìn)入系統(tǒng)主頁面 表 32 員工上班 名稱、標(biāo)識符 上班 輸入 選擇部門、姓名,點擊上班 輸出 提示上班成功信息 . . 表 33 員工下班 名稱、標(biāo)識符 下班 輸入 輸入部門、姓名,點擊上班 輸出 提示下班成功信息 表 34 修改密碼 名稱、標(biāo)識符 修改密碼 輸入 管理員輸入用戶名、原始密碼、新設(shè)定的密碼 輸出 提示修改密碼成功信息 表 35 申請 請假 名稱、標(biāo)識符 申請請假 輸入 輸入請假人姓名、所屬部門、請假時間、請假時長、請假原因 輸出 提示請假申請已經(jīng)提交信息 表 36 申請出差 名稱、標(biāo)識符 申請出差 輸入 申請人姓名、所屬部門、出差的開始時間、出差地點、出差原因 輸出 提示出差申請已經(jīng)提交信息 表 37 員工添加 名稱、標(biāo)識符 添加員工 輸入 輸入部門、姓名、性別、年齡、進(jìn)公司時間、個人密碼 輸出 提示添加已完成 表 38 部門添加 名稱、標(biāo)識符 部門添加 輸入 輸入部門名稱 輸出 提示添加已完成 表 39 上下班時間設(shè)定 名稱、標(biāo)識符 上、下班時間設(shè)定 輸入 上、下班時間 輸出 提示設(shè)置成功 數(shù)據(jù)庫結(jié)構(gòu)設(shè)計 概念設(shè)計 數(shù)據(jù)庫一般分為三級模式:外模式、概念模式和內(nèi)模式。對數(shù)據(jù)庫的關(guān)鍵數(shù)據(jù)應(yīng)要求保密。 輸出:職工考勤情況。 系統(tǒng)在進(jìn)行相關(guān)操作如刪除員