/// <summary> /// Decrements the bin inventory. /// </summary> /// <param name="bin">The bin.</param> /// <returns></returns> protected int DecrementBinInventory(BinVend bin) { List <BinVend> binVends = new List <BinVend>(); SqlParameter[] paramenters = new SqlParameter[2]; paramenters[0] = new SqlParameter("@BindID", bin.BinId); paramenters[1] = new SqlParameter("@Quantity", bin.Quantity); int result = SqlHelper.ExecuteNonQuery(BaseController.ConnectionString, "DecrementBinInventory", paramenters); return(result); }
/// <summary> /// Gets the binsby product. /// </summary> /// <param name="productType">Type of the product.</param> /// <returns></returns> protected List <BinVend> GetBinsbyProduct(ProductTypes productType) { List <BinVend> binVends = new List <BinVend>(); SqlParameter[] paramenters = new SqlParameter[1]; paramenters[0] = new SqlParameter("@Product", productType.ToString()); SqlDataReader reader = SqlHelper.ExecuteReader(BaseController.ConnectionString, "GetBinsbyProduct", paramenters); while (reader.Read()) { BinVend bin = new BinVend(); bin.BinId = SqlHelper.ToInt32(reader, "BinID"); bin.Quantity = SqlHelper.ToInt32(reader, "PackageQuantity"); binVends.Add(bin); } return(binVends); }