【正文】
partmentId as 部門編號 , departmentName as 部門名稱 from TDepartment RefreshData , , strSql End If End Sub Private Sub Form_Load() m_iDepartId = GetRowNumber If ConnectToDB() = False Then MsgBox 數(shù)據(jù)庫連接失敗 ! Exit Sub End If strSql = select * from TDepartment where departmentId= amp。 () amp。 () amp。 () amp。 departId amp。 workerId Set rs = TransactSQL(strSql) If = False Then workerPsw = (0) End If If = True Then If = True Then If MsgBox(確定要 amp。 么? , vbOKCancel) = vbOK Then psw = InputBox(請輸入員工密碼: , 輸入密碼) If yanzhengPWD(labwele, psw, workerPsw) = False Then Exit Sub = False Else Call getTime If DateDiff(s, nowtime, mstart) = 0 Then worktype = 6 Else worktype = 4 End If If yanzheng(departId, workerId, today) Then MsgBox 你已經(jīng)上班,不必再登記! Else strSql = insert into TShangBan (departmentId,workerId,workday,mstartTime,workmsType) amp。 departId amp。 workerId amp。 today amp。 nowtime amp。 worktype amp。 amp。 ,祝你今天上午工作愉快! MsgBox 登記成功! End If End If Else MsgBox 不登記 End If Else If MsgBox(確定要 amp。 么? , vbOKCancel) = vbOK Then psw = InputBox(請輸入員工密碼: , 輸入密碼) If yanzhengPWD(labwele, psw, workerPsw) = False Then Exit Sub = False Else Call getTime If DateDiff(s, nowtime, mleave) = 0 Then worktype = 6 Else worktype = 3 End If If yanzheng(departId, workerId, today) Then If mlrecord(departId, workerId, today) Then strSql = update TShangBan set workmlType = amp。 , mleaveTime =39。 nowtime amp。 where departmentId = amp。 and workerId = amp。 and workday= amp。 TransactSQL (strSql) = False = True . . = amp。 amp。 optastart(0).Caption amp。 worktype amp。 amp。 39。 departId amp。 workerId amp。 today amp。 amp。 ,祝你今天下午工作愉快! MsgBox 登記成功! Else MsgBox 你已經(jīng)上班,不必再登記! End If Else strSql = insert into TShangBan (departmentId,workerId,workday,astartTime,workasType) amp。 departId amp。 workerId amp。 amp。 39。 amp。 39。 worktype amp。 amp。 ,祝你今天下午工作愉快! MsgBox 登記成功! End If End If Else MsgBox 不登記 End If Else If MsgBox(確定要 amp。 么? , vbOKCancel) = vbOK Then psw = InputBox(請輸入員工密碼: , 輸入密碼) If yanzhengPWD(labwele, psw, workerPsw) = False Then Exit Sub = False Else Call getTime If DateDiff(s, nowtime, aleave) = 0 Then worktype = 6 Else worktype = 3 . . End If If yanzheng(departId, workerId, today) Then If alrecord(departId, workerId, today) Then strSql = update TShangBan set workalType = amp。 , aleaveTime =39。 nowtime amp。 where departmentId = amp。 and workerId = amp。 and workday= amp。 TransactSQL (strSql) = False = True = amp。 optaleave(1).Caption amp。 Now() Exit Sub Else = = False ccArea = Trim() ccContent = Trim() strSql = insert into TChuChai (departmentId,workerId,ccTime,ccArea,ccLength,dcTime,ccContent) values( _ amp。 , amp。 ,39。 ccTime amp。,39。 ccArea amp。, amp。 ,39。 dcTime amp。,39。 ccContent amp。) TransactSQL (strSql) MsgBox 登記成功 End If End Sub Private Sub cmdOKQJ_Click() Dim departId As Integer Dim workerId As Integer departId = () workerId = () If = Or = Or = Then MsgBox 登記項(xiàng)目不能有空值 Exit Sub ElseIf IsDate(txtqjTime) = False Then MsgBox 時(shí)間格式不對! = True = 時(shí)間格式: amp。 departId amp。 workerId amp。 amp