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

📄 frmuserman.frm

📁 电脑销售管理系统是典型的信息管理系统(MIS)
💻 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         =   "用户管理"
   ClientHeight    =   3675
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7110
   LinkTopic       =   "Form1"
   ScaleHeight     =   3675
   ScaleWidth      =   7110
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmd_back 
      Caption         =   "返回"
      Height          =   495
      Left            =   5640
      MouseIcon       =   "FrmUserMan.frx":0000
      MousePointer    =   99  'Custom
      TabIndex        =   12
      Top             =   3000
      Width           =   1215
   End
   Begin VB.CommandButton cmd_del 
      Caption         =   "删除用户"
      Height          =   495
      Left            =   3960
      MouseIcon       =   "FrmUserMan.frx":030A
      MousePointer    =   99  'Custom
      TabIndex        =   11
      Top             =   3000
      Width           =   1215
   End
   Begin VB.CommandButton cmd_modi 
      Caption         =   "修改用户"
      Height          =   495
      Left            =   2040
      MouseIcon       =   "FrmUserMan.frx":0614
      MousePointer    =   99  'Custom
      TabIndex        =   10
      Top             =   3000
      Width           =   1215
   End
   Begin VB.CommandButton cmd_add 
      Caption         =   "添加用户"
      Height          =   495
      Left            =   360
      MouseIcon       =   "FrmUserMan.frx":091E
      MousePointer    =   99  'Custom
      TabIndex        =   9
      Top             =   3000
      Width           =   1215
   End
   Begin VB.Frame Frame2 
      Caption         =   "用户信息"
      Height          =   2535
      Left            =   3000
      TabIndex        =   2
      Top             =   240
      Width           =   3975
      Begin VB.Label lblEmpName 
         AutoSize        =   -1  'True
         Caption         =   "lblEmpName"
         Height          =   180
         Left            =   1200
         TabIndex        =   8
         Top             =   1560
         Width           =   900
      End
      Begin VB.Label lblUserType 
         AutoSize        =   -1  'True
         Caption         =   "lblUserType"
         Height          =   180
         Left            =   1200
         TabIndex        =   7
         Top             =   960
         Width           =   990
      End
      Begin VB.Label lblUserName 
         AutoSize        =   -1  'True
         Caption         =   "lblEmpState"
         Height          =   180
         Left            =   1200
         TabIndex        =   6
         Top             =   360
         Width           =   990
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "员工姓名:"
         Height          =   180
         Left            =   240
         TabIndex        =   5
         Top             =   1560
         Width           =   900
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "用户类型:"
         Height          =   180
         Left            =   240
         TabIndex        =   4
         Top             =   960
         Width           =   900
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "用户名:"
         Height          =   180
         Left            =   360
         TabIndex        =   3
         Top             =   360
         Width           =   720
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "用户列表"
      Height          =   2535
      Left            =   240
      MouseIcon       =   "FrmUserMan.frx":0C28
      TabIndex        =   0
      Top             =   240
      Width           =   2415
      Begin MSDataListLib.DataList DataList1 
         Bindings        =   "FrmUserMan.frx":0F32
         Height          =   2160
         Left            =   120
         TabIndex        =   1
         Top             =   240
         Width           =   2175
         _ExtentX        =   3836
         _ExtentY        =   3810
         _Version        =   393216
         ListField       =   "username"
      End
   End
   Begin MSAdodcLib.Adodc AdoUserList 
      Height          =   330
      Left            =   0
      Top             =   120
      Visible         =   0   'False
      Width           =   1815
      _ExtentX        =   3201
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   1
      LockType        =   3
      CommandType     =   2
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   3
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "DSN=stocks"
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   "stocks"
      OtherAttributes =   ""
      UserName        =   "sa"
      Password        =   "sa"
      RecordSource    =   "Users"
      Caption         =   "Adodc1"
      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 = ""
  .txtEname = ""
  .Modify = False
  .Show 1
  End With
  AdoUserList.Refresh
  DataList1_Click
End Sub

Private Sub Cmd_Back_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
  .txtEname = MyUser.EmpName
  
  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
  lblEmpName = MyUser.EmpName
  If Format(MyUser.UserName, ">") = "admin" Then
    lblUserType = "系统管理员"
  Else
    lblUserType = "普通用户"
  End If
End Sub

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

⌨️ 快捷键说明

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