【正文】
符 申請出差 輸入 申請人姓名、所屬部門、出差的開始時間、出差地點、出差原因 輸出 提示出差申請已經(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)模式。 信息 。 信息 。 信息 。 邏輯結(jié)構(gòu)設(shè)計設(shè)計 根據(jù)職工考勤管理系統(tǒng)的功能要求,選取 SQLServer 2020 作為后臺數(shù)據(jù)庫。例如:生 產(chǎn)部為第七個創(chuàng)建的部門,所以他的編號為 07。 . . 第四章 信息系統(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。 and = amp。 and amp。 ,39。) 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。 and departmentName like 39。 ElseIf (m_txtdepartID ) Then strSql = select departmentId as 部門編號 , departmentName as 部門名稱 from TDepartment where departmentId = amp。 m_txtdepartName amp。 m_strDepartName amp。 m_iDepartId Set rsDep = TransactSQL(strSql) = (0) = (1) = False DisConnect End Sub Public Function SetRowNumber(ByVal p_irownumber As Integer) m_irownumber = p_irownumber End Function Public Function GetRowNumber() As Integer GetRowNumber = m_irownumber End Function 員工考勤登記 Dim strSql As String Dim rs As New Dim today As String Dim qjLength As Double Dim qjTime As String Dim djTime As String Dim qjReason As String Dim ccLength As Double Dim ccTime As String Dim dcTime As String Dim ccArea As String Dim ccContent As String . . Dim nowtime As String Private Sub cboDept_Click() strSql = Select * from TWorker where departmentId= amp。 order by workerId Set rs = TransactSQL(strSql) Do While Not ((2).Value) () = (1).Value Loop = 0 End Sub Private Sub cboYourDepQJ_Click() strSql = Select * from TWorker where departmentId= amp。 and workerId= amp。 _ . . values( amp。 , amp。 , amp。 amp。 worktype amp。 39。 workerId amp。 amp。 么? , vbOKCancel) = vbOK Then psw = InputBox(請輸入員工密碼: , 輸入密碼) If yanzhengPWD(labwele, psw, workerPsw) = False Then Exit Sub = False Else Call getTime If DateDiff(s, nowtime, astart) = 0 Then worktype = 6 Else worktype = 4 End If If yanzheng(departId, workerId, today) Then If asrecord(departId, workerId, today) Then strSql = update TShangBan set workasType = amp。 nowtime amp。 and workerId = amp。 TransactSQL (strSql) . . = False = True = amp。 _ values( amp。 ,39。,39。, amp。 optastart(0).Caption amp。 worktype amp。 39。 workerId amp。 amp。 departId amp。 amp。 amp。 ccLength amp。 39。 39。 , amp。 。 ,39。 Now() Exit Sub Else = False qjReason = Trim() strSql = insert into TQingJia (departmentId,workerId,qjTime,qjLength,djTime,qjReason) values( _ amp。 amp。 amp。 39。 39。 workerId amp。 ,祝你生活幸福! MsgBox 登 記成功! Else MsgBox 你已經(jīng)下班,不必再登記! End If Else MsgBox 對不起 ,你還沒有上班,請先上班! , vbOKOnly + vbExclamation, 請遵守公司上下班秩序 End If End If Else MsgBox 不登記 End If End If End If