WinForm Development Framework's rights Management System Improvement experience Summary (2) Design of User selection interface

Source: Internet
Author: User

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); }
        }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.