public Shipping Add(Shipping ship) { try { var shipbs = new ShippingBusiness(); return(shipbs.nuevo(ship)); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public List <Shipping> List() { try { var shipbs = new ShippingBusiness(); return(shipbs.ListarTodas()); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public Shipping GetbyCookie(string cookie) { try { var shipbs = new ShippingBusiness(); return(shipbs.GetbyCookie(cookie)); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public void Remove(int id) { try { var shipbs = new ShippingBusiness(); var ship = shipbs.GetbyID(id); shipbs.Borrar(ship); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }