考勤管理系统实验报告(附源代码内容摘要:

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。 () 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 = 请假情况统计表 (2).Controls(1).Caption = 部门名称 (2).Controls(2).Caption = 员工名称 (2).Controls(3).Caption = 出差时间 (2).Controls(4).Caption = 出差地点 (2).Controls(5).Caption = 出差天数 (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 = 出差天数 (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 出差天数 , as 登记时间 , as 销差时间 , as 出差备注 from TDepartment a, TWorker b,TChuChai c where = amp。 () amp。 and = amp。 () amp。 and = and = and = and between amp。 dtpStartDate amp。 and amp。 dtpEndDate amp。 . . 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。 departId amp。 ,39。 amp。 departName 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 数据库连接失败 ! Exit Sub End If If MsgBox(你真的要删除吗 , vbInformation + vbYesNo, ) = vbYes Then strSql = delete from TDepartment where departmentId = amp。 RowNumber TransactSQL (strSql) DisConnect MsgBox 删除成功 , vbInformation, strSql = select departmentId as 部门编号 , departmentName as 部门名称 from TDepartment RefreshData adodcDepManage, dgDepManage, strSql Exit Sub End If End Sub . . Private Sub cmdUpdate_Click() If RowNumber = 1 Then MsgBox 请先选择要修改的数据 ! Exit Sub End If vbModal End Sub Private Sub Comselect_Click() Dim m_txtdepartID As String Dim m_txtdepartName As String m_txtdepartID = Trim() m_txtdepartName = Trim() If (m_txtdepartID = And m_txtdepartName = ) Then strSql = select departmentId as 部门编号 , departmentName as 部门名称 from TDepartment ElseIf (m_txtdepartID And m_txtdepartName ) Then strSql = select departmentId as 部门编号 , departmentName as 部门名称 _ amp。 from TDepartment where departmentId = amp。 m_txtdepartID amp。 and departmentName like 39。 % amp。 m_txtdepartName amp。 %39。 ElseIf (m_txtdepartID ) Then strSql = select departmentId as 部门编号 , departmentName as 部门名称 from TDepartment where departmentId = amp。 m_txtdepartID ElseIf m_txtdepartName Then strSql = select departmentId as 部门编号 , departmentName as 部门名称 _ amp。 from TDepartment where departmentName like 39。 % amp。 m_txtdepartName amp。 %39。 End If RefreshData adodcDepManage, dgDepManage, strSql End Sub Private Sub dgDepManage_Click() On Error GoTo ShowErr: If IsNull() Then RowNumber = 1 Exit Sub 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。 amp。 m_strDepartName amp。 39。 where departmentId= amp。 m_iDepartId If ConnectToDB() = False Then MsgBox 数据库连接失败 !。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。