- VERSION 5.00
- Begin VB.Form frmSq
- BorderStyle = 3 'Fixed Dialog
- Caption = "用户授权"
- ClientHeight = 4230
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 5610
- Icon = "frmSQ.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4230
- ScaleWidth = 5610
- ShowInTaskbar = 0 'False
- StartUpPosition = 1 '所有者中心
- Begin VB.CheckBox CheQX
- Caption = "待扩展权限"
- Height = 315
- Index = 15
- Left = 2040
- TabIndex = 20
- Top = 3600
- Width = 1455
- End
- Begin VB.CheckBox CheQX
- Caption = "待扩展权限"
- Height = 315
- Index = 14
- Left = 2040
- TabIndex = 19
- Top = 3120
- Width = 1455
- End
- Begin VB.CheckBox CheQX
- Caption = "待扩展权限"
- Height = 315
- Index = 13
- Left = 2040
- TabIndex = 18
- Top = 2640
- Width = 1455
- End
- Begin VB.CheckBox CheQX
- Caption = "待扩展权限"
- Height = 315
- Index = 12
- Left = 2040
- TabIndex = 17
- Top = 2160
- Width = 1455
- End
- Begin VB.CheckBox CheQX
- Caption = "待扩展权限"
- Height = 315
- Index = 11
- Left = 2040
- TabIndex = 16
- Top = 1680
- Width = 1455
- End
- Begin VB.CheckBox CheQX
- Caption = "待扩展权限"
- Height = 315
- Index = 10
- Left = 2040
- TabIndex = 15
- Top = 1200
- Width = 1455
- End
- Begin VB.CheckBox CheQX
- Caption = "维修完工确认"
- Height = 315
- Index = 9
- Left = 2040
- TabIndex = 14
- Top = 720
- Width = 1455
- End
- Begin VB.CheckBox CheQX
- Caption = "费用结算管理"
- Height = 315
- Index = 8
- Left = 2040
- TabIndex = 13
- Top = 240
- Width = 1455
- End
- Begin VB.CheckBox CheQX
- Caption = "维修工时管理"
- Height = 315
- Index = 7
- Left = 240
- TabIndex = 12
- Top = 3600
- Width = 1455
- End
- Begin VB.CheckBox CheQX
- Caption = "配件领用管理"
- Height = 315
- Index = 6
- Left = 240
- TabIndex = 11
- Top = 3120
- Width = 1455
- End
- Begin VB.CheckBox CheQX
- Caption = "配件采购管理"
- Height = 315
- Index = 5
- Left = 240
- TabIndex = 10
- Top = 2640
- Width = 1455
- End
- Begin VB.CheckBox CheQX
- Caption = "定损报件管理"
- Height = 315
- Index = 4
- Left = 240
- TabIndex = 9
- Top = 2160
- Width = 1455
- End
- Begin VB.CheckBox CheQX
- Caption = "前台客户管理"
- Height = 315
- Index = 3
- Left = 240
- TabIndex = 8
- Top = 1680
- Width = 1455
- End
- Begin VB.CheckBox CheQX
- Caption = "客户类别管理"
- Height = 315
- Index = 2
- Left = 240
- TabIndex = 7
- Top = 1200
- Width = 1455
- End
- Begin VB.CheckBox CheQX
- Caption = "职员信息管理"
- Height = 315
- Index = 1
- Left = 240
- TabIndex = 6
- Top = 720
- Width = 1455
- End
- Begin VB.CheckBox CheQX
- Caption = "部门信息管理"
- Height = 315
- Index = 0
- Left = 240
- TabIndex = 5
- Top = 240
- Width = 1455
- End
- Begin VB.CommandButton Command4
- Caption = "修改(&M)"
- Height = 315
- Left = 3840
- TabIndex = 4
- Top = 3120
- Width = 1335
- End
- Begin VB.CommandButton Command3
- Caption = "新增(&N)"
- Height = 315
- Left = 3840
- TabIndex = 2
- Top = 2745
- Width = 1335
- End
- Begin VB.CommandButton Command2
- Cancel = -1 'True
- Caption = "关闭(&C)"
- Height = 315
- Left = 3840
- TabIndex = 3
- Top = 3600
- Width = 1335
- End
- Begin VB.ListBox USERS
- Height = 1500
- ItemData = "frmSQ.frx":000C
- Left = 3840
- List = "frmSQ.frx":0013
- TabIndex = 0
- Top = 240
- Width = 1455
- End
- Begin VB.CommandButton Command1
- Caption = "授权(&A)"
- Default = -1 'True
- Height = 315
- Left = 3840
- TabIndex = 1
- Top = 2400
- Width = 1335
- End
- End
- Attribute VB_Name = "frmSq"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '****************************************************************************
- '人人为我,我为人人
- '枕善居收藏整理
- '发布日期:2008/01/21
- '描 述:汽车维修管理系统SQL2000版
- '网 站:http://www.Mndsoft.com/ (VB6源码博客)
- '网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
- 'e-mail :Mndsoft@163.com
- 'e-mail :Mndsoft@126.com
- 'OICQ :88382850
- ' 如果您有新的好的代码别忘记给枕善居哦!
- '****************************************************************************
- Option Explicit
- Private Sub Command1_Click()
- Dim Us As String
- Us = Trim(USERS.Text)
- If IsSys(Us) Then
- MsgBox "不能给管理员授予权!"
- Else
- Dim i As Integer
- Dim qx As String
- For i = 0 To 15
- qx = IIf(CheQX(i).Value, "1", "0") & qx
- Next
- qx = ConvertBTD(qx)
- g_Conn.Execute ("UPDATE Users set QuanXian='" & qx & "' Where UserName='" & Us & "'")
- MsgBox "给用户“" & Us & "”授权成功!"
- End If
- End Sub
- Private Sub Command2_Click()
- Unload Me
- End Sub
- Private Sub Command3_Click()
- frmAddAdmin.Show vbModal
- End Sub
- Public Sub LoadUsers()
- Dim Rs As New ADODB.Recordset
- With USERS
- .Clear
- Set Rs = g_Conn.Execute("SELECT UserName FROM Users")
- While Not Rs.EOF
- .AddItem Rs(0).Value
- Rs.MoveNext
- Wend
- Set Rs = Nothing
- End With
- End Sub
- Private Sub Command4_Click()
- With frmAddAdmin
- .Dadmin = USERS
- .Dmodify = True
- .Show vbModal
- .Dmodify = False
- .Dadmin = ""
- End With
- End Sub
- Private Sub Form_Activate()
- LoadUsers
- End Sub
- Private Sub USERS_Click()
- Dim Rs As Recordset
- Dim i As Integer
- Dim qx As String
- Set Rs = g_Conn.Execute("SELECT QuanXian FROM Users Where UserName='" & USERS.Text & "'")
- qx = ConvertDTB(Rs(0).Value)
- For i = 0 To 15
- CheQX(i).Value = Val(Mid(qx, i + 1, 1))
- Next
- End Sub
- Private Sub USERS_DblClick()
- Command4_Click
- End Sub