Exemplo n.º 1
0
        async Task Save()
        {
            //! Id == null ==> Post sonst put
            var result = await AuthenticationApiService.EditUserAsync(FormUser);

            if (result.IsSuccessful)
            {
                NavigationManager.NavigateTo("/", false);
            }
            else
            {
                UtilityServices.ShowNotification(NotificationSeverity.Error, "Save Userdata failed", result.Errors.ToArray());
            }
        }
Exemplo n.º 2
0
        async Task DeleteConfirmation(UserDetailsDto user)
        {
            bool ok = (await DialogService.Confirm("Are you sure to delete user?", "Delete User", new ConfirmOptions()
            {
                OkButtonText = "Yes", CancelButtonText = "No"
            })).GetValueOrDefault();

            if (ok)
            {
                var result = await AuthenticationApiService.DeleteUserAsync(user.Id);

                if (result.IsSuccessful)
                {
                    ApplicationUsers.Remove(user);
                    await UsersGrid.Reload();
                }
                else
                {
                    UtilityServices.ShowNotification(NotificationSeverity.Error, "Delete User failed", result.Errors.ToArray());
                    NavigationManager.NavigateTo("/users", true);
                }
            }
        }