Пример #1
0
        public HttpResponseMessage UpdateCart(int cartid, int productid, int cartquantity)
        {
            var productquantity = entities.tblProducts.Where(p => p.productid == productid)
                                  .Select(p => p.productquantity).FirstOrDefault();

            if (cartquantity <= productquantity && cartquantity > 0)
            {
                entities.proc_Update_Cart(cartid, productid, cartquantity);
                entities.SaveChanges();
                return(Request.CreateResponse(HttpStatusCode.OK, "Success"));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.OK, "not available"));
            }
        }