public ActionResult EditAction(Models.AboutNav sentNav) { Models.AboutNav foundNav = db.AboutNav.FirstOrDefault(s => s.Id == sentNav.Id); foundNav.Icon = sentNav.Icon; foundNav.Name = sentNav.Name; db.SaveChanges(); return(RedirectToAction("Index", "Setting")); }
public ActionResult Delete(int Id) { Models.AboutNav foundNav = db.AboutNav.FirstOrDefault(s => s.Id == Id); if (foundNav != null) { db.AboutNav.Remove(foundNav); db.SaveChanges(); } else { return(HttpNotFound()); } return(RedirectToAction("Index", "Setting")); }
public ActionResult CreateAction(Models.AboutNav newAboutNav) { db.AboutNav.Add(newAboutNav); db.SaveChanges(); return(RedirectToAction("Index")); }