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编辑过]