protected override async void ExecuteChangeCommand(object obj) { if (_viewModel.SelectedSeason == null) { MessageBox.Show("Bitte wählen Sie eine Saison aus!", "Keine Saison ausgewählt", MessageBoxButton.OK, MessageBoxImage.Warning); return; } var addSeasonWindow = new AddSeasonWindowController { Season = _viewModel.SelectedSeason }; var showSeason = addSeasonWindow.ShowSeason(); // it could be possible that the bettor is null if (showSeason == null) { ReloadModels(); return; } // Check if service is available if (!await AdminClientHelper.IsAvailable(_adminClient)) { return; } // add bettor var isUpdated = await _adminClient.UpdateSeasonAsync(showSeason); UpdateModels(isUpdated, "Die Saison konnte nicht geändert werden!", "Änderung fehlgeschlagen"); }
protected override async void ExecuteAddCommand(object obj) { var addSeasonWindow = new AddSeasonWindowController { Season = new Season() }; var showSeason = addSeasonWindow.ShowSeason(); // it could be possible that the bettor is null if (showSeason == null) { return; } // Check if service is available if (!await AdminClientHelper.IsAvailable(_adminClient)) { return; } // add bettor var isAdded = await _adminClient.AddSeasonAsync(showSeason); UpdateModels(isAdded, "Saison konnte nicht hinzugefügt werden, da der Name schon vergeben ist!", "Hinzufügen fehlgeschlagen"); }