Ejemplo n.º 1
0
 public async void DeleteCrew()
 {
     if (await service.DeleteEntity(SelectedCrew.Id))
     {
         Crews.Remove(Crews.FirstOrDefault(c => c.Id == SelectedCrew.Id));
     }
 }
Ejemplo n.º 2
0
        private async void DeleteCrew()
        {
            try
            {
                await _service.DeleteAsync(SelectedCrew.Id);

                Crews.Remove(SelectedCrew);
            }
            catch (System.InvalidOperationException ex)
            {
                await _dialogService.ShowMessage(ex.Message, "Error");
            }
        }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
        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");
            }
        }
Ejemplo n.º 5
0
 private void RemoveEntityCommand_Execute(object parameter)
 {
     Client.RemoveEntity(SelectedItem);
     Crews.Remove(SelectedItem as Crew);
 }