private async Task OnDelete()
        {
            try
            {
                IsBusy = true;

                if (!(await Alert.ShowMessageConfirmation(
                          $"Are you sure you want to delete the user {_user.FirstName} {_user.LastName}?", null, "Yes",
                          "No")))
                {
                    return;
                }

                AppUsersQueryContext context = new AppUsersQueryContext
                {
                    LoginId   = _user.LoginId,
                    FirstName = _user.FirstName,
                    LastName  = _user.LastName,
                    Id        = _user.AppUserId
                };
                var deleteResponse = await Api.DeleteUser(context);

                if (!deleteResponse.Successful.GetValueOrDefault())
                {
                    await Alert.DisplayApiCallError(deleteResponse.ExceptionMessage,
                                                    deleteResponse.ValidationErrors, "Could not get branches");

                    return;
                }

                await Nav.Nav.PopAsync();
            }
            catch (Exception e)
            {
                await Alert.DisplayError(e,
                                         "Could not delete user - server error, please check your connection and try again");
            }
            finally
            {
                IsBusy = false;
            }
        }
Example #2
0
 public async Task <ApiResponseOfAppUserView> DeleteUser(AppUsersQueryContext context)
 {
     return(await AXClient.Instance.DeleteUserAsync(context)
            .ConfigureAwait(false));
 }
Example #3
0
 public async Task <ApiResponseOfAppUserView> GetUserById(AppUsersQueryContext context)
 {
     return(await AXClient.Instance.GetUserByIdAsync(context)
            .ConfigureAwait(false));
 }