Пример #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();
                            }
                        }
                    }
                }
            }
        }
Пример #2
0
 public GroupNodeStaff(long gid, Staff staff)
 {
     try
     {
         this.InitializeComponent();
         if (staff != null)
         {
             this.gid                = gid;
             this.staff              = staff;
             this.tbkName.Text       = this.GetName(staff);
             this.imgFace.Background = new ImageBrush
             {
                 ImageSource = staff.HeaderImage
             };
             this.imgFace_foreground.Source = staff.StatusIcon;
             EntGroup entGroup = this.dataService.GetEntGroup(gid);
             if (entGroup != null)
             {
                 if (entGroup.IsAdmin(staff.Uid))
                 {
                     this.imgFaceManager.Source = entGroup.AdminIcon;
                 }
                 if (staff.Uid != this.sessionService.Uid && entGroup.IsAdmin(this.sessionService.Uid))
                 {
                     if (!entGroup.IsAdmin(staff.Uid))
                     {
                         this.AddAdminContextMenu();
                     }
                     else
                     {
                         this.DeleAdminContextMenu();
                     }
                 }
             }
         }
     }
     catch (System.Exception e)
     {
         ServiceUtil.Instance.Logger.Error(e.ToString());
     }
 }