示例#1
0
 public HttpResponseMessage GetAllProducts()
 {
     try
     {
         return(Request.CreateResponse(HttpStatusCode.OK, _productsManager.GetAllProducts()));
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.ToString()));
     }
 }
示例#2
0
        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
            });
        }
示例#3
0
        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));
        }