示例#1
0
 public async Task <bool> UpdateUserAsync(ViewModels.User user)
 {
     try
     {
         return(await _userHttpService.UpdateUserAsync(user));
     }
     catch (Exception ex)
     {
         _logger.LogError("UpdateUserAsync failed, {@Exception}", ex);
         return(false);
     }
 }
示例#2
0
        private async void SaveButton_Clicked(object sender, EventArgs e)
        {
            var user = new User()
            {
                UserId       = int.Parse(UserId.Text),
                UserName     = UserName.Text,
                UserPassword = UserPassword.Text
            };

            if (await _userHttpService.UpdateUserAsync(user))
            {
                await DisplayAlert("Success", "User successfully updated", "OK");

                await Navigation.PopAsync();
            }
            else
            {
                await DisplayAlert("Failure", "Something went wrong", "Ok");
            }
        }