public ActionResult Editar(int id = -1) { RolModel rolModel = new RolModel(); RolDAO roleDAO = new RolDAO(); rolModel.habilitado = true; ModuloBLL moduleBuilder = new ModuloBLL(); rol rolEntity = roleDAO.GetFromId(id, db); if (rolEntity != null) { rolModel.idRol = rolEntity.ID; rolModel.nombre = rolEntity.NOMBRE; rolModel.descripcion = rolEntity.DESCRIPCION; rolModel.habilitado = rolEntity.ACTIVO; } rolModel.listaModulosSubmodulos = moduleBuilder.ObtenerModeloModuloSubmodulos(rolEntity, db); rolModel.listaPermisosEspecilaes = moduleBuilder.ObtenerPermisosEspeciales(rolEntity, db); ViewBag.Editar = true; return(View(CREATE_UPDATE_ABSOLUTE_PATH, rolModel)); }
public ActionResult Ver(int id) { RolModel rolModel = new RolModel(); RolDAO roleDAO = new RolDAO(); ModuloBLL moduleBuilder = new ModuloBLL(); rol rolEntity = roleDAO.GetFromId(id, db); if (rolEntity != null) { rolModel.idRol = rolEntity.ID; rolModel.nombre = rolEntity.NOMBRE; rolModel.descripcion = rolEntity.DESCRIPCION; rolModel.habilitado = rolEntity.ACTIVO; rolModel.listaModulosSubmodulos = moduleBuilder.ObtenerModeloModuloSubmodulos(rolEntity, db); rolModel.listaPermisosEspecilaes = moduleBuilder.ObtenerPermisosEspeciales(rolEntity, db); ViewBag.Editar = false; return(View(CREATE_UPDATE_ABSOLUTE_PATH, rolModel)); } TempData["message"] = "danger, No fue posible cargar sus datos"; return(RedirectToAction("Index")); }