Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
 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));
 }