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

📄 main_xtgl_qxgl.frm

📁 是基于C#语言的一个图书综合管理系统的开发案例,相当实用
💻 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 main_xtgl_qxgl 
   BackColor       =   &H00C1FFEB&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "系统管理-【权限管理】"
   ClientHeight    =   2910
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6720
   Icon            =   "main_xtgl_qxgl.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2910
   ScaleWidth      =   6720
   StartUpPosition =   1  '所有者中心
   Begin VB.Frame Frame1 
      BackColor       =   &H00C1FFEB&
      Height          =   615
      Left            =   1875
      TabIndex        =   11
      Top             =   2250
      Width           =   4695
      Begin VB.CommandButton Command5 
         Caption         =   "删除操作员"
         Height          =   360
         Left            =   60
         TabIndex        =   16
         Top             =   180
         Width           =   1095
      End
      Begin VB.CommandButton Command4 
         Caption         =   "退出"
         Height          =   360
         Left            =   3720
         TabIndex        =   15
         Top             =   180
         Width           =   870
      End
      Begin VB.CommandButton Command3 
         Caption         =   "确定"
         Height          =   360
         Left            =   2880
         TabIndex        =   14
         Top             =   180
         Width           =   870
      End
      Begin VB.CommandButton Command2 
         Caption         =   "全不选"
         Height          =   360
         Left            =   2010
         TabIndex        =   13
         Top             =   180
         Width           =   870
      End
      Begin VB.CommandButton Command1 
         Caption         =   "全选"
         Height          =   360
         Left            =   1155
         TabIndex        =   12
         Top             =   180
         Width           =   870
      End
   End
   Begin VB.Frame Frame4 
      BackColor       =   &H00C1FFEB&
      Caption         =   "操作员级别"
      Height          =   615
      Left            =   45
      TabIndex        =   9
      Top             =   2250
      Width           =   1770
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   165
         TabIndex        =   10
         Text            =   "Combo1"
         Top             =   195
         Width           =   1425
      End
   End
   Begin VB.Frame Frame3 
      BackColor       =   &H00C1FFEB&
      Caption         =   "操作员列表"
      Height          =   2115
      Left            =   45
      TabIndex        =   7
      Top             =   75
      Width           =   1770
      Begin MSDataListLib.DataList DataList1 
         Bindings        =   "main_xtgl_qxgl.frx":0CCA
         Height          =   1740
         Left            =   120
         TabIndex        =   8
         Top             =   240
         Width           =   1425
         _ExtentX        =   2514
         _ExtentY        =   3069
         _Version        =   393216
         ListField       =   "操作员"
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   1215
      Top             =   3855
      Visible         =   0   'False
      Width           =   1260
      _ExtentX        =   2223
      _ExtentY        =   582
      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         =   ""
      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.Frame Frame2 
      BackColor       =   &H00C1FFEB&
      Caption         =   "权限设置"
      Height          =   2115
      Left            =   1875
      TabIndex        =   0
      Top             =   105
      Width           =   4740
      Begin VB.CheckBox Check1 
         BackColor       =   &H00C1FFEB&
         Caption         =   "系统管理"
         Height          =   240
         Index           =   4
         Left            =   2325
         TabIndex        =   6
         Top             =   390
         Width           =   1095
      End
      Begin VB.CheckBox Check1 
         BackColor       =   &H00C1FFEB&
         Caption         =   "基础信息管理"
         Height          =   240
         Index           =   0
         Left            =   285
         TabIndex        =   5
         Top             =   375
         Width           =   1410
      End
      Begin VB.CheckBox Check1 
         BackColor       =   &H00C1FFEB&
         Caption         =   "图书管理"
         Height          =   240
         Index           =   1
         Left            =   300
         TabIndex        =   4
         Top             =   795
         Width           =   1065
      End
      Begin VB.CheckBox Check1 
         BackColor       =   &H00C1FFEB&
         Caption         =   "借阅管理"
         Height          =   240
         Index           =   2
         Left            =   300
         TabIndex        =   3
         Top             =   1200
         Width           =   1155
      End
      Begin VB.CheckBox Check1 
         BackColor       =   &H00C1FFEB&
         Caption         =   "决策分析"
         Height          =   240
         Index           =   3
         Left            =   300
         TabIndex        =   2
         Top             =   1605
         Width           =   1095
      End
      Begin VB.CheckBox Check1 
         BackColor       =   &H00C1FFEB&
         Caption         =   "系统维护"
         Height          =   240
         Index           =   5
         Left            =   2325
         TabIndex        =   1
         Top             =   795
         Width           =   1095
      End
   End
End
Attribute VB_Name = "main_xtgl_qxgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i, a As Integer      '声明整型变量
Dim rs1 As New ADODB.Recordset     '声明数据集对象
Private Sub Find()     '声明过程
 '查询操作员级别
 Adodc1.RecordSource = "select * from qxb where 操作员级别='" + Combo1.text + "'"
 Adodc1.Refresh
 '根据操作员级别给定权限范围
 If Combo1.text = "系统管理员" Then
    a = 5
    Check1(4).Enabled = True
    Check1(5).Enabled = True
 End If
 If Combo1.text = "高级操作员" Then
    a = 4
    Check1(4).Enabled = True
    Check1(5).Enabled = False
 End If
 If Combo1.text = "普通操作员" Then
    a = 3
    Check1(4).Enabled = False
    Check1(5).Enabled = False
 End If
End Sub

Private Sub Command5_Click()  '删除
  Adodc1.RecordSource = "select * from qxb where 操作员='" + DataList1.text + "'"
  Adodc1.Refresh
  If Adodc1.Recordset.RecordCount > 0 Then
    If MsgBox("确定删除该操作员?", 4, "小区物业管理系统") = vbYes Then
      Adodc1.Recordset.Delete
      Adodc1.Refresh
      Unload Me
      main_xtgl_qxgl.Show
    End If
  End If
End Sub

Private Sub Form_Load()
'自动识别路径
Adodc1.ConnectionString = "DSN=NBooks"
Adodc1.RecordSource = "select * from qxb"
Adodc1.Refresh
 '添加操作员级别列表
 Combo1.AddItem ("系统管理员")    '向Combo控件中添加数据项
 Combo1.AddItem ("高级操作员")    '向Combo控件中添加数据项
 Combo1.AddItem ("普通操作员")    '向Combo控件中添加数据项
 Combo1.ListIndex = 0
 Call Find     '调用过程
End Sub
Private Sub Form_Unload(Cancel As Integer)
 frm_main.Enabled = True
End Sub
Private Sub Combo1_Click()
 Call Find     '调用过程
 For i = 0 To 5
     Check1(i).Value = 0
 Next i
End Sub
Private Sub DataList1_Click()
  '按操作员查询记录
  rs1.Open "select * from qxb where 操作员='" + DataList1.text + "'", Cnn, adOpenKeyset, adLockOptimistic
  If rs1.RecordCount > 0 Then     '假如记录大于零
     '浏览操作员权限
     For i = 0 To 5
         If rs1.Fields(i) = 1 Then Check1(i).Value = 1 Else Check1(i).Value = 0
     Next i
  End If
  rs1.Close
End Sub
Private Sub Command1_Click()     '全选
 For i = 0 To a
     Check1(i).Value = 1
 Next i
End Sub
Private Sub Command2_Click()     '全不选
 For i = 0 To a
     Check1(i).Value = 0
 Next i
End Sub

Private Sub Command3_Click()   '确定
 If DataList1.SelectedItem Then     '假如选定操作员
    '给选定的操作员赋予权限
    rs1.Open "select * from qxb where 操作员='" + DataList1.text + "'", Cnn, 1, 3
    If rs1.RecordCount > 0 Then
    For i = 0 To 5
        Cnn.Execute "update qxb set " & Check1(i).Caption & "='" & BakVal(Check1(i)) & "'where 操作员='" + DataList1.text + "'"
    Next i
    End If
    rs1.Close
    MsgBox "操作员权限设置成功!", , "图书综合管理系统"
  Else
    MsgBox "请选择操作员!", , "图书综合管理系统"
 End If
End Sub
Private Sub Command4_Click()   '退出
 frm_main.Enabled = True
 Unload Me
End Sub
Private Function BakVal(chk As CheckBox) As String
If chk.Value = 1 Then
BakVal = 1
Else
BakVal = 0
End If
End Function

⌨️ 快捷键说明

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