public JsonResult AgregarActualizarFuncion(BeEcFuncion obj) { ecFuncionService = new EcFuncionService(); ResponseViewModel res = new ResponseViewModel(); string mensaje = ""; string tipo = ""; try { if (obj.fun_id == 0) { bool valida = ecFuncionService.InsertarFuncion(obj, ref mensaje, ref tipo); res.Tipo = tipo; res.Mensaje = mensaje; } else { bool valida = ecFuncionService.EditarFuncion(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 BuscarFuncion(BeEcFuncion obj) { ecFuncionService = new EcFuncionService(); ResponseViewModel res = new ResponseViewModel(); string mensaje = ""; string tipo = ""; try { List <BeEcFuncion> lst = ecFuncionService.ConsultarFuncion(obj, ref mensaje, ref tipo); res.Tipo = tipo; res.Mensaje = mensaje; res.Lista = lst.OrderBy(x => x.fun_id); } catch (Exception e) { res.Tipo = Configuration.SI_MSJ_TIP_ERROR; res.Mensaje = e.Message; } return(Json(res)); }