📄 frmaddoperator.frm
字号:
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 4260
TabIndex = 13
Top = 2190
Width = 390
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "*"
Height = 180
Left = 6240
TabIndex = 12
Top = 780
Width = 90
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "*"
Height = 180
Left = 6240
TabIndex = 11
Top = 1230
Width = 90
End
Begin VB.Label Label9
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "操作员名单 (请增加/保留至少一名系统级操作员)"
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 300
TabIndex = 10
Top = 270
Width = 4515
End
End
End
End
Attribute VB_Name = "frmAddOperator"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'CSEH: sunsgErr
Option Explicit
'##ModelId=3D3384FA016E
Private coperator As rsclsOperator
'##ModelId=3D3384FA038B
Private bndOP As New BindingCollection
'##ModelId=3D3384FB01A0
Private mbOPAddNew As Boolean
'##ModelId=3D3384FB0223
Private Sub cboOpLevel_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
cmdUpdate.SetFocus
End If
End Sub
'##ModelId=3D3384FB02D7
Private Sub cmdAdd_Click()
'<EhHeader>
On Error GoTo cmdAdd_Click_Err
'</EhHeader>
If mbOPAddNew = True Then
Exit Sub
End If
coperator.AddRecord
mbOPAddNew = True
txtNO.SetFocus
'<EhFooter>
Exit Sub
cmdAdd_Click_Err:
LockErrorShow
'</EhFooter>
End Sub
'##ModelId=3D3384FB0313
Private Sub cmdDelete_Click()
'<EhHeader>
On Error GoTo cmdDelete_Click_Err
'</EhHeader>
If mbOPAddNew = True Or coperator.EOF Or coperator.RecordCount = 0 Then
Exit Sub
End If
coperator.Delete
coperator.UpdateBatch
'<EhFooter>
Exit Sub
cmdDelete_Click_Err:
LockErrorShow
'</EhFooter>
End Sub
'##ModelId=3D3384FB033B
Private Sub cmdUpdate_Click()
'<EhHeader>
On Error GoTo cmdUpdate_Click_Err
'</EhHeader>
If txtNO.Text = "" Then
StatusShow ("内部编号不能为空")
Exit Sub
End If
If txtOpName.Text = "" Then
StatusShow ("名称不能为空")
Exit Sub
End If
If coperator.RecordCount = 0 And mbOPAddNew = False Then
StatusShow ("请先点击""增加""按纽")
txtOpName.Text = ""
Exit Sub
End If
If RTrim(LTrim(txtOpPassword.Text)) = "" Then
coperator.Password = "PASS"
End If
coperator.OperateLevel = "系统级"
coperator.UpdateBatch
coperator.MoveLast
mbOPAddNew = False
cmdAdd.SetFocus
Exit Sub
'<EhFooter>
Exit Sub
cmdUpdate_Click_Err:
LockErrorShow
coperator.CancelUpdate
'</EhFooter>
End Sub
'##ModelId=3D3384FB036D
Private Sub Form_Load()
'<EhHeader>
On Error GoTo Form_Load_Err
'</EhHeader>
Me.Top = (mainForm.ScaleHeight - Me.Height) / 2
Me.Left = (mainForm.ScaleWidth - Me.Width) / 2
SSPanel1.PictureBackground = mainForm.Pic.Picture
SSPanel1.PictureBackgroundStyle = ssTiled
Set coperator = New rsclsOperator
coperator.SaveMode = adBatch
With bndOP
.DataMember = ""
Set .DataSource = coperator
.Add txtOpName, "Text", "Operator"
.Add txtNO, "Text", "Alias"
.Add txtOpDept, "Text", "Dept"
.Add txtOpPassword, "Text", "Password"
End With
Set grdOperator.DataSource = coperator
'<EhFooter>
Exit Sub
Form_Load_Err:
LockErrorShow
'</EhFooter>
End Sub
'##ModelId=3D3384FB0395
Private Sub Form_Unload(Cancel As Integer)
'<EhHeader>
On Error GoTo Form_Unload_Err
'</EhHeader>
Set grdOperator.DataSource = Nothing
If mbOPAddNew = True Then
coperator.CancelUpdate
mbOPAddNew = False
End If
Set coperator = Nothing
Set bndOP = Nothing
StatusShow ("")
'<EhFooter>
Exit Sub
Form_Unload_Err:
LockErrorShow
'</EhFooter>
End Sub
'##ModelId=3D3384FC0025
Private Sub txtNo_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
txtOpName.SetFocus
End If
End Sub
'##ModelId=3D3384FC00E4
Private Sub txtOpDept_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
txtOpPassword.SetFocus
End If
End Sub
'##ModelId=3D3384FC0198
Private Sub txtOpName_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
txtOpDept.SetFocus
End If
End Sub
'##ModelId=3D3384FC024C
Private Sub txtOpPassword_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
cmdAdd.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -