-- 作者:zpx_2012
-- 发布时间:2012/8/20 16:10:00
--
谢谢狐爸,这样一举例我看一下就明白了,程老师也是这个意思但我不知道怎么做出来。谢谢大家,
将完整的代码跟大伙分享一下,但愿不要有错。主要是根据角色来授权,我觉得这个思路很不错,但还没完全做完,到时再跟大家分享完整版。
Dim tr1 As WinForm.TreeView = e.Form.Controls("TreeView1") Dim tr2 As WinForm.TreeView = e.Form.Controls("TreeView2") Dim tr3 As WinForm.TreeView = e.Form.Controls("TreeView3") Dim nd As WinForm.TreeNode
tr1.BuildTree("授权表","部门|角色")
\'选取需要授权的表进行排序 Dim nms As New List(of String) For Each dt As DataTable In DataTables Select Case dt.name Case "导航","消息","用户","授权表","项目分类"
Case Else nms.add(dt.name) End Select Next nms.sort() \'将需要授权的表生成目录树 For Each nm As String In nms nd = tr2.Nodes.Add(nm) For Each dc As DataCol In DataTables(nm).DataCols nd.Nodes.Add(dc.Name) Next nd = tr3.Nodes.Add(nm) For Each dc As DataCol In DataTables(nm).DataCols nd.Nodes.Add(dc.Name) Next Next
|