Пример #1
0
 private void AddRemoveMenuItem(SecurityTreeNode _node)
 {
     GroupRight groupRight;
     if (_node != null && CrGroup != null)
     {
         if (_node.Checked == true)
         {
             groupRight = CrGroup.GroupRights.Find(g => g.MenuID == _node.Name);
             if (groupRight == null)
             {
                 groupRight = new GroupRight() { GroupID = CrGroup.GroupID, MenuID = _node.Name, AllowedFunctions = 0 };
                 CrGroup.GroupRights.Add(groupRight);
             }
         }
         else
         {
             groupRight = CrGroup.GroupRights.Find(g => g.MenuID == _node.Name);
             if (groupRight != null)
             {
                 CrGroup.GroupRights.Remove(groupRight);
             }
         }
     }
 }
Пример #2
0
 public void LoadGroupRights()
 {
     NewAppsCnn newAppsCnn = new NewAppsCnn(AppSettings.CrAppSettings.NewAppsConnectionString);
     var dbGroups = from g in newAppsCnn.Sec_GroupRights where g.GroupID == this.GroupID select g;
     foreach (var dbGroup in dbGroups)
     {
         GroupRight groupRight = new GroupRight();
         groupRight.GroupID = this.GroupID;
         groupRight.MenuID = dbGroup.MenuID;
         groupRight.AllowedFunctions = dbGroup.AllowedFunctions;
         GroupRights.Add(groupRight);
     }
 }