public IActionResult DeletePokemon(int pokedexPokemonId) { try { PokedexPokemon pokedexPokemon = Pokedexes.FindOnePokemonByID(pokedexPokemonId); Pokedexes.DisablePokemon(pokedexPokemon); return(Ok()); } catch (Exception error) { return(StatusCode(500)); } }
private void ButtonRow_Click(object sender, RoutedEventArgs e) { PokedexPokemon pokedexPokemon = ((PokedexPokemonData)((Button)e.Source).DataContext).PokedexPokemon; MessageBoxResult messageBoxResult = MessageBox.Show("Are you sure you want to kill " + pokedexPokemon.Pokemon.Name + " (lvl. " + pokedexPokemon.Level + ")?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question); if (messageBoxResult == MessageBoxResult.Yes) { Pokedexes.DisablePokemon(pokedexPokemon); Session.UpdatePlayer(); RefreshData(); } }