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

📄 frmsuper.frm

📁 主要功能如题
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmSuper 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "系统管理员"
   ClientHeight    =   4710
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4665
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   9
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmSuper.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4710
   ScaleWidth      =   4665
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   4095
      Top             =   360
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   29
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":000C
            Key             =   "sz"
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":03A6
            Key             =   "dy"
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":0740
            Key             =   "yl"
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":0ADA
            Key             =   "xg"
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":0E74
            Key             =   "zh"
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":120E
            Key             =   "sh"
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":15A8
            Key             =   "bc"
         EndProperty
         BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":1942
            Key             =   "fq"
         EndProperty
         BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":1CDC
            Key             =   "bz"
         EndProperty
         BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":2076
            Key             =   "tc"
         EndProperty
         BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":2410
            Key             =   "bcgs"
         EndProperty
         BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":27AA
            Key             =   "mrlk"
         EndProperty
         BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":2B44
            Key             =   "xsxm"
         EndProperty
         BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":2EDE
            Key             =   "first"
         EndProperty
         BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":3278
            Key             =   "prev"
         EndProperty
         BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":3612
            Key             =   "next"
         EndProperty
         BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":39AC
            Key             =   "last"
         EndProperty
         BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":3D46
            Key             =   "xx"
         EndProperty
         BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":40E0
            Key             =   "define"
         EndProperty
         BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":447A
            Key             =   "exec"
         EndProperty
         BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":4814
            Key             =   "xz"
         EndProperty
         BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":4BAE
            Key             =   "sc"
         EndProperty
         BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":4F48
            Key             =   "sx"
         EndProperty
         BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":52E2
            Key             =   "cx"
         EndProperty
         BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":567C
            Key             =   "zd"
         EndProperty
         BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":5A16
            Key             =   "dz"
         EndProperty
         BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":5DB0
            Key             =   "ph"
         EndProperty
         BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":614A
            Key             =   "fz"
         EndProperty
         BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSuper.frx":64E4
            Key             =   "dw"
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.Toolbar SzToolbar 
      Align           =   1  'Align Top
      Height          =   555
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   4665
      _ExtentX        =   8229
      _ExtentY        =   979
      ButtonWidth     =   820
      ButtonHeight    =   926
      AllowCustomize  =   0   'False
      Appearance      =   1
      Style           =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   5
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "新增"
            Key             =   "add"
            Object.ToolTipText     =   "新增系统管理员"
            ImageKey        =   "xz"
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "修改"
            Key             =   "modify"
            Object.ToolTipText     =   "修改系统管理员资料"
            ImageKey        =   "xg"
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "删除"
            Key             =   "del"
            Object.ToolTipText     =   "删除系统管理员"
            ImageKey        =   "sc"
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   4
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "关闭"
            Key             =   "close"
            Object.ToolTipText     =   "关闭"
            ImageKey        =   "tc"
         EndProperty
      EndProperty
      BorderStyle     =   1
   End
   Begin VB.PictureBox Gridbrowser 
      BackColor       =   &H80000005&
      FillStyle       =   0  'Solid
      ForeColor       =   &H80000008&
      Height          =   4020
      Left            =   45
      ScaleHeight     =   3960
      ScaleWidth      =   4515
      TabIndex        =   1
      Top             =   630
      Width           =   4575
   End
End
Attribute VB_Name = "frmSuper"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*******************************************************
'*    模 块 名 称 :管理员管理
'*    功 能 描 述 :
'*    程序员姓名  :谭怀志
'*    最后修改人  :谭怀志
'*    最后修改时间:2003/6/26
'*    备        注:
'*******************************************************

Option Explicit

Private Sub Form_Load()
    
    On Error GoTo VBError
    
    '初始化网格
    With Gridbrowser
     
        .RowHeight(0) = 350
        .ColAlignment(0) = flexAlignLeftCenter
        .Cols = 3
        .FixedRows = 1
        .SelectionMode = flexSelectionListBox
        .AllowUserResizing = flexResizeColumns
        .ExplorerBar = flexExSort
        
        .ColWidth(0) = 1500
        .ColWidth(1) = 3000
        
        .TextMatrix(0, 0) = "管理员ID"
        .TextMatrix(0, 1) = "管理员姓名"
        .TextMatrix(0, 2) = ""

        .ColHidden(2) = True
        
        .Rows = .FixedRows
        .Redraw = False
        
    End With
    
    On Error GoTo ADOError
    
    '显示所有管理员
    strQry = "select * from JFoperator"
    Set rstCustomers = GetRecordSet(cnnConnection, strQry)
    
    While Not rstCustomers.EOF
        
        With Gridbrowser
            
            .AddItem ""
            .RowHeight(.Rows - 1) = 350
            .TextMatrix(.Rows - 1, 0) = rstCustomers!OperID
            .TextMatrix(.Rows - 1, 1) = rstCustomers!Name
            .TextMatrix(.Rows - 1, 2) = Cipher(CODEPASSWORD, rstCustomers!password)
            
        End With
        
        rstCustomers.MoveNext
        
    Wend
    
    Gridbrowser.Redraw = True
    
    Exit Sub
    
VBError:
    DisplayVBError
    Exit Sub
ADOError:
    DisplayADOError cnnConnection

End Sub

Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)

    Dim i As Long
    
    On Error GoTo VBError
    
    Select Case Button.Key
    Case "add"
        
        '新增管理员
        Load frmSuperEdit
        frmSuperEdit.Tag = "AddNew"
        frmSuperEdit.Show vbModal
        
    Case "modify"
    
        '修改管理员
        If Gridbrowser.TextMatrix(Gridbrowser.RowSel, 0) <> "" And Gridbrowser.RowSel > 0 Then
        
            If Gridbrowser.TextMatrix(Gridbrowser.RowSel, 0) <> strOperatorID Then
                MsgBox "禁止修改其它管理员的资料!", vbCritical, ERRCAPTION
                Exit Sub
            End If
            
            Load frmSuperEdit
            
            With Gridbrowser
            
                frmSuperEdit.Tag = "Modify"
                frmSuperEdit!txtOperID.Text = .TextMatrix(.RowSel, 0)
                frmSuperEdit!txtName.Text = .TextMatrix(.RowSel, 1)
                frmSuperEdit!txtFirstPass.Text = .TextMatrix(.RowSel, 2)
                frmSuperEdit!txtSecPass.Text = .TextMatrix(.RowSel, 2)
            
            End With
            
            frmSuperEdit.Show vbModal
            
        End If
        
    Case "del"
        
        '删除管理员
        On Error GoTo ADOError
        
        '无选中项目时退出子过程
        If Gridbrowser.TextMatrix(Gridbrowser.RowSel, 0) = "" Or Gridbrowser.RowSel < 1 Then
            Exit Sub
        End If
        
        If MsgBox("确定删除所选的管理员吗?", vbOKCancel + vbDefaultButton2, SYSCAPTION) = vbNo Then
            Exit Sub
        End If
            
        For i = Gridbrowser.Rows - 1 To 1 Step -1
                
            If Gridbrowser.IsSelected(i) Then
                    
                If Gridbrowser.TextMatrix(i, 0) = strOperatorID Then
                
                    '当前管理员不允许删除
                    MsgBox "当前管理员不能删除!", vbCritical, ERRCAPTION
                Else
                    strQry = "select OperID from RFDorig where OperID='" & Gridbrowser.TextMatrix(i, 0) & "'"
                    Set rstCustomers = GetRecordSet(cnnConnection, strQry)
                            
                    If rstCustomers.RecordCount <> 0 Then
                    
                        '已经使用的管理员不能删除
                        MsgBox "不能删除已经使用的管理员!", vbCritical, ERRCAPTION
                    Else
                        cnnConnection.Execute ("delete from JFoperator where OperID='" & Gridbrowser.TextMatrix(i, 0) & "'")
                        Gridbrowser.RemoveItem i
                    End If
                            
                End If
                        
            End If
                    
        Next i
        
    Case "close"
    
        Unload Me
        
    End Select
    
    Exit Sub
    
VBError:
    DisplayVBError
    Exit Sub
ADOError:
    DisplayADOError cnnConnection
        
End Sub

⌨️ 快捷键说明

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