frmQx.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:7k
- Public Class frmQx
- Inherits System.Windows.Forms.Form
- #Region " Windows 窗体设计器生成的代码 "
- Public Sub New()
- MyBase.New()
- '该调用是 Windows 窗体设计器所必需的。
- InitializeComponent()
- '在 InitializeComponent() 调用之后添加任何初始化
- End Sub
- '窗体重写 dispose 以清理组件列表。
- Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
- If disposing Then
- If Not (components Is Nothing) Then
- components.Dispose()
- End If
- End If
- MyBase.Dispose(disposing)
- End Sub
- 'Windows 窗体设计器所必需的
- Private components As System.ComponentModel.IContainer
- '注意: 以下过程是 Windows 窗体设计器所必需的
- '可以使用 Windows 窗体设计器修改此过程。
- '不要使用代码编辑器修改它。
- Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
- Friend WithEvents TvCustomer As System.Windows.Forms.TreeView
- Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
- Friend WithEvents StatusBar1 As System.Windows.Forms.StatusBar
- Friend WithEvents dgmenu As System.Windows.Forms.DataGrid
- Friend WithEvents ToolBar1 As System.Windows.Forms.ToolBar
- Friend WithEvents tbrSave As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbrExit As System.Windows.Forms.ToolBarButton
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.GroupBox1 = New System.Windows.Forms.GroupBox
- Me.TvCustomer = New System.Windows.Forms.TreeView
- Me.GroupBox2 = New System.Windows.Forms.GroupBox
- Me.dgmenu = New System.Windows.Forms.DataGrid
- Me.StatusBar1 = New System.Windows.Forms.StatusBar
- Me.ToolBar1 = New System.Windows.Forms.ToolBar
- Me.tbrSave = New System.Windows.Forms.ToolBarButton
- Me.tbrExit = New System.Windows.Forms.ToolBarButton
- Me.GroupBox1.SuspendLayout()
- Me.GroupBox2.SuspendLayout()
- CType(Me.dgmenu, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.SuspendLayout()
- '
- 'GroupBox1
- '
- Me.GroupBox1.Controls.Add(Me.TvCustomer)
- Me.GroupBox1.Location = New System.Drawing.Point(8, 57)
- Me.GroupBox1.Name = "GroupBox1"
- Me.GroupBox1.Size = New System.Drawing.Size(176, 327)
- Me.GroupBox1.TabIndex = 1
- Me.GroupBox1.TabStop = False
- '
- 'TvCustomer
- '
- Me.TvCustomer.AllowDrop = True
- Me.TvCustomer.ImageIndex = -1
- Me.TvCustomer.LabelEdit = True
- Me.TvCustomer.Location = New System.Drawing.Point(8, 15)
- Me.TvCustomer.Name = "TvCustomer"
- Me.TvCustomer.Nodes.AddRange(New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode("员工列表")})
- Me.TvCustomer.SelectedImageIndex = -1
- Me.TvCustomer.Size = New System.Drawing.Size(160, 305)
- Me.TvCustomer.Sorted = True
- Me.TvCustomer.TabIndex = 0
- '
- 'GroupBox2
- '
- Me.GroupBox2.Controls.Add(Me.dgmenu)
- Me.GroupBox2.Location = New System.Drawing.Point(192, 57)
- Me.GroupBox2.Name = "GroupBox2"
- Me.GroupBox2.Size = New System.Drawing.Size(464, 327)
- Me.GroupBox2.TabIndex = 2
- Me.GroupBox2.TabStop = False
- '
- 'dgmenu
- '
- Me.dgmenu.DataMember = ""
- Me.dgmenu.HeaderForeColor = System.Drawing.SystemColors.ControlText
- Me.dgmenu.Location = New System.Drawing.Point(8, 15)
- Me.dgmenu.Name = "dgmenu"
- Me.dgmenu.Size = New System.Drawing.Size(448, 305)
- Me.dgmenu.TabIndex = 0
- '
- 'StatusBar1
- '
- Me.StatusBar1.Location = New System.Drawing.Point(0, 391)
- Me.StatusBar1.Name = "StatusBar1"
- Me.StatusBar1.Size = New System.Drawing.Size(661, 22)
- Me.StatusBar1.TabIndex = 3
- '
- 'ToolBar1
- '
- Me.ToolBar1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat
- Me.ToolBar1.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.tbrSave, Me.tbrExit})
- Me.ToolBar1.DropDownArrows = True
- Me.ToolBar1.Location = New System.Drawing.Point(0, 0)
- Me.ToolBar1.Name = "ToolBar1"
- Me.ToolBar1.ShowToolTips = True
- Me.ToolBar1.Size = New System.Drawing.Size(661, 44)
- Me.ToolBar1.TabIndex = 4
- '
- 'tbrSave
- '
- Me.tbrSave.Text = "保存"
- '
- 'tbrExit
- '
- Me.tbrExit.Text = "退出"
- '
- 'frmQx
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(8, 18)
- Me.ClientSize = New System.Drawing.Size(661, 413)
- Me.ControlBox = False
- Me.Controls.Add(Me.ToolBar1)
- Me.Controls.Add(Me.StatusBar1)
- Me.Controls.Add(Me.GroupBox2)
- Me.Controls.Add(Me.GroupBox1)
- Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
- Me.Name = "frmQx"
- Me.Text = "权限分配"
- Me.GroupBox1.ResumeLayout(False)
- Me.GroupBox2.ResumeLayout(False)
- CType(Me.dgmenu, System.ComponentModel.ISupportInitialize).EndInit()
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Public lsweb As New jxcmanage
- Public dslocals As New DataSet
-
- Private Sub frmQx_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- dslocals = lsweb.returndataset("select 操作员 from wz_mm", "wz_mm")
- Dim drcurrent As DataRow
- Dim tnCurrent As TreeNode
- Dim i As Integer
- For i = 0 To dslocals.Tables(0).Rows.Count - 1
- drcurrent = dslocals.Tables(0).Rows(i)
- tnCurrent = TvCustomer.Nodes(0).Nodes.Add(drcurrent("操作员"))
- tnCurrent.Tag = drcurrent("操作员")
- Next
- End Sub
- Private Sub TvCustomer_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TvCustomer.AfterSelect
- dslocals = lsweb.returndataset("select * from wz_menu where username='" & e.Node.Tag & "'", "wz_menu")
- dgmenu.DataSource = dslocals.Tables(0).DefaultView
- End Sub
-
- Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
- Select Case e.Button.Text
- Case "保存"
- If lsweb.updatedataset("select * from wz_menu", "wz_menu", dslocals, DataRowState.Modified) = True Then
- MessageBox.Show("权限配置成功保存!", "提示", MessageBoxButtons.OK)
- Else
- MessageBox.Show("权限配置保存失败!", "提示", MessageBoxButtons.AbortRetryIgnore)
- End If
- Case "退出"
- Me.Close()
- End Select
- End Sub
- End Class