资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:17k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Begin VB.Form Gy_WarehousePersonPower
- BorderStyle = 1 'Fixed Single
- Caption = "操作员仓库权限"
- ClientHeight = 5670
- ClientLeft = 540
- ClientTop = 1065
- ClientWidth = 4890
- Icon = "公用_仓库人员权限管理.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5670
- ScaleWidth = 4890
- Begin VB.ComboBox Cmb_Person
- Height = 300
- Left = 855
- TabIndex = 0
- Text = "Cmb_Person"
- Top = 675
- Width = 2715
- End
- Begin MSComctlLib.TreeView TreeView
- Height = 4440
- Left = 90
- TabIndex = 1
- Top = 1080
- Width = 4695
- _ExtentX = 8281
- _ExtentY = 7832
- _Version = 393217
- LabelEdit = 1
- Style = 7
- Checkboxes = -1 'True
- ImageList = "ImageList2"
- Appearance = 1
- End
- Begin MSComctlLib.ImageList ImageList1
- Left = 5265
- Top = 225
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 29
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":08CA
- Key = "sz"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":0C64
- Key = "dy"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":0FFE
- Key = "yl"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":1398
- Key = "xg"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":1732
- Key = "zh"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":1ACC
- Key = "sh"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":1E66
- Key = "bc"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":2200
- Key = "fq"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":259A
- Key = "bz"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":2934
- Key = "tc"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":2CCE
- Key = "bcgs"
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":3068
- Key = "mrlk"
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":3402
- Key = "xsxm"
- EndProperty
- BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":379C
- Key = "first"
- EndProperty
- BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":3B36
- Key = "prev"
- EndProperty
- BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":3ED0
- Key = "next"
- EndProperty
- BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":426A
- Key = "last"
- EndProperty
- BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":4604
- Key = "xx"
- EndProperty
- BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":499E
- Key = "define"
- EndProperty
- BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":4D38
- Key = "exec"
- EndProperty
- BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":50D2
- Key = "xz"
- EndProperty
- BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":546C
- Key = "sc"
- EndProperty
- BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":5806
- Key = "sx"
- EndProperty
- BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":5BA0
- Key = "cx"
- EndProperty
- BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":5F3A
- Key = "zd"
- EndProperty
- BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":62D4
- Key = "dz"
- EndProperty
- BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":666E
- Key = "ph"
- EndProperty
- BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":6A08
- Key = "fz"
- EndProperty
- BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":6DA2
- Key = "dw"
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.ImageList ImageList2
- Left = 5850
- Top = 180
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 4
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":713C
- Key = "T"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":7A16
- Key = "C"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":82F0
- Key = "Cl"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "公用_仓库人员权限管理.frx":9342
- Key = "O"
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.Toolbar SzToolbar
- Align = 1 'Align Top
- Height = 555
- Left = 0
- TabIndex = 2
- Top = 0
- Width = 4890
- _ExtentX = 8625
- _ExtentY = 979
- ButtonWidth = 820
- ButtonHeight = 926
- AllowCustomize = 0 'False
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 6
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "保存"
- Key = "bc"
- ImageKey = "bc"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "刷新"
- Key = "sx"
- ImageKey = "sx"
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "帮助"
- Key = "bz"
- ImageKey = "bz"
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "退出"
- Key = "tc"
- ImageKey = "tc"
- EndProperty
- EndProperty
- BorderStyle = 1
- End
- Begin VB.Label Label1
- Caption = "操作员:"
- Height = 180
- Left = 90
- TabIndex = 3
- Top = 720
- Width = 720
- End
- Begin VB.Menu menuSelect
- Caption = "menuSelect"
- Visible = 0 'False
- Begin VB.Menu All
- Caption = "全选"
- Shortcut = ^A
- End
- Begin VB.Menu fgf
- Caption = "-"
- End
- Begin VB.Menu Cancel
- Caption = "取消"
- Shortcut = ^Q
- End
- End
- End
- Attribute VB_Name = "Gy_WarehousePersonPower"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '*******************************************************
- '* 模 块 名 称 :仓库人员权限设置
- '* 功 能 描 述 :
- '* 程序员姓名 :徐强
- '* 最后修改人 :徐强
- '* 最后修改时间:2001/11/27
- '* 备 注:
- '*******************************************************
- Option Explicit
- Private Sub Cmb_Person_Click()
- ShowPower
- End Sub
- Private Sub Cmb_Person_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- ShowPower
- End If
- End Sub
- Private Sub Cmb_Person_LostFocus()
- ShowPower
- End Sub
- Private Function JudgePerson() As Boolean '判断操作员有效性
- Dim Czyrec As New ADODB.Recordset
- Dim Tsxx As String
- Set Czyrec = Cw_DataEnvi.DataConnect.Execute("Select * From Gy_czygl where czybm='" + Trim(Cmb_Person.Text) + "' or czymc='" & Trim(Cmb_Person.Text) & "' or rtrim(czybm)+'-'+rtrim(czymc)='" & Trim(Cmb_Person.Text) & "'")
- With Czyrec
- If Not .EOF Then
- Cmb_Person.Text = Trim(.Fields("czybm")) + "-" + Trim(.Fields("czymc"))
- JudgePerson = True
- Else
- Tsxx = "无此操作员!"
- Call Xtxxts(Tsxx, 0, 1)
- Cmb_Person.SetFocus
- JudgePerson = False
- End If
- End With
- Czyrec.Close
- Set Czyrec = Nothing
- End Function
- Private Sub Form_Activate()
- Cmb_Person.ListIndex = 0 '显示第一条记录,并调Cmb_Person_Click
- End Sub
- Private Sub Form_Load()
- LoadPerson
- LoadWarehouse
- TreeView.TabIndex = 0
- Cmb_Person.TabIndex = 1
- End Sub
- Private Sub LoadPerson() '加载操作员
- Dim Str_Temp As String
- Dim Rec_Temp As New Recordset
- Str_Temp = "select czybm,czymc from Gy_Czygl order by czybm"
- Set Rec_Temp = Cw_DataEnvi.DataConnect.Execute(Str_Temp)
- Do While Not Rec_Temp.EOF
- Cmb_Person.AddItem Trim(Rec_Temp.Fields("czybm")) + "-" + Trim(Rec_Temp.Fields("czymc"))
- Rec_Temp.MoveNext
- Loop
- End Sub
- Private Sub LoadWarehouse() '加载仓库
- Dim aDo_Sort As New Recordset
- Dim rs As New ADODB.Recordset
- Dim nodX As Node
- TreeView.Nodes.Clear
- TreeView.Nodes.Add , 4, "T", "仓库", "T"
- Set aDo_Sort = Cw_DataEnvi.DataConnect.Execute("select * from Gy_warehouse order by whcode")
- With aDo_Sort
- Do While Not .EOF
- Set nodX = TreeView.Nodes.Add("T", 4, "T" & Trim(.Fields("whcode")), "(" & Trim(.Fields("whcode")) & ")" & Trim(.Fields("whName")), "C")
- nodX.Tag = "T" & Trim(!WhCode)
- .MoveNext
- Loop
- End With
- TreeView.Nodes(1).Expanded = True
- End Sub
- Private Sub ShowPower() '显示权限
- Dim i As Long
- Dim rs As New ADODB.Recordset
- If Not JudgePerson Then Exit Sub
- Set rs = Cw_DataEnvi.DataConnect.Execute("select * from gy_v_warehousepower where czybm='" & Trim(Mid(Cmb_Person.Text, 1, InStr(1, Cmb_Person.Text & "-", "-") - 1)) & "'")
- For i = 1 To TreeView.Nodes.count '先清除
- TreeView.Nodes.Item(i).Checked = False
- Next
- If Not rs.EOF Then '如有记录,选中根结点
- TreeView.Nodes.Item(1).Checked = True
- End If
- Do While Not rs.EOF '选中有权限的节点
- TreeView.Nodes.Item("T" & Trim(rs("whcode"))).Checked = True
- rs.MoveNext
- Loop
- End Sub
- Private Sub SavePower() '存权限
- Dim SSql As String
- Dim i As Long
- Dim Tsxx As String
- On Error GoTo ErrMsg
- If Not JudgePerson Then Exit Sub
- Cw_DataEnvi.DataConnect.BeginTrans
- '删除此操作员以前的权限
- SSql = "delete from gy_whlimit where czybm='" & Trim(Mid(Cmb_Person.Text, 1, InStr(1, Cmb_Person.Text & "-", "-") - 1)) & "'"
- Cw_DataEnvi.DataConnect.Execute SSql
- '增加权限
- For i = 2 To TreeView.Nodes.count
- If TreeView.Nodes(i).Checked Then
- SSql = "insert into gy_whlimit (czybm,whcode) values('" & Trim(Mid(Cmb_Person.Text, 1, InStr(1, Cmb_Person.Text & "-", "-") - 1)) & " ','" & Right(TreeView.Nodes(i).Key, Len(TreeView.Nodes(i).Key) - 1) & "')"
- Cw_DataEnvi.DataConnect.Execute SSql
- End If
- Next
- Cw_DataEnvi.DataConnect.CommitTrans
- Tsxx = "保存完毕!"
- Call Xtxxts(Tsxx, 0, 4)
- Exit Sub
- ErrMsg:
- Cw_DataEnvi.DataConnect.RollbackTrans
- Tsxx = "存盘过程中出现错误,程序自动恢复保存前状态!"
- Call Xtxxts(Tsxx, 0, 1)
- End Sub
- Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
- Dim Tsxx As String
- Dim i As Long
- Dim SSql As String
- Select Case Button.Key
- Case "bc" '保存
- SavePower
- Case "sx" '刷新
- ShowPower
- Case "bz" '帮助
- Call F1bz
- Case "tc" '退出
- Unload Me
- End Select
- End Sub
- Private Sub TreeView_NodeCheck(ByVal Node As MSComctlLib.Node)
- Dim i As Integer
- Dim ParentCode As String
- If Node.Key = "T" Then '如选中根结点,则同时选中所有子节点;取消选中根结点,则同时取消选中所有子节点
- For i = 2 To TreeView.Nodes.count
- TreeView.Nodes.Item(i).Checked = Node.Checked
- Next
- Else
- If Node.Checked Then '如果选中子节点,则同时选中父节点
- TreeView.Nodes(1).Checked = True
- Else
- TreeView.Nodes(1).Checked = False '取消选中子节点,则同时取消选中父节点
- For i = 2 To TreeView.Nodes.count '但如其它选中的子节点,则选中父节点
- If TreeView.Nodes.Item(i).Checked Then
- TreeView.Nodes(1).Checked = True
- Exit For
- End If
- Next
- End If
- End If
- End Sub