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

📄 frm_setoperator.frm

📁 企业进销管理系统 好东西 好东西 好东西
💻 FRM
📖 第 1 页 / 共 2 页
字号:
               Top             =   1125
               Width           =   1125
            End
         End
      End
      Begin VB.Frame Frame1 
         Caption         =   "操作员信息"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00008000&
         Height          =   3450
         Left            =   0
         TabIndex        =   5
         Top             =   200
         Width           =   1575
         Begin MSComctlLib.ListView ListView1 
            Height          =   3135
            Left            =   30
            TabIndex        =   6
            Top             =   240
            Width           =   1350
            _ExtentX        =   2381
            _ExtentY        =   5530
            LabelWrap       =   -1  'True
            HideSelection   =   -1  'True
            _Version        =   393217
            Icons           =   "ImageList1"
            ForeColor       =   -2147483640
            BackColor       =   -2147483643
            BorderStyle     =   1
            Appearance      =   1
            NumItems        =   0
         End
      End
   End
   Begin VB.TextBox Text1 
      DataField       =   "M_Name"
      DataSource      =   "Adodc1"
      Height          =   375
      Left            =   6960
      TabIndex        =   3
      Text            =   "Text1"
      Top             =   5760
      Width           =   1215
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   1725
      Top             =   3825
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   28
      ImageHeight     =   28
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   1
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frm_setoperator.frx":00A8
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin VB.CommandButton Cmd_exit 
      Caption         =   "关闭"
      Height          =   350
      Left            =   6975
      TabIndex        =   2
      Top             =   3855
      Width           =   975
   End
   Begin VB.CommandButton Cmd_Cancel 
      Caption         =   "取消"
      Height          =   350
      Left            =   6015
      TabIndex        =   1
      Top             =   3855
      Width           =   975
   End
   Begin VB.CommandButton Cmd_sq 
      Caption         =   "授权"
      Enabled         =   0   'False
      Height          =   350
      Left            =   5055
      TabIndex        =   0
      Top             =   3855
      Width           =   975
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   480
      Top             =   5160
      Width           =   2655
      _ExtentX        =   4683
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      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
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H00800080&
      Height          =   255
      Left            =   480
      TabIndex        =   8
      Top             =   4680
      Width           =   3735
   End
End
Attribute VB_Name = "frm_setoperator"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Dim itmX As ListItem     '定义一个ListItem对象
Dim a, c
Dim key  As String       '定义字符串变量
'*** 单击“取消”按钮的事件过程 ***
Private Sub Cmd_cancel_Click()
    Check1.Value = False
    Check2.Value = False
    Check3.Value = False
    Check4.Value = False
    Check5.Value = False
    Check6.Value = False
    Check7.Value = False
    Check8.Value = False
    Check9.Value = False
    Check10.Value = False
    Check11.Value = False
    Check12.Value = False
    Check13.Value = False
    Check14.Value = False
    Check15.Value = False
    Check16.Value = False
    Check17.Value = False
    Check18.Value = False
    Check19.Value = False
    Check20.Value = False
    Check21.Value = False
End Sub
Private Sub Cmd_exit_Click()
    Unload Me
End Sub

'*** 给操作员授权的事件过程 ***
Private Sub Cmd_sq_Click()
    rtn = SetWindowPos(Me.hwnd, -2, 0, 0, 0, 0, 3)     '运用API函数SetWindowPos,来实现取消窗体置前的功能
    Call Main                                          '调用公共模块中的连接数据库函数
    Adodc1.RecordSource = "select * from tb_enter "    '判断数据库中是否存在该操作员
    '        Adodc1.Refresh
    If Adodc1.Recordset.RecordCount > 0 Then
        c = MsgBox("确认要将所选权限的信息赋给该操作员吗?", 33)
        If c = vbOK Then
            '给操作员分配权限
            Set adoRs = adoCon.Execute("UPDATE tb_enter SET [1]= '" + Str(Check1.Value) + "', [2]= '" + Str(Check2.Value) + "',[3]= '" + Str(Check3.Value) + "',[4]= '" + Str(Check4.Value) + "',[5]= '" & _
                Str(Check5.Value) + "',[6]= '" + Str(Check6.Value) + "',[7]= '" + Str(Check7.Value) + "',[8]= '" + Str(Check8.Value) + "',[9]= '" + Str(Check9.Value) + "',[10]= '" + Str(Check10.Value) + "',[11]= '" & _
                Str(Check11.Value) + "',[12]= '" + Str(Check12.Value) + "',[13]= '" + Str(Check13.Value) + "',[14]= '" + Str(Check14.Value) + "',[15]= '" + Str(Check15.Value) + "',[16]= '" + Str(Check16.Value) + "',[17]= '" & _
                Str(Check17.Value) + "',[18]= '" + Str(Check18.Value) + "',[19]= '" + Str(Check19.Value) + "',[20]= '" + Str(Check20.Value) + "',[21]= '" + Str(Check21.Value) + "',[22]= '" + Str(Check22.Value) + "',[23]= '" + Str(Check23.Value) + "',[24]= '" + Str(Check24.Value) + "' where M_name='" + ListView1.SelectedItem + "'")
            MsgBox "成功授权!!", 48
            Cmd_sq.Enabled = False
        Else
        End If
    End If
    adoCon.Close                                         '关闭数据连接
End Sub

Private Sub Form_Load()
    rtn = SetWindowPos(Me.hwnd, -1, 0, 0, 0, 0, 3)     '运用API函数SetWindowPos,来实现使窗体置前的功能
    '通过代码连接数据库
    Adodc1.ConnectionString = CnnStr
    Adodc1.RecordSource = "select * from tb_enter"        '连接操作员信息表
    Adodc1.Refresh
    Me.Left = (Screen.Width - Me.Width) / 2
    Me.Top = (Screen.Height - Me.Height) / 2
    a = Text1.Text
    Adodc1.RecordSource = "select * from tb_enter"
    Adodc1.Refresh
    If Adodc1.Recordset.RecordCount > 0 Then
        ListView1.Enabled = True
        ListView1.ListItems.Clear                             '刷新ListView控件
        Adodc1.Recordset.MoveFirst
        Do While Adodc1.Recordset.EOF = False                 '向ListView控件中添加操作员信息
            key = Text1.Text
            Set itmX = ListView1.ListItems.Add(, , key, 1)
            Adodc1.Recordset.MoveNext
        Loop
        On Error Resume Next
        Adodc1.RecordSource = "select * from tb_enter where M_Name='" + ListView1.SelectedItem + "'"
        Adodc1.Refresh
        If Adodc1.Recordset.RecordCount > 0 Then             '将操作员所具有的权限信息显示在相应的Check控件当中
            Check1.Value = Adodc1.Recordset.Fields("1")
            Check2.Value = Adodc1.Recordset.Fields("2")
            Check3.Value = Adodc1.Recordset.Fields("3")
            Check4.Value = Adodc1.Recordset.Fields("4")
            Check5.Value = Adodc1.Recordset.Fields("5")
            Check6.Value = Adodc1.Recordset.Fields("6")
            Check7.Value = Adodc1.Recordset.Fields("7")
            Check8.Value = Adodc1.Recordset.Fields("8")
            Check9.Value = Adodc1.Recordset.Fields("9")
            Check10.Value = Adodc1.Recordset.Fields("10")
            Check11.Value = Adodc1.Recordset.Fields("11")
            Check12.Value = Adodc1.Recordset.Fields("12")
            Check13.Value = Adodc1.Recordset.Fields("13")
            Check14.Value = Adodc1.Recordset.Fields("14")
            Check15.Value = Adodc1.Recordset.Fields("14")
            Check16.Value = Adodc1.Recordset.Fields("16")
            Check17.Value = Adodc1.Recordset.Fields("17")
            Check18.Value = Adodc1.Recordset.Fields("18")
            Check19.Value = Adodc1.Recordset.Fields("19")
            Check20.Value = Adodc1.Recordset.Fields("20")
            Check21.Value = Adodc1.Recordset.Fields("21")
            Check22.Value = Adodc1.Recordset.Fields("22")
            Check23.Value = Adodc1.Recordset.Fields("23")
            Check24.Value = Adodc1.Recordset.Fields("24")
        End If
    Else
        ListView1.Enabled = False                            '如果数据库中没有操作员信息,则将ListView控件设置为不可用状态
    End If
    SSTab1.Rows = 2
End Sub

'*** 单击ListView控件将在Check控件中显示相应的权限 ***
Private Sub ListView1_Click()
    Cmd_sq.Enabled = True
    Adodc1.RecordSource = "select * from tb_enter where M_Name='" + ListView1.SelectedItem + "'"
    Adodc1.Refresh
    On Error Resume Next
    If Adodc1.Recordset.RecordCount > 0 Then
        '在标签控件中显示操作员的职务信息
        Label1.Caption = "当前所选操作员 " & Adodc1.Recordset.Fields("M_Name") & " 的职务为: " & Adodc1.Recordset.Fields("M_zw")
        Frame3.Caption = "操作员 " + Trim(ListView1.SelectedItem.Text) + " 的权限设置"
        Check1.Value = Adodc1.Recordset.Fields("1")
        Check2.Value = Adodc1.Recordset.Fields("2")
        Check3.Value = Adodc1.Recordset.Fields("3")
        Check4.Value = Adodc1.Recordset.Fields("4")
        Check5.Value = Adodc1.Recordset.Fields("5")
        Check6.Value = Adodc1.Recordset.Fields("6")
        Check7.Value = Adodc1.Recordset.Fields("7")
        Check8.Value = Adodc1.Recordset.Fields("8")
        Check9.Value = Adodc1.Recordset.Fields("9")
        Check10.Value = Adodc1.Recordset.Fields("10")
        Check11.Value = Adodc1.Recordset.Fields("11")
        Check12.Value = Adodc1.Recordset.Fields("12")
        Check13.Value = Adodc1.Recordset.Fields("13")
        Check14.Value = Adodc1.Recordset.Fields("14")
        Check15.Value = Adodc1.Recordset.Fields("14")
        Check16.Value = Adodc1.Recordset.Fields("16")
        Check17.Value = Adodc1.Recordset.Fields("17")
        Check18.Value = Adodc1.Recordset.Fields("18")
        Check19.Value = Adodc1.Recordset.Fields("19")
        Check20.Value = Adodc1.Recordset.Fields("20")
        Check21.Value = Adodc1.Recordset.Fields("21")
        Check22.Value = Adodc1.Recordset.Fields("22")
        Check23.Value = Adodc1.Recordset.Fields("23")
        Check24.Value = Adodc1.Recordset.Fields("24")
    End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
   frm_main.Enabled = True                              '当关闭窗体的时候使主窗体变为可用状态
End Sub

⌨️ 快捷键说明

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