public ActionResult DeleteConfirmed(int id) { Pet4 pet4 = db.Pet4.Find(id); db.Pet4.Remove(pet4); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PetID,Type,Breed,Age,Gender,PetName,Photo")] Pet4 pet4) { if (ModelState.IsValid) { db.Entry(pet4).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pet4)); }
public ActionResult Create([Bind(Include = "PetID,Type,Breed,Age,Gender,PetName,Photo")] Pet4 pet4) { if (ModelState.IsValid) { db.Pet4.Add(pet4); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pet4)); }
// GET: Pet4/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Pet4 pet4 = db.Pet4.Find(id); if (pet4 == null) { return(HttpNotFound()); } return(View(pet4)); }