📄 frmuseredit.frm
字号:
VERSION 5.00
Begin VB.Form frmUserEdit
BorderStyle = 3 'Fixed Dialog
Caption = "用户编辑窗体"
ClientHeight = 3975
ClientLeft = 45
ClientTop = 435
ClientWidth = 5940
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3975
ScaleWidth = 5940
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.ListBox List1
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00008000&
Height = 3360
ItemData = "frmUserEdit.frx":0000
Left = 3240
List = "frmUserEdit.frx":0022
Style = 1 'Checkbox
TabIndex = 8
Top = 480
Width = 2535
End
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 375
Left = 1800
TabIndex = 7
Top = 3120
Width = 1095
End
Begin VB.CommandButton cmdok
Caption = "确定"
Height = 375
Left = 360
TabIndex = 6
Top = 3120
Width = 1095
End
Begin VB.TextBox txtpassword2
Height = 375
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 5
Top = 2160
Width = 1335
End
Begin VB.TextBox txtpassword
Height = 375
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 4
Top = 1560
Width = 1335
End
Begin VB.TextBox txtname
Height = 375
Left = 1560
TabIndex = 3
Top = 960
Width = 1335
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "用户编辑与权限设置窗体"
BeginProperty Font
Name = "隶书"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 9
Top = 0
Width = 3495
End
Begin VB.Shape Shape1
BackColor = &H00FFFFFF&
BorderColor = &H00FFFFFF&
Height = 3375
Left = 120
Top = 480
Width = 2895
End
Begin VB.Label Label3
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "确认密码:"
BeginProperty Font
Name = "隶书"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 240
TabIndex = 2
Top = 2160
Width = 1215
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "密码:"
BeginProperty Font
Name = "隶书"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 240
TabIndex = 1
Top = 1560
Width = 1215
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "用户名:"
BeginProperty Font
Name = "隶书"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 240
TabIndex = 0
Top = 960
Width = 1215
End
End
Attribute VB_Name = "frmUserEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public modify As Boolean
Public oriname As String
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Function check() As Boolean
If Trim(txtname) = "" Then
MsgBox "请输入用户名"
txtname.SetFocus
check = False
Exit Function
End If
If Trim(txtpassword) = "" Then
MsgBox "请输入密码"
txtpassword.SetFocus
check = False
Exit Function
End If
If Trim(txtpassword2) = "" Then
MsgBox "请输入确认密码"
txtpassword2.SetFocus
check = False
Exit Function
End If
If Trim(txtpassword2) <> Trim(txtpassword) Then
MsgBox "两次输入的密码不合,请重新输入"
txtpassword = ""
txtpassword2 = ""
txtpassword.SetFocus
check = False
Exit Function
End If
If Len(Trim(txtpassword2)) < 6 Then
MsgBox "密码小于6位,请重新设置"
txtpassword.Text = ""
txtpassword2.Text = ""
txtpassword.SetFocus
check = False
Exit Function
End If
check = True
End Function
Private Sub cmdOK_Click()
If check = False Then
Exit Sub
End If
With myusers
.Name = txtname.Text
.Password = txtpassword.Text
If List1.Selected(0) = True Then
.EngineerUse = "有权限"
Else
.EngineerUse = "无权限"
End If
If List1.Selected(1) = True Then
.PurchaseUse = "有权限"
Else
.PurchaseUse = "无权限"
End If
If List1.Selected(2) = True Then
.SalesUse = "有权限"
Else
.SalesUse = "无权限"
End If
If List1.Selected(3) = True Then
.StocksUse = "有权限"
Else
.StocksUse = "无权限"
End If
If List1.Selected(4) = True Then
.ManpowerUse = "有权限"
Else
.ManpowerUse = "无权限"
End If
If List1.Selected(5) = True Then
.ClientUse = "有权限"
Else
.ClientUse = "无权限"
End If
If List1.Selected(6) = True Then
.ManageUse = "有权限"
Else
.ManageUse = "无权限"
End If
If List1.Selected(7) = True Then
.ManageDindan = "有权限"
Else
.ManageDindan = "无权限"
End If
If List1.Selected(8) = True Then
.Chenbenheshuan = "有权限"
Else
.Chenbenheshuan = "无权限"
End If
If List1.Selected(9) = True Then
.Jinxiaochun = "有权限"
Else
.Jinxiaochun = "无权限"
End If
If modify = False Then
If .IN_DB(txtname.Text) = True Then
MsgBox "用户已存在,请重新设置"
txtname.SetFocus
txtname.SelStart = 0
txtname.SelLength = Len(txtname)
Exit Sub
Else
.insert
MsgBox "添加成功"
End If
Else
.update (oriname)
MsgBox "修改成功"
End If
End With
Unload Me
End Sub
Private Sub Form_Load()
frmUserEdit.BackColor = RGB(77, 116, 244)
End Sub
Private Sub txtpassword2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
cmdOK_Click
Else
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -