public async void DeleteStewardess() { if (await service.DeleteEntity(SelectedStewardess.Id)) { Stewardesses.Remove(Stewardesses.FirstOrDefault(c => c.Id == SelectedStewardess.Id)); } }
private async void DeleteStewardess() { try { await _service.DeleteAsync(SelectedStewardess.Id); Stewardesses.Remove(SelectedStewardess); } catch (System.InvalidOperationException ex) { await _dialogService.ShowMessage(ex.Message, "Error"); } }
private async void BtnDelete_OnClick(object sender, RoutedEventArgs e) { Canvas.Visibility = Visibility.Visible; try { await Service.Delete(_selectedStewardess.Id); } catch { Info.Text = "Server error!"; } Stewardesses.Remove(_selectedStewardess); }
private async void UpdateStewardess() { try { var resultItem = await _service.UpdateAsync(SelectedStewardess); Stewardesses.Remove(SelectedStewardess); Stewardesses.Insert(0, resultItem); } catch (System.InvalidOperationException ex) { await _dialogService.ShowMessage(ex.Message, "Error"); } }