public HttpResponseMessage GetProductStock(int id) { try { var data = new ProductStockBL().GetProductStock(id); return(Request.CreateResponse(HttpStatusCode.OK, data)); } catch (Exception ex) { LogManager.Instance.Error(ex); return(Request.CreateResponse(HttpStatusCode.InternalServerError)); } }
public HttpResponseMessage GetProductStockDtosByWp(int id, ProductStockCommand cmd) { try { int pagesCount = 0; var data = new ProductStockBL().GetProductStockDtosByWp(id, cmd, ref pagesCount); var result = Request.CreateResponse(HttpStatusCode.OK, data); result.Headers.Add(Consts.PAGES_COUNT, pagesCount.ToString()); return(result); } catch (Exception ex) { LogManager.Instance.Error(ex); return(Request.CreateResponse(HttpStatusCode.InternalServerError, false)); } }
public HttpResponseMessage GetProductStocks(string query) { try { var cmd = JsonConvert.DeserializeObject <ProductStockCommand>(query); int pagesCount = 0; var data = new ProductStockBL().GetProductStocks(cmd, ref pagesCount); var result = Request.CreateResponse(HttpStatusCode.OK, data); result.Headers.Add(Consts.PAGES_COUNT, pagesCount.ToString()); return(result); } catch (Exception ex) { LogManager.Instance.Error(ex); return(Request.CreateResponse(HttpStatusCode.InternalServerError)); } }