⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmuseredit.frm

📁 本系统为汽车销售系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmuseredit 
   Caption         =   "编辑用户信息"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4560
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4560
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmd_close 
      Caption         =   "取   消"
      Height          =   375
      Left            =   2520
      TabIndex        =   8
      Top             =   2640
      Width           =   1095
   End
   Begin VB.CommandButton cmd_ok 
      Caption         =   "确   定"
      Height          =   375
      Left            =   840
      TabIndex        =   7
      Top             =   2640
      Width           =   1095
   End
   Begin VB.Frame Frame1 
      Height          =   2295
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   4215
      Begin VB.TextBox txtpass2 
         Height          =   375
         Left            =   1200
         TabIndex        =   6
         Text            =   " "
         Top             =   1560
         Width           =   2295
      End
      Begin VB.TextBox txtpass 
         Height          =   375
         Left            =   1200
         TabIndex        =   4
         Text            =   " "
         Top             =   960
         Width           =   2295
      End
      Begin VB.TextBox txtusername 
         Height          =   375
         Left            =   1200
         TabIndex        =   2
         Text            =   " "
         Top             =   360
         Width           =   2295
      End
      Begin VB.Label Label3 
         Caption         =   "确认密码"
         Height          =   375
         Left            =   240
         TabIndex        =   5
         Top             =   1560
         Width           =   735
      End
      Begin VB.Label Label2 
         Caption         =   "密    码"
         Height          =   375
         Left            =   240
         TabIndex        =   3
         Top             =   960
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "用 户 名"
         Height          =   375
         Left            =   240
         TabIndex        =   1
         Top             =   360
         Width           =   1095
      End
   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 OriUser As String

Private Sub Cmd_close_Click()
  Unload Me
End Sub

Private Sub Cmd_OK_Click()
  If Trim(txtusername) = "" Then
    MsgBox "请输入用户名"
    txtusername.SetFocus
    Exit Sub
  End If
  If Len(txtpass) < 6 Then
    MsgBox "密码长度不能小于6"
    txtpass.SetFocus
    txtpass.SelStart = 0
    txtpass.SelLength = Len(txtpass2)
    Exit Sub
  End If
  If txtpass <> txtpass2 Then
    MsgBox "密码和确认密码不相同,请重新确认"
    txtpass2.SetFocus
    txtpass2.SelStart = 0
    txtpass2.SelLength = Len(txtpass2)
    Exit Sub
  End If
  
  
  With MyUser
  If Modify = False Or OriUser <> Trim(txtusername) Then
    If .In_DB(MakeStr(txtusername)) = True Then
      MsgBox "用户名已经存在,请重新输入"
      txtusername.SetFocus
      txtusername.SelStart = 0
      txtusername.SelLength = Len(txtusername)
      Exit Sub
    End If
  End If
  .UserName = MakeStr(txtusername)
  .Pwd = MakeStr(txtpass)
  
  If Modify = False Then
    .Insert
    MsgBox "添加完成"
  Else
    .Update (OriUser)
    MsgBox "修改完成"
    '如果修改自身用户名,则更新CurUser对象
    If OriUser = CurUser.UserName And Trim(txtusername) <> OriUser Then
      CurUser.UserName = Trim(txtusername)
      CurUser.GetInfo (CurUser.UserName)
    End If
  End If
  End With
  Unload Me
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -