public ActionResult Edit([Bind(Include = "ID,RoleID,MenuText,IDParentMenu,IconMenu,OrderSort")] MenuApp menuApp) { if (ModelState.IsValid) { db.Entry(menuApp).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.parent = db.MenuApp.Where(a => a.IDParentMenu == null).ToList(); ViewBag.RoleID = new SelectList(db.Roles, "id", "name", menuApp.RoleID); return(View("~/Views/appdashboard/masterdata/Menu/Edit.cshtml", menuApp)); }
public ActionResult Edit([Bind(Include = "id,id_group,id_parent,remark")] GroupLevel groupLevel) { if (ModelState.IsValid) { db.Entry(groupLevel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.parent = db.GroupLevel.Include(g => g.GroupLevel2).Include(g => g.Groups).Where(a => a.id_parent == null).ToList(); ViewBag.id_group = new SelectList(db.Groups, "id", "name", groupLevel.id_group); return(View("~/Views/appdashboard/adminsystem/GroupLevel/Edit.cshtml", groupLevel)); }