public ActionResult DeleteConfirmed(int id) { Humane humane = db.Humanes.Find(id); db.Humanes.Remove(humane); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(Humane humane) { if (ModelState.IsValid) { db.Entry(humane).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(humane)); }
public ActionResult Create(Humane humane) { if (ModelState.IsValid) { db.Humanes.Add(humane); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(humane)); }
// GET: Restaurant/Details/id public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Humane humane = db.Humanes.Find(id); if (humane == null) { return(HttpNotFound()); } return(View(humane)); }