Dim pr As Row = Tables("查阅范围设置_Table1").Current
If pr IsNot Nothing AndAlso pr.Isnull("winN") = False Then
Dim tr4 As WinForm.TreeView = e.Form.Controls("TreeView1") \'所有部门角色
Dim dr,dr2 As DataRow
dr = DataTables("MoGroup").Find("WinName = \'" & pr("winN") & "\'")
If dr IsNot Nothing Then
Dim nms As String = dr("sqRole")
\'1---将有权查看表单的部门角色生成目录树
If nms > "" Then
tr4.Nodes.Clear() \'先清除
Dim nds() As String = nms.Split(",") \'拆分每一组部门.角色为数组
For i As Integer = 0 To nds.Length - 1
Dim cnd() As String = nds(i).Split(".") \'拆分部门与角色
If cnd(0) = "All" AndAlso cnd(1) = "All" Then \'All.All,增加All节点及其下从用户表中获取的所有角色节点
If tr4.Nodes.Contains(cnd(0)) = False Then
tr4.Nodes.Add(cnd(0))
For Each cdr As DataRow In dt.DataRows
If tr4.Nodes(cnd(0)).Nodes.Contains(cdr("RoleID")) = False Then
tr4.Nodes(cnd(0)).Nodes.Add(cdr("RoleID"),cdr("角色")) \'添加所有角色及中文名称(后续All.All节点不再处理中文显示)
End If
Next
End If
end if
Next
End If
End If
End If
是什么原因?谢谢!