Exemplo n.º 1
0
 public void InitRight(string username, Boolean admin)
 {
     lbAssigned.Items.Clear();
     if (!admin)
     {
         List <DAL.UserRight> list = _bll.GetRightByUserName(username);
         if (list != null && list.Count > 0)
         {
             list.ToList().ForEach(p => lbAssigned.Items.Add(p.Right));
             this.btnRight.Enabled = true;
         }
         else
         {
             lbAssigned.Items.Add(RightsText.ConfigurateDevices);
             lbAssigned.Items.Add(RightsText.CommentRecords);
             //this.btnLeft.Enabled = false;
         }
     }
     else
     {
         Rights r = Common.GetRightsList();
         if (r == null)
         {
             r = Common.SetRightsList();
         }
         r.right.ToList().ForEach(p => this.lbAssigned.Items.Add(p));
         this.btnLeft.Enabled = true;
     }
     SetValue();
 }
Exemplo n.º 2
0
        /// <summary>
        /// 加载左边的xml值
        /// </summary>
        private void InitLeft()
        {
            Rights r = Common.GetRightsList();

            if (r == null)
            {
                r = Common.SetRightsList();
            }
            r.right.ToList().ForEach(p => this.lbAvailbale.Items.Add(p));
        }