public ActionResult Activar(int pid) { var obj = RolBL.Obtener(pid); obj.Estado = !obj.Estado; RolBL.Actualizar(obj); return(Json(true, JsonRequestBehavior.AllowGet)); }
public ActionResult ObtenerRolMenu(int pRolId) { var rol = RolBL.Obtener(pRolId); var menus = (from of in MenuBL.Listar(x => x.IndPadre.Value == false) join us in RolMenuBL.Listar(x => x.RolId == pRolId) on of.MenuId equals us.MenuId into factDesc from fd in factDesc.DefaultIfEmpty() select new { of.MenuId, Denominacion = of.Modulo + " - " + of.Denominacion, Asignado = (fd == null) ? 0 : 1 } ).ToList(); return(Json(new { Rol = rol, Menus = menus.OrderBy(x => x.Denominacion) }, JsonRequestBehavior.AllowGet)); }
public ActionResult Editar(int id = 0) { ViewBag.Roles = rolBL.Listar(); return(View(id == 0 ? new Rol() : rolBL.Obtener(id))); }