在权限表中,这样更直观一点。
If e.Sender.Value = "" Then
Return
End If
Dim dr As DataRow = DataTables("用户").Find("用户名 = '" & e.Sender.Value & "'")
If dr IsNot Nothing Then
For Each dr1 As DataRow In DataTables("权限管理").DataRows
dr1("A") = dr(dr1("权限细目").Replace("\","_"))
Next
End If
Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1")
tr.CreateTree("权限管理","权限细目","\","","_Identify")
For Each nd As WinForm.TreeNode In tr.AllNodes
For Each dr2 As Row In Tables("权限管理").Rows
Dim Parts() As String = dr2("权限细目").Split("\")
If nd.Text = Parts(1) Then
nd.Checked = dr2("A")
End If
Next
Next
tr.ExpandAll()
DataTables("权限管理").DataCols("权限细目").Caption = e.Sender.Value & " 权限细目"
DataTables("权限管理").BuildHeader()