public async void DeleteCrew() { if (await service.DeleteEntity(SelectedCrew.Id)) { Crews.Remove(Crews.FirstOrDefault(c => c.Id == SelectedCrew.Id)); } }
private async void DeleteCrew() { try { await _service.DeleteAsync(SelectedCrew.Id); Crews.Remove(SelectedCrew); } 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(_selectedCrew.Id); } catch { Info.Text = "Server error!"; } Crews.Remove(_selectedCrew); }
private async void UpdateCrew() { try { var resultItem = await _service.UpdateAsync(SelectedCrew); Crews.Remove(SelectedCrew); Crews.Insert(0, resultItem); } catch (System.InvalidOperationException ex) { await _dialogService.ShowMessage(ex.Message, "Error"); } }
private void RemoveEntityCommand_Execute(object parameter) { Client.RemoveEntity(SelectedItem); Crews.Remove(SelectedItem as Crew); }