📄 employeelistform.frm
字号:
Modifypassword
Case "sc" ' 删除
Call delete
Call refreshlist
Case "cx" ' 查询
q = 1
Call Query
Case "qx" ' 权限
ret = yhqxpd(MainForm.g_application.m_userId, 26)
If ret Then
If Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 35)) <> "" Then
employeepermissionform.m_employeeId = Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 35))
employeepermissionform.m_employeename = Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 1))
employeepermissionform.show
End If
Else
MainForm.g_msgText = "该功能您无权操作!"
HMsgBox MainForm.g_msgText, 0, 1
End If
Case "sx" '刷 新
q = 0
Call refreshlist
Case "dy" ' 打印员工证
PrintEmployeeCard
Case "tc" '退 出
Unload Me
End Select
End Sub
'**************************************
'* 功 能 描 述 :打印员工证处理函数
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Function PrintEmployeeCard()
Dim employeeIdList As String ' 要打印员工证的员工编号列表字符串
Dim i As Integer ' 循环变量
employeeIdList = ""
' 取得要打印员工证的员工的ID列表字符串
For i = 1 To hfg_houseList.Rows - 1
If Trim(hfg_houseList.TextMatrix(i, 0)) = "√" Then
If Trim(employeeIdList) = "" Then
employeeIdList = employeeIdList + _
"'" + Trim(hfg_houseList.TextMatrix(i, 35)) + "'"
Else
employeeIdList = employeeIdList + "," + _
"'" + Trim(hfg_houseList.TextMatrix(i, 35)) + "'"
End If
End If
Next i
If Trim(employeeIdList) = "" Then ' 如果没有选择员工则提示错误
MainForm.g_msgText = "请选择员工然后再执行打印操作!"
HMsgBox MainForm.g_msgText, 0, 1
Else
PrintCrystalReport "EMPLOYEECARD", employeeIdList
End If
End Function
'**************************************
'* 功 能 描 述 :刷新仓库列表
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub refreshlist()
Dim currentrow As Integer ' 当前插入的行
m_EmployeeDAO.FindAll m_recordset, Trim(m_queryType)
' Set hfg_houseList.DataSource = m_recordset ' 数据源绑定到显示控件
hfg_houseList.clear
hfg_houseList.Rows = 2
RefreshListTitle
GetRecordToList m_recordset
m_recordset.Close
End Sub
'**************************************
'* 功 能 描 述 :删除一条记录
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub delete()
Dim ret As Integer
If Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 35)) = "" Then
MainForm.g_msgText = "请选择一条记录!"
HMsgBox MainForm.g_msgText, 0, 1
End If
MainForm.g_msgText = "确定删除这条记录吗?"
ret = HMsgBox(MainForm.g_msgText, 2, 1)
If ret = 1 Then
m_EmployeeDAO.DeleteById m_recordset, _
Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 35))
End If
End Sub
'**************************************
'* 功 能 描 述 :修改一个用户的密码
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub Modifypassword()
Dim ret As Integer
Dim copf As New ChangeOtherPasswordForm ' 修改其它人的密码窗体
If Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 35)) = "" Then
MainForm.g_msgText = "请选择一条记录!"
HMsgBox MainForm.g_msgText, 0, 1
End If
copf.m_employeeId = Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 35))
copf.show 1
Set copf = Nothing
End Sub
'**************************************
'* 功 能 描 述 :刷新列表的标题栏
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub RefreshListTitle()
hfg_houseList.Rows = 2
hfg_houseList.TextMatrix(0, 0) = "状态"
hfg_houseList.TextMatrix(0, 1) = "员工姓名"
hfg_houseList.TextMatrix(0, 36) = "密码"
hfg_houseList.TextMatrix(0, 3) = "性别"
hfg_houseList.TextMatrix(0, 24) = "离职时间"
hfg_houseList.TextMatrix(0, 5) = "民族"
hfg_houseList.TextMatrix(0, 6) = "员工编号"
hfg_houseList.TextMatrix(0, 7) = "血型"
hfg_houseList.TextMatrix(0, 8) = "身份证号"
hfg_houseList.TextMatrix(0, 9) = "身高"
hfg_houseList.TextMatrix(0, 10) = "体重"
hfg_houseList.TextMatrix(0, 11) = "户口地址"
hfg_houseList.TextMatrix(0, 12) = "学历"
hfg_houseList.TextMatrix(0, 13) = "生日日期"
hfg_houseList.TextMatrix(0, 14) = "毕业学校"
hfg_houseList.TextMatrix(0, 15) = "政治面貌"
hfg_houseList.TextMatrix(0, 16) = "语言种类"
hfg_houseList.TextMatrix(0, 17) = "提成系数"
hfg_houseList.TextMatrix(0, 18) = "计算机水平"
hfg_houseList.TextMatrix(0, 19) = "婚姻状况"
hfg_houseList.TextMatrix(0, 20) = "个人网站"
hfg_houseList.TextMatrix(0, 21) = "所在部门"
hfg_houseList.TextMatrix(0, 22) = "职位"
hfg_houseList.TextMatrix(0, 23) = "职称" ': hfg_houseList.ColPosition(23) = 0
hfg_houseList.TextMatrix(0, 4) = "加盟时间"
hfg_houseList.TextMatrix(0, 25) = "公司电话"
hfg_houseList.TextMatrix(0, 26) = "家庭电话"
hfg_houseList.TextMatrix(0, 27) = "手机"
hfg_houseList.TextMatrix(0, 28) = "Email"
hfg_houseList.TextMatrix(0, 29) = "现住址"
hfg_houseList.TextMatrix(0, 30) = "邮政编码"
hfg_houseList.TextMatrix(0, 31) = "联系地址"
hfg_houseList.TextMatrix(0, 32) = "健康状况"
hfg_houseList.TextMatrix(0, 33) = "备注"
hfg_houseList.TextMatrix(0, 34) = "状态"
hfg_houseList.TextMatrix(0, 35) = "员工编号"
hfg_houseList.TextMatrix(0, 2) = "昵称"
hfg_houseList.ColWidth(0) = 500
hfg_houseList.ColWidth(35) = 0
hfg_houseList.ColWidth(34) = 0
hfg_houseList.ColWidth(36) = 0
hfg_houseList.ColWidth(16) = 0
hfg_houseList.ColWidth(18) = 0
hfg_houseList.ColWidth(30) = 0
hfg_houseList.ColWidth(25) = 0
' hfg_houseList.ColWidth(13) = 0
hfg_houseList.ColWidth(15) = 0
' 设置列对齐方式 8-右对齐 5-居中对齐 2-左对齐
hfg_houseList.ColAlignment(0) = 5
hfg_houseList.ColAlignment(1) = 2
hfg_houseList.ColAlignment(2) = 2
hfg_houseList.ColAlignment(3) = 2
hfg_houseList.ColAlignment(4) = 2
hfg_houseList.ColAlignment(5) = 2
hfg_houseList.ColAlignment(6) = 2
hfg_houseList.ColAlignment(7) = 2
hfg_houseList.ColAlignment(8) = 2
hfg_houseList.ColAlignment(9) = 8
hfg_houseList.ColAlignment(10) = 8
hfg_houseList.ColAlignment(11) = 2
hfg_houseList.ColAlignment(12) = 2
hfg_houseList.ColAlignment(13) = 2
hfg_houseList.ColAlignment(14) = 2
hfg_houseList.ColAlignment(15) = 2
hfg_houseList.ColAlignment(16) = 2
hfg_houseList.ColAlignment(17) = 8
hfg_houseList.ColAlignment(18) = 2
hfg_houseList.ColAlignment(19) = 2
hfg_houseList.ColAlignment(20) = 2
hfg_houseList.ColAlignment(21) = 2
hfg_houseList.ColAlignment(22) = 2
hfg_houseList.ColAlignment(23) = 2
hfg_houseList.ColAlignment(24) = 2
hfg_houseList.ColAlignment(25) = 2
hfg_houseList.ColAlignment(26) = 2
hfg_houseList.ColAlignment(27) = 2
hfg_houseList.ColAlignment(28) = 2
hfg_houseList.ColAlignment(29) = 2
hfg_houseList.ColAlignment(30) = 2
hfg_houseList.ColAlignment(31) = 2
hfg_houseList.ColAlignment(32) = 2
hfg_houseList.ColAlignment(33) = 2
hfg_houseList.ColAlignment(34) = 2
hfg_houseList.ColAlignment(35) = 2
hfg_houseList.ColAlignment(36) = 2
' hfg_houseList.row = 1
' hfg_houseList.col = hfg_houseList.FixedCols
'
' hfg_houseList.ColSel = 7
'' hfg_houseList.ColSel = hfg_houseList.Cols() - hfg_houseList.FixedCols - 1
'' If i Mod 2 = 0 Then
' hfg_houseList.CellBackColor = &HC0C0C0 ' 浅灰
'' Else
'' hfg_houseList.CellBackColor = vbBlue ' 兰色
'' End If
End Sub
'**************************************
'* 功 能 描 述 :查询记录
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub Query()
Dim ret As Boolean
Dim currentrow As Integer
QueryFom.m_currentQuery = QUERY_EMPLOYEE
QueryFom.m_operateType = 1
QueryFom.show vbModal
m_idList = MainForm.g_application.m_queryResultId
RefreshQueryList ' 显示查询到的结果
End Sub
Private Sub Text15_Change()
hfg_houseList.text = "√"
End Sub
'**************************************
'* 功 能 描 述 :刷新列表的标题栏
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub ChangePrioritySupplier()
Dim i As Integer
' 对每一行供应商进行处理
For i = 1 To hfg_houseList.Rows - 1
If Trim(hfg_houseList.TextMatrix(i, 0)) = "√" And _
i <> m_row Then ' 本行需要处理
hfg_houseList.TextMatrix(i, 0) = "√"
End If
Next i
End Sub
Private Sub RefreshQueryList()
Dim ret As Boolean
' 显示查询到的结果
On Error GoTo EXITFUN
MainForm.g_application.m_databaseCon.m_adoConnection.BeginTrans ' 开始事务
InsertQueryIdList m_idList ' 把要显示的记录ID列表插入临时表
ret = m_EmployeeDAO.FindEmployeeIdList(m_recordset) ' 查找记录
MainForm.g_application.m_databaseCon.m_adoConnection.CommitTrans ' 提交事务
hfg_houseList.clear
hfg_houseList.Rows = 2
RefreshListTitle
If ret Then
GetRecordToList m_recordset
End If
Text1.text = Trim(m_recordset.RecordCount)
m_recordset.Close
Exit Sub
EXITFUN:
MainForm.g_application.m_databaseCon.m_adoConnection.RollbackTrans ' 回滚事务
End Sub
'**************************************
'* 功 能 描 述 :从数据集中取出记录在列表中显示
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub GetRecordToList(recSet As ADODB.Recordset)
Dim currentrow As Integer
With recSet
' hfg_houseList.Rows = m_recordset.RecordCount
currentrow = 1
Do While Not .EOF
If currentrow > hfg_houseList.Rows - 1 Then
hfg_houseList.AddItem ""
End If
'[>>自定义填充内容
hfg_houseList.TextMatrix(currentrow, 35) = Trim(.Fields("员工编号"))
hfg_houseList.TextMatrix(currentrow, 1) = Trim(.Fields("员工姓名"))
hfg_houseList.TextMatrix(currentrow, 36) = Trim(.Fields("密码"))
hfg_houseList.TextMatrix(currentrow, 3) = Trim(.Fields("性别"))
hfg_houseList.TextMatrix(currentrow, 24) = Trim(.Fields("出生年月") & " ")
hfg_houseList.TextMatrix(currentrow, 5) = Trim(.Fields("民族"))
hfg_houseList.TextMatrix(currentrow, 6) = Trim(.Fields("籍贯"))
hfg_houseList.TextMatrix(currentrow, 7) = Trim(.Fields("血型"))
hfg_houseList.TextMatrix(currentrow, 8) = Trim(.Fields("身份证号"))
hfg_houseList.TextMatrix(currentrow, 9) = Trim(.Fields("身高"))
hfg_houseList.TextMatrix(currentrow, 10) = Trim(.Fields("体重"))
hfg_houseList.TextMatrix(currentrow, 11) = Trim(.Fields("户口所在"))
hfg_houseList.TextMatrix(currentrow, 12) = Trim(.Fields("学历"))
hfg_houseList.TextMatrix(currentrow, 13) = Trim(.Fields("专业"))
hfg_houseList.TextMatrix(currentrow, 14) = Trim(.Fields("毕业学校"))
hfg_houseList.TextMatrix(currentrow, 15) = Trim(.Fields("政治面貌"))
hfg_houseList.TextMatrix(currentrow, 16) = Trim(.Fields("语言种类"))
hfg_houseList.TextMatrix(currentrow, 17) = Trim(.Fields("语言种类")) & "%"
hfg_houseList.TextMatrix(currentrow, 18) = Trim(.Fields("计算机水平"))
hfg_houseList.TextMatrix(currentrow, 19) = Trim(.Fields("婚姻状况"))
hfg_houseList.TextMatrix(currentrow, 20) = Trim(.Fields("家庭状况"))
hfg_houseList.TextMatrix(currentrow, 21) = Trim(.Fields("所在部门"))
' hfg_houseList.TextMatrix(currentrow, 21) = "yyy"
hfg_houseList.TextMatrix(currentrow, 22) = Trim(.Fields("职位"))
hfg_houseList.TextMatrix(currentrow, 23) = Trim(.Fields("职称"))
hfg_houseList.TextMatrix(currentrow, 4) = Trim(.Fields("到冈时间"))
hfg_houseList.TextMatrix(currentrow, 25) = Trim(.Fields("公司电话"))
hfg_houseList.TextMatrix(currentrow, 26) = Trim(.Fields("家庭电话"))
hfg_houseList.TextMatrix(currentrow, 27) = Trim(.Fields("移动电话"))
hfg_houseList.TextMatrix(currentrow, 28) = Trim(.Fields("Email"))
hfg_houseList.TextMatrix(currentrow, 29) = Trim(.Fields("紧急通知"))
hfg_houseList.TextMatrix(currentrow, 30) = Trim(.Fields("邮政编码"))
hfg_houseList.TextMatrix(currentrow, 31) = Trim(.Fields("联系地址"))
hfg_houseList.TextMatrix(currentrow, 32) = Trim(.Fields("健康状况"))
hfg_houseList.TextMatrix(currentrow, 33) = Trim(.Fields("备注"))
hfg_houseList.TextMatrix(currentrow, 2) = Trim(.Fields("呢称"))
'<<]
'设置数据行高度(Fixed)
hfg_houseList.RowHeight(currentrow) = 300
'动态集指针加1,同时将计数器加1(Fixed)
.MoveNext
currentrow = currentrow + 1
Loop
End With
Text1.text = Trim(m_recordset.RecordCount)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -