📄 frmmanager.frm
字号:
Caption = "家庭住址:"
Height = 195
Left = 225
TabIndex = 31
Top = 5295
Width = 900
End
Begin VB.Label Label8
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H80000004&
BackStyle = 0 'Transparent
Caption = "移动电话:"
Height = 195
Left = 225
TabIndex = 30
Top = 4890
Width = 900
End
Begin VB.Label Label7
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H80000004&
BackStyle = 0 'Transparent
Caption = "家庭电话:"
Height = 195
Left = 225
TabIndex = 29
Top = 4500
Width = 900
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H80000004&
BackStyle = 0 'Transparent
Caption = "出生日期:"
Height = 195
Left = 225
TabIndex = 28
Top = 2220
Width = 900
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H80000004&
BackStyle = 0 'Transparent
Caption = "姓名:"
Height = 195
Left = 585
TabIndex = 27
Top = 735
Width = 540
End
Begin VB.Label Label10
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H80000004&
BackStyle = 0 'Transparent
Caption = "密码:"
Height = 195
Left = 585
TabIndex = 26
Top = 1140
Width = 540
End
Begin VB.Label Label5
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H80000004&
BackStyle = 0 'Transparent
Caption = "在职时间:"
Height = 195
Left = 225
TabIndex = 25
Top = 2580
Width = 900
End
Begin VB.Label Label3
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H80000018&
Caption = "签名:"
Height = 195
Left = 585
TabIndex = 24
Top = 5640
Width = 540
End
Begin VB.Image imgSign
BorderStyle = 1 'Fixed Single
Height = 1035
Left = 1155
Stretch = -1 'True
ToolTipText = "为保证显示完整,显示图样与原图可能略有变形,不过这并不妨碍在报表中使用"
Top = 5625
Width = 3360
End
End
Begin VB.Frame Frame2
BackColor = &H80000018&
Caption = "工作人员"
Height = 7545
Left = 120
TabIndex = 19
Top = 120
Width = 3900
Begin MSComctlLib.ListView lvwEmployee
Height = 7200
Left = 90
TabIndex = 0
Top = 240
Width = 3705
_ExtentX = 6535
_ExtentY = 12700
View = 3
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = 0 'False
FullRowSelect = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483624
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 2
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "工号"
Object.Width = 2187
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "用户名"
Object.Width = 2540
EndProperty
End
End
End
Attribute VB_Name = "frmManager"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim m_enuOperation As OperationType
Dim m_strMenu As String
Public Sub ShowForm(ByVal strMenu As String)
m_strMenu = strMenu
Me.Show vbModal
End Sub
Private Sub cmdAdd_Click()
'权限验证
If g_blnIsNew Then
If Not g_clsAuthority.CheckOperationAuthority(m_strMenu, INSERT_W) Then GoTo ExitLab
End If
'验证完毕
Call ClearInput
Call EnableInput(True)
Call EnableCommand(False, True)
txtJobNumber.SetFocus
m_enuOperation = Add
ExitLab:
End Sub
Private Sub cmdBrowser_Click()
Dim strFileName As String
strFileName = GetFileName(Me.CommonDialog1, _
"位图(*.bmp),JPEG(*.jpg)|*.bmp;*.jpg|GIF图像(*.gif)|*.gif|图标(*.ico)|*.ico", _
"选择签名图片文件", , READFILE)
If strFileName <> "" Then
Set imgSign.PICTURE = LoadPicture(strFileName)
End If
End Sub
Private Sub cmdDelete_Click()
On Error GoTo ErrMsg
Dim strSQL As String
Dim rsTemp As ADODB.Recordset
Dim i As Integer
Dim blnIsSystemManager As Boolean
Me.MousePointer = vbHourglass
'权限验证
If g_blnIsNew Then
If Not g_clsAuthority.CheckOperationAuthority(m_strMenu, DELETE_W) Then GoTo ExitLab
End If
'验证完毕
If MsgBox("该操作不可恢复!" & vbCrLf & "您确实要删除用户 " _
& lvwEmployee.SelectedItem.Text & " 吗?", _
vbExclamation + vbYesNo + vbDefaultButton2, "警告") = vbNo Then GoTo ExitLab
With lvwEmployee
'检查是否自己
If Mid(.SelectedItem.Key, 2) = CStr(gintManagerID) Then
MsgBox "不能删除自己!", vbExclamation, "提示"
GoTo ExitLab
End If
'删除的是否系统管理员
For i = 0 To lstJS.ListCount - 1
If lstJS.List(i) = "系统管理员" Then
If lstJS.Selected(i) Then
blnIsSystemManager = True
Exit For
End If
End If
Next i
' If blnIsSystemManager Then
' '检查是否最后一个系统管理员
' strSQL = "select Count(*) from "
' End If
'执行删除命令
strSQL = "update RY_Employee set" _
& " Enabled=0" _
& " where EmployeeID=" & CInt(Val(Mid(.SelectedItem.Key, 2)))
GCon.Execute strSQL
'从ListView中删除
Call DeleteItemFromListView(lvwEmployee, .SelectedItem.Index)
End With
GoTo ExitLab
ErrMsg:
MsgBoxW Err
ExitLab:
Me.MousePointer = vbDefault
End Sub
Private Sub cmdDeleteSign_Click()
imgSign.PICTURE = LoadPicture()
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdModify_Click()
'权限验证
If g_blnIsNew Then
If Not g_clsAuthority.CheckOperationAuthority(m_strMenu, UPDATE_W) Then GoTo ExitLab
End If
'验证完毕
Call EnableInput(True)
Call EnableCommand(False, True)
txtJobNumber.SetFocus
m_enuOperation = Modify
ExitLab:
End Sub
Private Sub cmdSave_Click()
On Error GoTo ErrMsg
Dim strSQL As String
Dim rsTemp As ADODB.Recordset
Dim strJobNumber As String
Dim strName As String
Dim i As Integer
Dim blnHave As Boolean
Dim strJSID As String
Dim strKSID As String
Dim intEmployeeID As Integer
Dim dtmNow As Date
Dim itmTemp As ListItem
Dim strTempFile As String
Me.MousePointer = vbHourglass
'工号不能为空
strJobNumber = Trim(txtJobNumber.Text)
txtJobNumber.Text = strJobNumber
If strJobNumber = "" Then
MsgBox "请输入工号!", vbInformation, "提示"
txtJobNumber.SetFocus
GoTo ExitLab
End If
'检查工号是否重复
If strJobNumber <> txtJobNumber.Tag Then
strSQL = "select Count(*) from RY_Employee" _
& " where JobNumber='" & strJobNumber & "'" _
& " and Enabled=1"
Set rsTemp = New ADODB.Recordset
rsTemp.Open strSQL, GCon, adOpenForwardOnly, adLockReadOnly
If rsTemp(0) > 0 Then
MsgBox "您输入的工号已经存在,请核对后重新输入!", vbInformation, "提示"
txtJobNumber.SetFocus
GoTo ExitLab
End If
rsTemp.Close
End If
If txtPassword.Text = "" Then
MsgBox "密码不能等于空"
txtPassword.SetFocus
GoTo ExitLab
End If
'姓名不能为空
strName = Trim(txtName.Text)
txtName.Text = strName
If strName = "" Then
MsgBox "请输入姓名!", vbInformation, "提示"
txtName.SetFocus
GoTo ExitLab
End If
With Combo1
If .Text = "" Then
MsgBox "请设置用户 " & strJobNumber & " 的角色!", vbInformation, "提示"
.SetFocus
GoTo ExitLab
Else
strJSID = .ItemData(.ListIndex)
End If
If .Text = "科室医生" Then
With lstKeShi
For i = 0 To .ListCount - 1
If .Selected(i) Then
strKSID = strKSID & LongToString(.ItemData(i), 2) & ","
End If
Next i
End With
'
'是否选了科室
If strKSID = "" Then
MsgBox "请选择用户 " & strJobNumber & " 管理的科室!", vbInformation, "提示"
GoTo ExitLab
Else
strKSID = Left(strKSID, Len(strKSID) - 1)
End If
End If
End With
' With lstJS
' For i = 0 To .ListCount - 1
' If .Selected(i) Then
' strJSID = strJSID & CStr(.ItemData(i)) & ","
' '是否科室医生
' If .List(i) = "科室医生" Then
' blnHave = True
' End If
' End If
' Next i
'是否选择了角色
' If strJSID = "" Then
' MsgBox "请设置用户 " & strJobNumber & " 的角色!", vbInformation, "提示"
' .SetFocus
' GoTo ExitLab
' Else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -