public ActionResult DeleteConfirmed(int id) { Hom hom = db.HomItems.Find(id); db.HomItems.Remove(hom); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /Home/Delete/5 public ActionResult Delete(int id = 0) { Hom hom = db.HomItems.Find(id); if (hom == null) { return(HttpNotFound()); } return(View(hom)); }
public ActionResult Edit(Hom hom) { if (ModelState.IsValid) { db.Entry(hom).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(hom)); }
public ActionResult Create(Hom hom) { if (ModelState.IsValid) { db.HomItems.Add(hom); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(hom)); }