public JsonResult AgregarActualizarRol(BeEcRol obj) { ecRolService = new EcRolService(); ResponseViewModel res = new ResponseViewModel(); string mensaje = ""; string tipo = ""; try { if (obj.rol_id == 0) { bool valida = ecRolService.InsertarRoles(obj, ref mensaje, ref tipo); res.Tipo = tipo; res.Mensaje = mensaje; } else { bool valida = ecRolService.EditarRoles(obj, ref mensaje, ref tipo); res.Tipo = tipo; res.Mensaje = mensaje; } } catch (Exception e) { res.Tipo = Configuration.SI_MSJ_TIP_ERROR; res.Mensaje = e.Message; } return(Json(res)); }
public JsonResult BuscarRol(BeEcRol obj) { ecRolService = new EcRolService(); ResponseViewModel res = new ResponseViewModel(); string mensaje = ""; string tipo = ""; try { List <BeEcRol> lst = ecRolService.ConsultarRoles(obj, ref mensaje, ref tipo); res.Tipo = tipo; res.Mensaje = mensaje; res.Lista = lst.OrderBy(x => x.rol_id); } catch (Exception e) { res.Tipo = Configuration.SI_MSJ_TIP_ERROR; res.Mensaje = e.Message; } return(Json(res)); }