public async Task RemoveSelectedRole() { await _userEndPoint.RemoveUserFromRole(SelectedUser.Id, SelectedRoleToRemove); SelectedUserRoles.Remove(SelectedRoleToRemove); AvailableRoles.Add(SelectedRoleToRemove); }
public async Task RemoveSelectedRole() { await _userEndpoint.RemoveUserToRole(SelectedUser.Id, SelectedUserRole); AvailableRoles.Add(SelectedAvailableRole); UserRoles.Remove(SelectedUserRole); }
public async void RemoveSelectedRole() { await _userEndpoint.RemoveUserFromRole(SelectedUser.Id, SelectedUserRole); AvailableRoles.Add(SelectedUserRole); UserRoles.Remove(SelectedUserRole); }
protected void OnChangeToAvailable() { var tmp = SelectedUsedRole; if (tmp == null) { System.Windows.MessageBox.Show("Selecteer a.u.b. een item"); return; } var userRole = GetByUserIDAndRoleID( SelectedItem.UserID, SelectedUsedRole.RoleID); if (userRole != null) { userRoleRepo.Delete(userRole.UserRoleID); AvailableRoles.Add(_selectedUsedRole); RaisePropertyChanged("AvailableRoles"); UsedRoles.Remove(_selectedUsedRole); RaisePropertyChanged("UsedRoles"); } else { System.Windows.MessageBox.Show("Onverwachte fout"); } SaveUser(); }
public async void RemoveSelectedRole() { await _userEndpoint.RemoveUserFromRole(SelectedUser.Id, SelectedRoleToRemove); AvailableRoles.Add(SelectedRoleToRemove); SelectedUserRoles.Remove(SelectedRoleToRemove); NotifyOfPropertyChange(() => Users); }
private async Task LoadRoles() { var roles = await _userEndpoint.GetAllRoles(); foreach (var role in roles) { if (SelectedUserRoles.IndexOf(role.Value) < 0) { AvailableRoles.Add(role.Value); } } }
private async Task LoadRoles() { var roles = await _userEndPoint.GetAllRoles(); foreach (var role in roles) { if (SelectedUserRoles.Contains(role.Value)) { AvailableRoles.Add(role.Value); } } }
public async Task LoadRoles() { var roles = await _userEndPoint.GetAllRoles(); foreach (var role in roles) { if (UserRoles.IndexOf(role.Value) < 0) { AvailableRoles.Add(role.Value); } } }
private async Task LoadAvailableRoles() { // call api to get all roles var roles = await _userEndpoint.GetAllRoles(); foreach (var role in roles) { // check selected user role for existing roles, -1 is returned if the role is not asigned to current user if (SelectedUserRole.IndexOf(role.Value) < 0) { // add those unasigned roles to the list of available roles AvailableRoles.Add(role.Value); } } }
public async void RemoveSelectedRole() { try { await _userEndpoint.RemoveUserFromRole(SelectedUser.Id, SelectedRoleToRemove); SelectedUserRole.Remove(SelectedRoleToRemove); AvailableRoles.Add(SelectedRoleToRemove); await LoadAvailableRoles(); NotifyOfPropertyChange(() => AvailableRoles); } catch (Exception exc) { throw exc; } }