Ejemplo n.º 1
0
 /// <summary>
 /// Called when Remove button is pressed.
 /// </summary>
 /// <param name="groupPo">Selected group</param>
 public void OnRemoveRole(GroupPo groupPo)
 {
     if (groupPo == null)
     {
         return;
     }
     UsersGroups.Remove(groupPo);
     NotifyOfPropertyChange(() => UsersGroups);
     NotifyOfPropertyChange(() => Groups);
     this.OnActivate();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Called when Add button is pressed.
 /// </summary>
 /// <param name="group">Selected group</param>
 public void OnAddRole(Group group)
 {
     if (group == null)
     {
         return;
     }
     GroupPo groupPo=new GroupPo();
     groupPo.LoadPo(group);
     UsersGroups.Add(groupPo);
     NotifyOfPropertyChange(() => UsersGroups);
     NotifyOfPropertyChange(() => Groups);
     this.OnActivate();
 }
Ejemplo n.º 3
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();
 }