Ejemplo n.º 1
0
 public override void DoEdit(bool updateAllFields = false)
 {
     if (SelectedRolesIDs == null || SelectedRolesIDs.Count == 0)
     {
         FC.Add("Entity.SelectedRolesIDs.DONOTUSECLEAR", "true");
     }
     else
     {
         Entity.UserRoles = new List <FrameworkUserRole>();
         SelectedRolesIDs.ForEach(x => Entity.UserRoles.Add(new FrameworkUserRole {
             ID = Guid.NewGuid(), UserId = Entity.ID, RoleId = x
         }));
     }
     if (SelectedGroupIDs == null || SelectedGroupIDs.Count == 0)
     {
         FC.Add("Entity.SelectedGroupIDs.DONOTUSECLEAR", "true");
     }
     else
     {
         SelectedGroupIDs.ForEach(x => Entity.UserGroups.Add(new FrameworkUserGroup {
             ID = Guid.NewGuid(), UserId = Entity.ID, GroupId = x
         }));
     }
     base.DoEdit(updateAllFields);
 }
Ejemplo n.º 2
0
 public override void DoEdit(bool updateAllFields = false)
 {
     if (ControllerName.Contains("WalkingTec.Mvvm.Mvc.Admin.Controllers"))
     {
         Entity.UserRoles  = new List <FrameworkUserRole>();
         Entity.UserGroups = new List <FrameworkUserGroup>();
         if (SelectedRolesIDs != null)
         {
             SelectedRolesIDs.ForEach(x => Entity.UserRoles.Add(new FrameworkUserRole {
                 ID = Guid.NewGuid(), UserId = Entity.ID, RoleId = x
             }));
         }
         if (SelectedGroupIDs != null)
         {
             SelectedGroupIDs.ForEach(x => Entity.UserGroups.Add(new FrameworkUserGroup {
                 ID = Guid.NewGuid(), UserId = Entity.ID, GroupId = x
             }));
         }
     }
     base.DoEdit(updateAllFields);
 }
Ejemplo n.º 3
0
        public override async Task DoEditAsync(bool updateAllFields = false)
        {
            FC.TryAdd("Entity.UserRoles", 0);
            FC.TryAdd("Entity.UserGroups", 0);
            Entity.UserRoles  = new List <FrameworkUserRole>();
            Entity.UserGroups = new List <FrameworkUserGroup>();
            if (SelectedRolesIDs != null)
            {
                SelectedRolesIDs.ForEach(x => Entity.UserRoles.Add(new FrameworkUserRole {
                    ID = Guid.NewGuid(), UserId = Entity.ID, RoleId = x
                }));
            }
            if (SelectedGroupIDs != null)
            {
                SelectedGroupIDs.ForEach(x => Entity.UserGroups.Add(new FrameworkUserGroup {
                    ID = Guid.NewGuid(), UserId = Entity.ID, GroupId = x
                }));
            }
            await base.DoEditAsync(updateAllFields);

            await KnifeVirgo.RemoveUserCache(Entity.ID.ToString());
        }
Ejemplo n.º 4
0
        public override async Task DoEditAsync(bool updateAllFields = false)
        {
            if (ControllerName.Contains("WalkingTec.Mvvm.Mvc.Admin.Controllers"))
            {
                Entity.UserRoles  = new List <FrameworkUserRole>();
                Entity.UserGroups = new List <FrameworkUserGroup>();
                if (SelectedRolesIDs != null)
                {
                    SelectedRolesIDs.ForEach(x => Entity.UserRoles.Add(new FrameworkUserRole {
                        ID = Guid.NewGuid(), UserId = Entity.ID, RoleId = x
                    }));
                }
                if (SelectedGroupIDs != null)
                {
                    SelectedGroupIDs.ForEach(x => Entity.UserGroups.Add(new FrameworkUserGroup {
                        ID = Guid.NewGuid(), UserId = Entity.ID, GroupId = x
                    }));
                }
            }
            await base.DoEditAsync(updateAllFields);

            await LoginUserInfo.RemoveUserCache(Entity.ID.ToString());
        }