Foxtable(狐表)用户栏目专家坐堂 → 借用程版的完美的同步操作目录树的角色授权


  共有3529人关注过本帖平板打印复制链接

主题:借用程版的完美的同步操作目录树的角色授权

帅哥哟,离线,有人找我吗?
blsu33
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2927 积分:20167 威望:0 精华:0 注册:2012/2/3 17:45:00
借用程版的完美的同步操作目录树的角色授权  发帖心情 Post By:2015/4/28 15:56:00 [只看该作者]

BIN,老师,
根据程版的 http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=42004,想要达到对角色的授权,下列代码,没有给角色列赋值
问题是下面黄色部分代码有问题,老师这个怎么弄。
“”
   Dim nd,nd1 As  WinForm.TreeNode
nd = e.node
If nd.Nodes.Count > 0
    For Each nd1 In nd.AllNodes
        nd1.Checked = nd.Checked
    Next
End If
If e.node.Checked = False
    Do While  nd.parentnode IsNot Nothing
        nd = nd.parentnode
        If nd.Nodes.Count > 0
            For i As Integer = 0 To nd.Nodes.Count -1
                If nd.Nodes(i).Checked = True
                    Exit Do
                End If
                If i = nd.Nodes.Count -1
                    nd.Checked = False
                End If
            Next
        End If
    Loop
Else
    Do While  nd.parentnode IsNot Nothing
        nd = nd.parentnode
        nd.Checked = True
    Loop
End If


Dim tr3 As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim nd3 As WinForm.TreeNode = tr3.SelectedNode
Dim tr2 As WinForm.TreeView = e.Form.Controls("TreeView2")
Dim nd2 As WinForm.TreeNode = tr2.SelectedNode
Dim dr As DataRow
Dim Vals() As String = ND2.FullPath.Split("\")
Dim dals() As String ={"功能主模块","一级模块","二级模块","权限"}
For Each Val As String In Vals
    For Each dal As String In dals
        DataTables("权限管理").Select(dal=val AndAlso dr(" & dal & ") =Val)
        If dr IsNot Nothing Then
            If  nd.Checked = True Then
                dr("角色") = nd3.Text + "\" + dr("角色")
            Else
                dr("角色") = dr("角色").Replace(nd3.Text,"")
            End If
            dr("角色") = dr("角色").Trim("\")
        End If
    Next
Next
[此贴子已经被作者于2015/4/28 16:12:56编辑过]

 回到顶部