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 tvwOrg_AfterSelect(object sender, TreeViewEventArgs e)
 {
     if ((e.Node.Tag != null) && (e.Node.Tag is DEOrganization))
     {
         this.lvwUser.Items.Clear();
         ArrayList members = null;
         try {
             members = new PLOrganization().GetMembers(((DEOrganization)e.Node.Tag).Oid);
         } catch (Exception exception) {
             PrintException.Print(exception);
             return;
         }
         if (members != null)
         {
             foreach (DEUser user in members)
             {
                 ListViewItem item = this.lvwUser.Items.Add(user.LogId, ClientData.MyImageList.GetIconIndex("ICO_RSP_USER"));
                 item.SubItems.Add(user.Name);
                 item.Tag = user;
             }
         }
         OrgModelUL.ChangeFrozenIco(this.lvwUser);
         if (this.UsersLoadCompleted != null)
         {
             this.UsersLoadCompleted();
         }
     }
 }
Ejemplo n.º 3
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());
        }