frmQxManage.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:18k
- Imports System.Data.SqlClient
- Public Class frmQxManage
- 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 ToolBar1 As System.Windows.Forms.ToolBar
- Friend WithEvents Splitter1 As System.Windows.Forms.Splitter
- Friend WithEvents Panel1 As System.Windows.Forms.Panel
- Friend WithEvents Splitter2 As System.Windows.Forms.Splitter
- Friend WithEvents CheckBox1 As System.Windows.Forms.CheckBox
- Friend WithEvents CheckBox2 As System.Windows.Forms.CheckBox
- Friend WithEvents CheckBox3 As System.Windows.Forms.CheckBox
- Friend WithEvents CheckBox4 As System.Windows.Forms.CheckBox
- Friend WithEvents CheckBox5 As System.Windows.Forms.CheckBox
- Friend WithEvents CheckBox6 As System.Windows.Forms.CheckBox
- Friend WithEvents CheckBox7 As System.Windows.Forms.CheckBox
- Friend WithEvents CheckBox8 As System.Windows.Forms.CheckBox
- Friend WithEvents CheckBox9 As System.Windows.Forms.CheckBox
- Friend WithEvents Button1 As System.Windows.Forms.Button
- Friend WithEvents Button2 As System.Windows.Forms.Button
- Friend WithEvents Button3 As System.Windows.Forms.Button
- Friend WithEvents ToolBarButton1 As System.Windows.Forms.ToolBarButton
- Friend WithEvents ToolBarButton2 As System.Windows.Forms.ToolBarButton
- Friend WithEvents TvCustomer As System.Windows.Forms.TreeView
- Friend WithEvents dgmenu As System.Windows.Forms.DataGrid
- Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
- Friend WithEvents ImageList2 As System.Windows.Forms.ImageList
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.components = New System.ComponentModel.Container
- Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmQxManage))
- Me.ToolBar1 = New System.Windows.Forms.ToolBar
- Me.ToolBarButton1 = New System.Windows.Forms.ToolBarButton
- Me.ToolBarButton2 = New System.Windows.Forms.ToolBarButton
- Me.ImageList2 = New System.Windows.Forms.ImageList(Me.components)
- Me.TvCustomer = New System.Windows.Forms.TreeView
- Me.Splitter1 = New System.Windows.Forms.Splitter
- Me.Panel1 = New System.Windows.Forms.Panel
- Me.TextBox1 = New System.Windows.Forms.TextBox
- Me.Button3 = New System.Windows.Forms.Button
- Me.Button2 = New System.Windows.Forms.Button
- Me.Button1 = New System.Windows.Forms.Button
- Me.CheckBox9 = New System.Windows.Forms.CheckBox
- Me.CheckBox8 = New System.Windows.Forms.CheckBox
- Me.CheckBox7 = New System.Windows.Forms.CheckBox
- Me.CheckBox6 = New System.Windows.Forms.CheckBox
- Me.CheckBox5 = New System.Windows.Forms.CheckBox
- Me.CheckBox4 = New System.Windows.Forms.CheckBox
- Me.CheckBox3 = New System.Windows.Forms.CheckBox
- Me.CheckBox2 = New System.Windows.Forms.CheckBox
- Me.CheckBox1 = New System.Windows.Forms.CheckBox
- Me.Splitter2 = New System.Windows.Forms.Splitter
- Me.dgmenu = New System.Windows.Forms.DataGrid
- Me.Panel1.SuspendLayout()
- CType(Me.dgmenu, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.SuspendLayout()
- '
- 'ToolBar1
- '
- Me.ToolBar1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat
- Me.ToolBar1.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.ToolBarButton1, Me.ToolBarButton2})
- Me.ToolBar1.DropDownArrows = True
- Me.ToolBar1.ImageList = Me.ImageList2
- Me.ToolBar1.Location = New System.Drawing.Point(0, 0)
- Me.ToolBar1.Name = "ToolBar1"
- Me.ToolBar1.ShowToolTips = True
- Me.ToolBar1.Size = New System.Drawing.Size(609, 41)
- Me.ToolBar1.TabIndex = 0
- '
- 'ToolBarButton1
- '
- Me.ToolBarButton1.ImageIndex = 4
- Me.ToolBarButton1.Text = "保存"
- '
- 'ToolBarButton2
- '
- Me.ToolBarButton2.ImageIndex = 11
- Me.ToolBarButton2.Text = "退出"
- '
- 'ImageList2
- '
- Me.ImageList2.ImageSize = New System.Drawing.Size(16, 16)
- Me.ImageList2.ImageStream = CType(resources.GetObject("ImageList2.ImageStream"), System.Windows.Forms.ImageListStreamer)
- Me.ImageList2.TransparentColor = System.Drawing.Color.Transparent
- '
- 'TvCustomer
- '
- Me.TvCustomer.Dock = System.Windows.Forms.DockStyle.Left
- Me.TvCustomer.ImageIndex = -1
- Me.TvCustomer.Location = New System.Drawing.Point(0, 41)
- 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(91, 255)
- Me.TvCustomer.TabIndex = 1
- '
- 'Splitter1
- '
- Me.Splitter1.Location = New System.Drawing.Point(91, 41)
- Me.Splitter1.MinExtra = 0
- Me.Splitter1.MinSize = 0
- Me.Splitter1.Name = "Splitter1"
- Me.Splitter1.Size = New System.Drawing.Size(2, 255)
- Me.Splitter1.TabIndex = 2
- Me.Splitter1.TabStop = False
- '
- 'Panel1
- '
- Me.Panel1.Controls.Add(Me.TextBox1)
- Me.Panel1.Controls.Add(Me.Button3)
- Me.Panel1.Controls.Add(Me.Button2)
- Me.Panel1.Controls.Add(Me.Button1)
- Me.Panel1.Controls.Add(Me.CheckBox9)
- Me.Panel1.Controls.Add(Me.CheckBox8)
- Me.Panel1.Controls.Add(Me.CheckBox7)
- Me.Panel1.Controls.Add(Me.CheckBox6)
- Me.Panel1.Controls.Add(Me.CheckBox5)
- Me.Panel1.Controls.Add(Me.CheckBox4)
- Me.Panel1.Controls.Add(Me.CheckBox3)
- Me.Panel1.Controls.Add(Me.CheckBox2)
- Me.Panel1.Controls.Add(Me.CheckBox1)
- Me.Panel1.Dock = System.Windows.Forms.DockStyle.Top
- Me.Panel1.Location = New System.Drawing.Point(93, 41)
- Me.Panel1.Name = "Panel1"
- Me.Panel1.Size = New System.Drawing.Size(516, 87)
- Me.Panel1.TabIndex = 3
- '
- 'TextBox1
- '
- Me.TextBox1.Location = New System.Drawing.Point(90, 31)
- Me.TextBox1.Name = "TextBox1"
- Me.TextBox1.ReadOnly = True
- Me.TextBox1.Size = New System.Drawing.Size(54, 21)
- Me.TextBox1.TabIndex = 12
- Me.TextBox1.Text = ""
- Me.TextBox1.Visible = False
- '
- 'Button3
- '
- Me.Button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.Button3.Location = New System.Drawing.Point(414, 50)
- Me.Button3.Name = "Button3"
- Me.Button3.Size = New System.Drawing.Size(60, 18)
- Me.Button3.TabIndex = 11
- Me.Button3.Text = "取消"
- Me.Button3.TextAlign = System.Drawing.ContentAlignment.TopCenter
- '
- 'Button2
- '
- Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.Button2.Location = New System.Drawing.Point(414, 12)
- Me.Button2.Name = "Button2"
- Me.Button2.Size = New System.Drawing.Size(60, 19)
- Me.Button2.TabIndex = 10
- Me.Button2.Text = "全选"
- Me.Button2.TextAlign = System.Drawing.ContentAlignment.TopCenter
- '
- 'Button1
- '
- Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.Button1.Location = New System.Drawing.Point(414, 31)
- Me.Button1.Name = "Button1"
- Me.Button1.Size = New System.Drawing.Size(60, 19)
- Me.Button1.TabIndex = 9
- Me.Button1.Text = "确定"
- Me.Button1.TextAlign = System.Drawing.ContentAlignment.TopCenter
- '
- 'CheckBox9
- '
- Me.CheckBox9.Location = New System.Drawing.Point(300, 56)
- Me.CheckBox9.Name = "CheckBox9"
- Me.CheckBox9.Size = New System.Drawing.Size(78, 19)
- Me.CheckBox9.TabIndex = 8
- Me.CheckBox9.Text = "系统管理 "
- '
- 'CheckBox8
- '
- Me.CheckBox8.Location = New System.Drawing.Point(300, 31)
- Me.CheckBox8.Name = "CheckBox8"
- Me.CheckBox8.Size = New System.Drawing.Size(78, 19)
- Me.CheckBox8.TabIndex = 7
- Me.CheckBox8.Text = "系统设置"
- '
- 'CheckBox7
- '
- Me.CheckBox7.Location = New System.Drawing.Point(300, 6)
- Me.CheckBox7.Name = "CheckBox7"
- Me.CheckBox7.Size = New System.Drawing.Size(96, 19)
- Me.CheckBox7.TabIndex = 6
- Me.CheckBox7.Text = "基本信息维护"
- '
- 'CheckBox6
- '
- Me.CheckBox6.Location = New System.Drawing.Point(156, 56)
- Me.CheckBox6.Name = "CheckBox6"
- Me.CheckBox6.Size = New System.Drawing.Size(108, 19)
- Me.CheckBox6.TabIndex = 5
- Me.CheckBox6.Text = "门店零售管理"
- '
- 'CheckBox5
- '
- Me.CheckBox5.Location = New System.Drawing.Point(156, 31)
- Me.CheckBox5.Name = "CheckBox5"
- Me.CheckBox5.Size = New System.Drawing.Size(108, 19)
- Me.CheckBox5.TabIndex = 4
- Me.CheckBox5.Text = "门店配送管理"
- '
- 'CheckBox4
- '
- Me.CheckBox4.Location = New System.Drawing.Point(156, 6)
- Me.CheckBox4.Name = "CheckBox4"
- Me.CheckBox4.Size = New System.Drawing.Size(78, 19)
- Me.CheckBox4.TabIndex = 3
- Me.CheckBox4.Text = "综合统计"
- '
- 'CheckBox3
- '
- Me.CheckBox3.Location = New System.Drawing.Point(12, 56)
- Me.CheckBox3.Name = "CheckBox3"
- Me.CheckBox3.Size = New System.Drawing.Size(78, 19)
- Me.CheckBox3.TabIndex = 2
- Me.CheckBox3.Text = "库存管理"
- '
- 'CheckBox2
- '
- Me.CheckBox2.Location = New System.Drawing.Point(12, 31)
- Me.CheckBox2.Name = "CheckBox2"
- Me.CheckBox2.Size = New System.Drawing.Size(78, 19)
- Me.CheckBox2.TabIndex = 1
- Me.CheckBox2.Text = "销售管理"
- '
- 'CheckBox1
- '
- Me.CheckBox1.Location = New System.Drawing.Point(12, 6)
- Me.CheckBox1.Name = "CheckBox1"
- Me.CheckBox1.Size = New System.Drawing.Size(78, 19)
- Me.CheckBox1.TabIndex = 0
- Me.CheckBox1.Text = "采购管理"
- '
- 'Splitter2
- '
- Me.Splitter2.Dock = System.Windows.Forms.DockStyle.Top
- Me.Splitter2.Location = New System.Drawing.Point(93, 128)
- Me.Splitter2.MinExtra = 0
- Me.Splitter2.MinSize = 0
- Me.Splitter2.Name = "Splitter2"
- Me.Splitter2.Size = New System.Drawing.Size(516, 3)
- Me.Splitter2.TabIndex = 4
- Me.Splitter2.TabStop = False
- '
- 'dgmenu
- '
- Me.dgmenu.DataMember = ""
- Me.dgmenu.Dock = System.Windows.Forms.DockStyle.Fill
- Me.dgmenu.HeaderForeColor = System.Drawing.SystemColors.ControlText
- Me.dgmenu.Location = New System.Drawing.Point(93, 131)
- Me.dgmenu.Name = "dgmenu"
- Me.dgmenu.Size = New System.Drawing.Size(516, 165)
- Me.dgmenu.TabIndex = 5
- '
- 'frmQxManage
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
- Me.ClientSize = New System.Drawing.Size(609, 296)
- Me.Controls.Add(Me.dgmenu)
- Me.Controls.Add(Me.Splitter2)
- Me.Controls.Add(Me.Panel1)
- Me.Controls.Add(Me.Splitter1)
- Me.Controls.Add(Me.TvCustomer)
- Me.Controls.Add(Me.ToolBar1)
- Me.Name = "frmQxManage"
- Me.Text = "frmQxManage"
- Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
- Me.Panel1.ResumeLayout(False)
- CType(Me.dgmenu, System.ComponentModel.ISupportInitialize).EndInit()
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Public lsweb As New jxcmanage
- Public dslocals, dslocal As New DataSet
- Public strquery As String
- Private Sub frmQxManage_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
-
- TextBox1.Text = e.Node.Tag
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim updatesql, updatesqls As String
- strquery = "select * from wz_Qxmenu where (Ctype not like '%'"
- updatesql = "update wz_Qxmenu set Dbit=1 where Ctype not like '%'"
- updatesqls = "update wz_Qxmenu set Dbit=0 where Ctype not like '%'"
- If CheckBox1.Checked = True Then
- strquery = strquery & " or Ctype like '1%'"
- updatesql = updatesql & " or Cctype = '1'"
- Else
- updatesqls = updatesqls & " or Cctype = '1'"
- End If
- If CheckBox2.Checked = True Then
- strquery = strquery & " or Ctype like '2%'"
- updatesql = updatesql & " or Cctype = '2'"
- Else
- updatesqls = updatesqls & " or Cctype = '2'"
- End If
- If CheckBox3.Checked = True Then
- strquery = strquery & " or Ctype like '3%'"
- updatesql = updatesql & " or Cctype = '3'"
- Else
- updatesqls = updatesqls & " or Cctype = '3'"
- End If
- If CheckBox4.Checked = True Then
- strquery = strquery & " or Ctype like '4%'"
- updatesql = updatesql & " or Cctype = '4'"
- Else
- updatesqls = updatesqls & " or Cctype = '4'"
- End If
- If CheckBox5.Checked = True Then
- strquery = strquery & " or Ctype like '5%'"
- updatesql = updatesql & " or Cctype = '5'"
- Else
- updatesqls = updatesqls & " or Cctype = '5'"
- End If
- If CheckBox6.Checked = True Then
- strquery = strquery & " or Ctype like '6%'"
- updatesql = updatesql & " or Cctype = '6'"
- Else
- updatesqls = updatesqls & " or Cctype = '6'"
- End If
- If CheckBox7.Checked = True Then
- strquery = strquery & " or Ctype like '7%'"
- updatesql = updatesql & " or Cctype = '7'"
- Else
- updatesqls = updatesqls & " or Cctype = '7'"
- End If
- If CheckBox8.Checked = True Then
- strquery = strquery & " or Ctype like '8%'"
- updatesql = updatesql & " or Cctype = '8'"
- Else
- updatesqls = updatesqls & " or Cctype = '8'"
- End If
- If CheckBox9.Checked = True Then
- strquery = strquery & " or Ctype like '9%'"
- updatesql = updatesql & " or Cctype = '9'"
- Else
- updatesqls = updatesqls & " or Cctype = '9'"
- End If
- strquery = strquery & ") and username='" & TextBox1.Text.Trim & "'"
- updatesql = updatesql & " and username='" & TextBox1.Text.Trim & "'"
- updatesqls = updatesqls & " and username='" & TextBox1.Text.Trim & "'"
- lsweb.kcql(updatesql)
- lsweb.kcql(updatesqls)
- dslocals = lsweb.returndataset(strquery, "wz_Qxmenu")
- dgmenu.DataSource = dslocals.Tables(0).DefaultView
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- CheckBox1.Checked = True
- CheckBox2.Checked = True
- CheckBox3.Checked = True
- CheckBox4.Checked = True
- CheckBox5.Checked = True
- CheckBox6.Checked = True
- CheckBox7.Checked = True
- CheckBox8.Checked = True
- CheckBox9.Checked = True
-
- End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- dslocals.Clear()
- CheckBox1.Checked = False
- CheckBox2.Checked = False
- CheckBox3.Checked = False
- CheckBox4.Checked = False
- CheckBox5.Checked = False
- CheckBox6.Checked = False
- CheckBox7.Checked = False
- CheckBox8.Checked = False
- CheckBox9.Checked = False
- TextBox1.Text = "".Trim
- 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(strquery, "wz_Qxmenu", 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