public ActionResult DeleteConfirmed(long id) { tblPokemon tblPokemon = db.tblPokemons.Find(id); db.tblPokemons.Remove(tblPokemon); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(tblPokemon tblPokemon) { if (ModelState.IsValid) { tblPokemon.UploadDate = DateTime.Now; db.Entry(tblPokemon).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tblPokemon)); }
public ActionResult Create(tblPokemon tblPokemon) { if (ModelState.IsValid) { tblPokemon.UploadDate = DateTime.Now; db.tblPokemons.Add(tblPokemon); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tblPokemon)); }
// GET: Pokemon/Delete/5 public ActionResult Delete(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblPokemon tblPokemon = db.tblPokemons.Find(id); if (tblPokemon == null) { return(HttpNotFound()); } return(View(tblPokemon)); }
public ActionResult PokemonDetails(tblPokemon pokemon) { //Testing return(View(pokemon)); }