Exemplo n.º 1
0
        public void AddAdmin(long uid)
        {
            GroupNodeStaff gns = this.FindListItem(uid);

            if (gns != null)
            {
                gns.AddAdminImage();
                EntGroup group = this.dataService.GetEntGroup(this.gid);
                if (group != null && group.IsAdmin(this.sessionService.Uid))
                {
                    gns.DeleAdminContextMenu();
                }
                if (uid == this.sessionService.Uid)
                {
                    foreach (GroupNodeStaff gnstaff in (System.Collections.IEnumerable) this.GroupMemberList.Items)
                    {
                        if (gnstaff.Staff.Uid == this.sessionService.Uid)
                        {
                            gnstaff.ClearAdminContextMenu();
                        }
                        else
                        {
                            if (group.IsAdmin(gnstaff.Staff.Uid))
                            {
                                gnstaff.DeleAdminContextMenu();
                            }
                            else
                            {
                                gnstaff.AddAdminContextMenu();
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void RemoveMember(long uid)
        {
            this.nodeStaff.Remove(uid);
            GroupNodeStaff gnstaff = this.FindListItem(uid);

            if (gnstaff != null)
            {
                this.GroupMemberList.Items.Remove(gnstaff);
            }
        }
Exemplo n.º 3
0
 public void AddGroupMember(Staff staff)
 {
     if (staff != null)
     {
         GroupNodeStaff gns = new GroupNodeStaff(this.gid, staff);
         if (!this.nodeStaff.ContainsKey(staff.Uid))
         {
             this.nodeStaff.Add(staff.Uid, gns);
             this.GroupMemberList.Items.Add(gns);
         }
     }
 }
 public void AddGroupMember(Staff staff)
 {
     if (staff != null)
     {
         GroupNodeStaff gns = new GroupNodeStaff(this.gid, staff);
         if (!this.nodeStaff.ContainsKey(staff.Uid))
         {
             this.nodeStaff.Add(staff.Uid, gns);
             this.GroupMemberList.Items.Add(gns);
         }
     }
 }
Exemplo n.º 5
0
        public void SortGroupMember()
        {
            ItemCollection ic = this.GroupMemberList.Items;

            System.Collections.Generic.IList <System.Collections.Generic.IList <GroupNodeStaff> > list = new System.Collections.Generic.List <System.Collections.Generic.IList <GroupNodeStaff> >();
            System.Collections.Generic.IList <GroupNodeStaff> nodes = null;
            int count = ic.Count;

            for (int i = 0; i < count; i++)
            {
                GroupNodeStaff node = ic[i] as GroupNodeStaff;
                if (node != null)
                {
                    if (nodes == null)
                    {
                        nodes = new System.Collections.Generic.List <GroupNodeStaff>();
                    }
                    nodes.Add(node);
                }
            }
            if (nodes != null && nodes.Count > 0)
            {
                System.Collections.Generic.IList <GroupNodeStaff> offline      = null;
                System.Collections.Generic.IList <GroupNodeStaff> online       = null;
                System.Collections.Generic.IList <GroupNodeStaff> away         = null;
                System.Collections.Generic.IList <GroupNodeStaff> busy         = null;
                System.Collections.Generic.IList <GroupNodeStaff> hide         = null;
                System.Collections.Generic.IList <GroupNodeStaff> inme         = null;
                System.Collections.Generic.IList <GroupNodeStaff> outting      = null;
                System.Collections.Generic.IList <GroupNodeStaff> meeting      = null;
                System.Collections.Generic.IList <GroupNodeStaff> doNotDisturb = null;
                foreach (GroupNodeStaff node in nodes)
                {
                    switch (node.Status)
                    {
                    case UserStatus.Offline:
                        if (offline == null)
                        {
                            offline = new System.Collections.Generic.List <GroupNodeStaff>();
                        }
                        offline.Add(node);
                        break;

                    case UserStatus.Online:
                        if (online == null)
                        {
                            online = new System.Collections.Generic.List <GroupNodeStaff>();
                        }
                        online.Add(node);
                        break;

                    case UserStatus.Away:
                        if (away == null)
                        {
                            away = new System.Collections.Generic.List <GroupNodeStaff>();
                        }
                        away.Add(node);
                        break;

                    case UserStatus.Busy:
                        if (busy == null)
                        {
                            busy = new System.Collections.Generic.List <GroupNodeStaff>();
                        }
                        busy.Add(node);
                        break;

                    case UserStatus.Hide:
                        if (hide == null)
                        {
                            hide = new System.Collections.Generic.List <GroupNodeStaff>();
                        }
                        hide.Add(node);
                        break;

                    case UserStatus.In:
                        if (inme == null)
                        {
                            inme = new System.Collections.Generic.List <GroupNodeStaff>();
                        }
                        inme.Add(node);
                        break;

                    case UserStatus.Out:
                        if (outting == null)
                        {
                            outting = new System.Collections.Generic.List <GroupNodeStaff>();
                        }
                        outting.Add(node);
                        break;

                    case UserStatus.Meeting:
                        if (meeting == null)
                        {
                            meeting = new System.Collections.Generic.List <GroupNodeStaff>();
                        }
                        meeting.Add(node);
                        break;

                    case UserStatus.DoNotDisturb:
                        if (doNotDisturb == null)
                        {
                            doNotDisturb = new System.Collections.Generic.List <GroupNodeStaff>();
                        }
                        doNotDisturb.Add(node);
                        break;
                    }
                }
                int onlineCount = 0;
                if (online != null)
                {
                    list.Add(online);
                    onlineCount += online.Count;
                }
                if (inme != null)
                {
                    list.Add(inme);
                    onlineCount += inme.Count;
                }
                if (away != null)
                {
                    list.Add(away);
                    onlineCount += away.Count;
                }
                if (meeting != null)
                {
                    list.Add(meeting);
                    onlineCount += meeting.Count;
                }
                if (busy != null)
                {
                    list.Add(busy);
                    onlineCount += busy.Count;
                }
                if (doNotDisturb != null)
                {
                    list.Add(doNotDisturb);
                    onlineCount += doNotDisturb.Count;
                }
                if (outting != null)
                {
                    list.Add(outting);
                    onlineCount += outting.Count;
                }
                if (hide != null)
                {
                    list.Add(hide);
                }
                if (offline != null)
                {
                    list.Add(offline);
                }
                foreach (GroupNodeStaff tn in nodes)
                {
                    ic.Remove(tn);
                }
                foreach (System.Collections.Generic.IList <GroupNodeStaff> tlist in list)
                {
                    foreach (GroupNodeStaff tn in tlist)
                    {
                        ic.Add(tn);
                    }
                }
                online       = null;
                inme         = null;
                away         = null;
                meeting      = null;
                busy         = null;
                doNotDisturb = null;
                outting      = null;
                hide         = null;
                offline      = null;
                nodes        = null;
                list         = null;
            }
        }