public bool SetQuantityStockCheck(int ProductID, int Quantity) { BLProduct product = new BLProduct(); product.ID = ProductID; product.Retrieve(); if( Quantity > product.Inventory ) return false; else DALCShoppingCart.SetQuantity(ProductID, this.customerID, Quantity); return true; }
public bool AddProductStockCheck(int productID, int quantity, bool personalize) { BLProduct product = new BLProduct(); product.ID = productID; product.Retrieve(); DataRow[] rows = this.Products.Tables[0].Select("ProductID=" + productID.ToString()); int prdQuantityAtCart = ( rows.Length > 0 ) ? (int)(rows[0]["Quantity"]) : 0; if( quantity + prdQuantityAtCart > product.Inventory ) return false; else DALCShoppingCart.Add(productID, this.customerID, quantity, personalize); return true; }