左边目录树是员工,右边是43项权限,在Team_Users表中的PermissionValue列设置各个员工权限0011100110100000000001011100000000001011000。0代表无此项权限,1代表有此项权限。将0011100110100000000001011100000000001011000分别赋值到System_Permission表的Permission列。如果是1,则右侧目录树对应节点复选框被选中。
Dim trv2 As WinForm.TreeView = e.Form.Controls("TreeView2")
Dim s As String =Tables("Team_UserGroups").current("PermissionValue")
此主题相关图片如下:1.bmp
此主题相关图片如下:2.jpg
此主题相关图片如下:3.jpg
For i As Integer=0 To s.length-1
Tables("System_Permission").rows(i)("Permission") = s(i)
If Tables("System_Permission").current("Permission") = 1 Then
For Each nd As WinForm.TreeNode In trv2.AllNodes
If nd.Text= Tables("System_Permission").current("Name") Then
nd.Checked = True
End If
Next
End If
Next