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

📄 frmuserman.frm

📁 本系统为汽车销售系统
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form frmuserman 
   Caption         =   "Form1"
   ClientHeight    =   4620
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6255
   LinkTopic       =   "Form1"
   ScaleHeight     =   4620
   ScaleWidth      =   6255
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmd_modi 
      Caption         =   "修改用户"
      Height          =   495
      Left            =   3600
      TabIndex        =   5
      Top             =   1920
      Width           =   1455
   End
   Begin VB.CommandButton cmd_del 
      Caption         =   "删除用户"
      Height          =   495
      Left            =   3600
      TabIndex        =   4
      Top             =   2640
      Width           =   1455
   End
   Begin VB.CommandButton cmd_close 
      Caption         =   "取   消"
      Height          =   495
      Left            =   3600
      TabIndex        =   3
      Top             =   3360
      Width           =   1455
   End
   Begin VB.CommandButton cmd_add 
      Caption         =   "添加用户"
      Height          =   495
      Left            =   3600
      TabIndex        =   2
      Top             =   1200
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      Caption         =   "用户列表"
      Height          =   2655
      Left            =   360
      TabIndex        =   0
      Top             =   1080
      Width           =   2775
      Begin MSDataListLib.DataList DataList1 
         Bindings        =   "frmuserman.frx":0000
         Height          =   2160
         Left            =   120
         TabIndex        =   1
         Top             =   240
         Width           =   2535
         _ExtentX        =   4471
         _ExtentY        =   3810
         _Version        =   393216
         ListField       =   "username"
         BoundColumn     =   "username"
      End
   End
   Begin MSAdodcLib.Adodc Adouserlist 
      Height          =   495
      Left            =   360
      Top             =   360
      Visible         =   0   'False
      Width           =   2415
      _ExtentX        =   4260
      _ExtentY        =   873
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "dsn=413"
      OLEDBString     =   "dsn=413"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from users"
      Caption         =   "Adouserlist"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
End
Attribute VB_Name = "frmuserman"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_Add_Click()
  With frmuseredit
  .txtusername = ""
  .txtpass = ""
  .txtpass2 = ""
  .Modify = False
  .Show 1
  End With
 Adouserlist.Refresh
  DataList1_Click
End Sub

Private Sub Cmd_close_Click()
  Unload Me
End Sub

Private Sub Cmd_Del_Click()
  If DataList1.Text = "" Then
    MsgBox "请选择要删除的用户"
    Exit Sub
  End If
  If MyUser.UserName = "Admin" Then
    MsgBox "此用户不能删除"
    Exit Sub
  End If
  '确认删除
  If MsgBox("是否删除当前用户", vbYesNo, "请确认") = vbYes Then
    MyUser.Delete (DataList1.Text)
    Adouserlist.Refresh
    DataList1_Click
    MsgBox "成功删除"
  End If
End Sub

Private Sub Cmd_Modi_Click()
  If DataList1.Text = "" Then
    MsgBox "请选择要修改的用户"
    Exit Sub
  End If
  
  With frmuseredit
  .OriUser = MyUser.UserName
  .txtusername = MyUser.UserName
  .txtpass = MyUser.Pwd
  .txtpass2 = MyUser.Pwd
  
  
  If Format(MyUser.UserName, "<") = "admin" Then
    .txtusername.Enabled = False
  End If
  
  .Modify = True
  .Show 1
  End With
  Adouserlist.Refresh
  DataList1_Click
End Sub

Private Sub DataList1_Click()
  If DataList1.Text = "" Then
    Exit Sub
  End If
  '读取用户数据
  MyUser.GetInfo (DataList1.Text)
  lblUserName = MyUser.UserName
  If Format(MyUser.UserName, ">") = "admin" Then
    lblUserType = "系统管理员"
  Else
    lblUserType = "普通用户"
  End If
End Sub

Private Sub Form_Load()
  lblUserType = ""
  lblUserName = ""
End Sub

⌨️ 快捷键说明

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