public HttpResponseMessage Remove(int id) { try { var cartitembs = new CartItemBusiness(); cartitembs.Borrar(id); var httpok = new HttpResponseMessage() { StatusCode = (HttpStatusCode)200, ReasonPhrase = "Item Eliminado" }; return(httpok); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public CartItem AddCart(CartItem cartItem) { try { var cib = new CartItemBusiness(); return(cib.Create(cartItem)); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, Content = new StringContent(ex.Message + "+" + ex.InnerException), }; throw new HttpResponseException(httpError); } }
public CartItem Add(CartItem cartitem) { try { var cartitembs = new CartItemBusiness(); return(cartitembs.nuevo(cartitem)); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public CartItem AddCart(CartItem cartItem) { try { var bc = new CartItemBusiness(); return(bc.Create(cartItem)); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message + "+" + ex.InnerException }; throw new HttpResponseException(httpError); } }
public void Remove(int id) { try { var bc = new CartItemBusiness(); bc.Remove(id); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public void Remove(int id) { try { var cib = new CartItemBusiness(); cib.Delete(id); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, Content = new StringContent(ex.Message), }; throw new HttpResponseException(httpError); } }
public CartItem Find(int id) { try { var cib = new CartItemBusiness(); return(cib.GetById(id)); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, Content = new StringContent(ex.Message), }; throw new HttpResponseException(httpError); } }
public List <CartItem> List() { try { var cartitembs = new CartItemBusiness(); return(cartitembs.ListarTodosCartItems()); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public CartItem GetById(int id) { try { var cartitembs = new CartItemBusiness(); return(cartitembs.GetbyID(id)); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public CartItem Find(int id) { try { var bc = new CartItemBusiness(); return(bc.GetCartItem(id)); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public void Edit(CartItem cartItem) { try { var bc = new CartItemBusiness(); bc.EditarCartItem(cartItem); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public void Edit(CartItem cartItem) { try { var cib = new CartItemBusiness(); cib.Edit(cartItem); } catch (Exception ex) { // Repack to Http error. var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, Content = new StringContent(ex.Message), }; throw new HttpResponseException(httpError); } }
public FindResponseCartItem Find(int id) { try { var response = new FindResponseCartItem(); var bc = new CartItemBusiness(); response.Result = bc.Find(id); return(response); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }