In the last chapter summary of the WinForm development framework of the rights management system improved experience (1) The use of-treelistlookupedit control introduced the Rights Management module user Management Section, which mainly introduces the users of which belong to the company, affiliated departments, direct A few data cascading presentations by the manager (person list), which can enhance the user's experience by introducing the Treelistlookupedit control. This article continues to introduce some of the advantages of the permission system module, introduce the design and implementation of the user interface in the organization management, the user chooses to use in many occasions, such as the user choice of the organization, the user selection within the role, or the user selection within the process.
1, select the user interface effect display
User choice in many places need to use, this article in the organization of the user selection as an example, introduce the user selected interface effect. We know that users can be categorized by organization, or by role, so we need to combine the two to quickly show the user's hierarchical relationship, the effect of the interface is shown below.
The above interface is divided into three parts: the left is mainly the display of the Organization and the role, the right is displayed through the list control, and can be checked, the bottom is the selected user's list display (can be removed).
2. Recursive presentation of the left-body tree
The organization itself is designed as a hierarchical tree, so it can be represented by recursive functions that can be displayed using a traditional style of TreeView controls or DevExpress-style treelist controls, but I tend to use the TreeView to feel that this The linear hierarchical relationship is more beautiful, and the recursive display of the structure tree is shown below.
private void Initdepttree () {this.treeDept.BeginUpdate ();
This.treeDept.Nodes.Clear ();
TreeNode node = new TreeNode (); Node.
Text = "All departments"; list<ounodeinfo> list = Bllfactory<ou>.
Instance.gettree ();
Adddept (list, node);
THIS.TREEDEPT.NODES.ADD (node);
This.treeDept.ExpandAll ();
This.treeDept.EndUpdate (); } private void Adddept (list<ounodeinfo> List, TreeNode TreeNode) {foreach (Ounodei
NFO Ouinfo in list) {TreeNode Deptnode = new TreeNode ();
Deptnode.text = Ouinfo.name;
Deptnode.tag = ouinfo.id;
Deptnode.imageindex = Portal.gc.GetImageIndex (ouinfo.category);
Deptnode.selectedimageindex = Portal.gc.GetImageIndex (ouinfo.category);
TREENODE.NODES.ADD (Deptnode); Adddept (Ouinfo.children, Deptnode); }
}