public ActionResult checkQuantity(int productID, int quantity) { var countCart = 0; var itemCart = CommonConstants.listCart.FirstOrDefault(x => x.Product.ID == productID); countCart = itemCart != null ? itemCart.Quantity : 0; var countProduct = dao.countProduct(productID); return(Json(countCart + quantity > countProduct, JsonRequestBehavior.AllowGet)); }