Ejemplo n.º 1
0
 public void LoadOrgs()
 {
     this.tvwOrg.Visible = true;
     OrgModelUL.FillOrgTree(this.tvwOrg.Nodes[0], ClientData.MyImageList.GetIconIndex("ICO_RSP_ORG"));
     this.tvwOrg.Nodes[0].Expand();
     this.tvwOrg.DoubleClick += this.selectOrg;
 }
Ejemplo n.º 2
0
        private void DisplayUsers()
        {
            this.lvwUser.Items.Clear();
            List <string> list = new List <string>();

            switch (this.viewMode)
            {
            case UserViewMode.ByOrgTree:
                this.tvwOrg.Visible = true;
                OrgModelUL.FillOrgTree(this.tvwOrg.Nodes[0], ClientData.MyImageList.GetIconIndex("ICO_RSP_ORG"));
                this.tvwOrg.Nodes[0].Expand();
                this.tvwOrg.AfterSelect += this.selectOrg;
                break;

            case UserViewMode.ByList: {
                this.tvwOrg.Visible      = false;
                this.tvwOrg.AfterSelect -= this.selectOrg;
                ArrayList allUsers = null;
                try {
                    PLUser user = new PLUser();
                    allUsers = user.GetAllUsers();
                    if (this.showSysAdmin)
                    {
                        string sysAdmin = user.GetSysAdmin();
                        DEUser byLogId  = user.GetByLogId(sysAdmin);
                        allUsers.Add(byLogId);
                    }
                } catch (Exception exception) {
                    PrintException.Print(exception);
                    return;
                }
                if (allUsers != null)
                {
                    foreach (DEUser user3 in allUsers)
                    {
                        ListViewItem item = this.lvwUser.Items.Add(user3.LogId, ClientData.MyImageList.GetIconIndex("ICO_RSP_USER"));
                        item.SubItems.Add(user3.Name);
                        item.Tag = user3;
                        if (!list.Contains(user3.Name))
                        {
                            list.Add(user3.Name);
                        }
                        if (!list.Contains(user3.LogId))
                        {
                            list.Add(user3.LogId);
                        }
                    }
                }
                OrgModelUL.ChangeFrozenIco(this.lvwUser);
                break;
            }
            }
            this.txtUser.AutoCompleteCustomSource.Clear();
            this.txtUser.AutoCompleteCustomSource.AddRange(list.ToArray());
        }