public IHttpActionResult Get(string filterBy, string orderBy, int?from, int?to) { try { if (!from.HasValue) { from = -1; } if (!to.HasValue) { to = -1; } if (string.IsNullOrEmpty(filterBy)) { filterBy = string.Empty; } if (string.IsNullOrEmpty(orderBy)) { orderBy = string.Empty; } NegocioHistoricoRedencion negocioHistoricoRedencion = new NegocioHistoricoRedencion(); return(Content(HttpStatusCode.OK, negocioHistoricoRedencion.Consultar(filterBy, orderBy, from.Value, to.Value))); } catch (Exception ex) { log.EscribirLogError("Error al obtener la lista de HistoricoRedencion", ex); return(Content(HttpStatusCode.InternalServerError, Mensajes.DescFallo)); } }
public IHttpActionResult Put([FromBody] HistoricoRedencion historicoRedencion) { try { NegocioHistoricoRedencion negocioHistoricoRedencion = new NegocioHistoricoRedencion(); return(Content(HttpStatusCode.OK, negocioHistoricoRedencion.Actualizar(historicoRedencion))); } catch (Exception ex) { log.EscribirLogError("Error al actualizar HistoricoRedencion", ex); return(Content(HttpStatusCode.InternalServerError, Mensajes.DescFallo)); } }
public IHttpActionResult GetById(int historicoRedencionId) { try { NegocioHistoricoRedencion negocioHistoricoRedencion = new NegocioHistoricoRedencion(); return(Content(HttpStatusCode.OK, negocioHistoricoRedencion.ConsultarPorId(historicoRedencionId))); } catch (Exception ex) { log.EscribirLogError("Error al obtener el centro Centro", ex); return(Content(HttpStatusCode.InternalServerError, Mensajes.DescFallo)); } }
public IHttpActionResult Delete(int historicoRedencionId) { try { NegocioHistoricoRedencion negocioHistoricoRedencion = new NegocioHistoricoRedencion(); return(Content(HttpStatusCode.OK, negocioHistoricoRedencion.Eliminar(historicoRedencionId))); } catch (Exception ex) { log.EscribirLogError("Error al eliminar HistoricoRedencion", ex); return(Content(HttpStatusCode.InternalServerError, Mensajes.DescFallo)); } }