/// <summary>
 /// Called when Remove button is pressed.
 /// </summary>
 /// <param name="permissionPo">Selected permission</param>
 public void OnRemovePermission(PermissionPo permissionPo)
 {
     if (permissionPo == null)
     {
         return;
     }
     UsersPermissions.Remove(permissionPo);
     NotifyOfPropertyChange(() => UsersPermissions);
     NotifyOfPropertyChange(() => Permissions);
     this.OnActivate();
 }
 /// <summary>
 /// Called when Add button is pressed.
 /// </summary>
 /// <param name="permission">Selected permission</param>
 public void OnAddPermission(Permission permission)
 {
     if (permission == null)
     {
         return;
     }
     PermissionPo permissionPo = new PermissionPo();
     permissionPo.LoadPo(permission);
     UsersPermissions.Add(permissionPo);
     NotifyOfPropertyChange(() => UsersPermissions);
     NotifyOfPropertyChange(() => Permissions);
     this.OnActivate();
 }
Exemple #3
0
        /// <summary>
        /// Loads the po.
        /// </summary>
        /// <param name="group">The group.</param>
        public void LoadPo(Group group)
        {
            this.Id = group.Id;
            this.Name = group.Name;
            this.Description = group.Description;
            this.Enabled = group.Enabled;
            foreach (Permission ep in group.Permissions)
            {
                var permission = new PermissionPo();
                permission.Name = ep.Name;
                permission.Id = ep.Id;
                Permissions.Add(permission);

            }
            Permissions.ClearChanges();
        }
Exemple #4
0
 /// <summary>
 /// Loads the po.
 /// </summary>
 /// <param name="user">The user.</param>
 public void LoadPo(UserDto user)
 {
     Name = user.UserName;
     LastLogin = user.LastLogin;
     LastName = user.LastName;
     FirstName = user.FirstName;
     Email = user.Email;
     BirthNumber = user.BirthNumber;
     this.ProfesionId=user.ProfessionId;
     foreach (GroupDto group in user.Groups)
     {
         GroupPo groupPo=new GroupPo();
         groupPo.LoadPo(group);
         this.Groups.Add(groupPo);
     }
     foreach (PermissionDto permission in user.Permissions)
     {
         PermissionPo permissionPo=new PermissionPo();
         permissionPo.Id = permission.Id;
         permissionPo.Name = permission.Name;
         permissionPo.Enabled = permission.Enabled;
         Permissions.Add(permissionPo);
     }
     this.Groups.ClearChanges();
     this.Permissions.ClearChanges();
 }