public List <Products> GetProductByCategoryId(int id)
        {
            OnlineShoppingBll bll = new OnlineShoppingBll();
            var lstpd             = bll.GetProductByCategoryId(id);

            return(lstpd);
        }
        public List <Cart> GetCartItems()
        {
            OnlineShoppingBll bll = new OnlineShoppingBll();
            var lstitems          = bll.GetCartDetails();

            return(lstitems);
        }
        public Product GetDetailsOfProduct(int id)
        {
            OnlineShoppingBll bll = new OnlineShoppingBll();
            var lstpd             = bll.GetDetailsOfProduct(id);

            return(lstpd);
        }
        //[Route("api/OnlineWeb/GetAllProducts/")]
        /// <summary>
        /// Get all category details
        /// <returns>List of categories</returns>
        public List <ProdCategory> Get()
        {
            OnlineShoppingBll bll = new OnlineShoppingBll();
            var lstpd             = bll.GetAllDetails();

            return(lstpd);
        }
        public List <Product> GetProductByName(string name)
        {
            OnlineShoppingBll bll = new OnlineShoppingBll();
            var lstpd             = bll.GetProductByName(name);

            return(lstpd);
        }
        public HttpResponseMessage Delete(int id)
        {
            HttpResponseMessage errRes = Request.CreateErrorResponse(HttpStatusCode.OK, "Record deleted");

            try
            {
                OnlineShoppingBll bll = new OnlineShoppingBll();
                bll.DeleteProductById(id);
            }
            catch (Exception ex)
            {
                errRes = Request.CreateErrorResponse(HttpStatusCode.NotFound, "product id not found,could not delete");
            }
            return(errRes);
        }
        public HttpResponseMessage Put([FromBody] Cart cart)
        {
            HttpResponseMessage errRes = Request.CreateErrorResponse(HttpStatusCode.OK, "Record updated");

            try
            {
                OnlineShoppingBll bll = new OnlineShoppingBll();
                bll.UpdateQuantityById(cart);
            }
            catch (Exception ex)
            {
                errRes = Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message);
            }
            return(errRes);
        }
        public void Post([FromBody] List <Cart> c)
        {
            OnlineShoppingBll bll = new OnlineShoppingBll();

            bll.AddToCart(c);
        }