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; } NegocioLogMovimientos negocioLogMovimientos = new NegocioLogMovimientos(); return(Content(HttpStatusCode.OK, negocioLogMovimientos.Consultar(filterBy, orderBy, from.Value, to.Value))); } catch (Exception ex) { log.EscribirLogError("Error al obtener la lista de LogMovimientos", ex); return(Content(HttpStatusCode.InternalServerError, Mensajes.DescFallo)); } }
public IHttpActionResult Put([FromBody] LogMovimientos logMovimientos) { try { NegocioLogMovimientos negocioLogMovimientos = new NegocioLogMovimientos(); return(Content(HttpStatusCode.OK, negocioLogMovimientos.Actualizar(logMovimientos))); } catch (Exception ex) { log.EscribirLogError("Error al actualizar LogMovimientos", ex); return(Content(HttpStatusCode.InternalServerError, Mensajes.DescFallo)); } }
public IHttpActionResult GetById(int movimientoId) { try { NegocioLogMovimientos negocioLogMovimientos = new NegocioLogMovimientos(); return(Content(HttpStatusCode.OK, negocioLogMovimientos.ConsultarPorId(movimientoId))); } catch (Exception ex) { log.EscribirLogError("Error al obtener el centro Centro", ex); return(Content(HttpStatusCode.InternalServerError, Mensajes.DescFallo)); } }
public IHttpActionResult Delete(int movimientoId) { try { NegocioLogMovimientos negocioLogMovimientos = new NegocioLogMovimientos(); return(Content(HttpStatusCode.OK, negocioLogMovimientos.Eliminar(movimientoId))); } catch (Exception ex) { log.EscribirLogError("Error al eliminar LogMovimientos", ex); return(Content(HttpStatusCode.InternalServerError, Mensajes.DescFallo)); } }