public HttpResponseMessage GetAllProducts() { try { return(Request.CreateResponse(HttpStatusCode.OK, _productsManager.GetAllProducts())); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.ToString())); } }
public EntitListViewModel <Product> Get(PageInfo pageInfo) { if (pageInfo == null) { pageInfo = new PageInfo(); } pageInfo.ItemsCount = _productsManager.GetProductsCount(); var products = _productsManager.GetAllProducts(pageInfo); return(new EntitListViewModel <Product> { PageInfo = pageInfo, Entities = products }); }
public IList <tbl_Products> GetProducts(int?daId) { try { ProductsManager ProdManager = new ProductsManager(); IList <tbl_Products> lstprods = ProdManager.GetAllProducts(daId); return(lstprods); } catch (Exception) { throw; } }
public ProductsViewModel GetProducts(int?designAccelaratorID) { try { ProductsViewModel prodviewmodel = new ProductsViewModel(); ProductsManager prodManager = new ProductsManager(); prodviewmodel.lstLOB = prodManager.GetLOBs(designAccelaratorID); prodviewmodel.lstBuzProd = prodManager.GetBuzProds(designAccelaratorID); prodviewmodel.lstProd = prodManager.GetAllProducts(designAccelaratorID); return(prodviewmodel); } catch (Exception) { throw; } }
// GET api/products public IHttpActionResult Get() { var products = _service.GetAllProducts(); return(Ok(products)); }