public ActionResult DeleteConfirmed(int id) { VitrualPet vitrualPet = db.VitrualPets.Find(id); db.VitrualPets.Remove(vitrualPet); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "VituralPetID,Name,Age,Hunger,Type,Thrist")] VitrualPet vitrualPet) { if (ModelState.IsValid) { db.Entry(vitrualPet).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(vitrualPet)); }
public ActionResult Create([Bind(Include = "VituralPetID,Name,Age,Hunger,Type,Thrist")] VitrualPet vitrualPet) { if (ModelState.IsValid) { db.VitrualPets.Add(vitrualPet); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(vitrualPet)); }
// GET: VitrualPets/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } VitrualPet vitrualPet = db.VitrualPets.Find(id); if (vitrualPet == null) { return(HttpNotFound()); } return(View(vitrualPet)); }