public int EditContent(ConsoleSideMenu content) { using (DbContext = new ApplicationDbContext()) { DbContext.Entry(content).State = EntityState.Modified; return(DbContext.SaveChanges()); } }
public int AddSideBarContent(ConsoleSideMenu content) { using (DbContext = new ApplicationDbContext()) { DbContext.Entry(content).State = System.Data.Entity.EntityState.Added; return(DbContext.SaveChanges()); } throw new NotImplementedException(); }
public ActionResult EditContentPost(ConsoleSideMenu ConsoleSideMenu) { int i = 0; if (ModelState.IsValid) { i = _sysSv.EditContent(ConsoleSideMenu); } return(Json(new { i }, JsonRequestBehavior.AllowGet)); }
private ICollection <Module> getUpperSidebars(ConsoleSideMenu cnt) { var upperSidebar = DbContext.Modules.SingleOrDefault(a => a.Id == cnt.ModuleId); var sdbBars = GetSingleTopMenu(upperSidebar.consoleTopMenuId).Modules; return(sdbBars); }