public void BarcodeWasScanned(int barcode) { currentProduct = ProductsDAO.SearchUsingBarcode(barcode); //Find product in the database and store it scannedProducts.Add(currentProduct); //Add product to ScannedProducts ProductsList[i] = currentProduct; //put current product into productslist mostRecentProduct = ProductsList[i]; //gets recent product from list baggingArea.SetExpectedWeight(scannedProducts.CalculateWeight()); //Use to SetExpectedWeight in BaggingAreaScale to new weight ++i; //adds to index of products }
public void BarcodeWasScanned(int barcode) { scannedProducts.Add(ProductsDAO.SearchUsingBarcode(barcode)); baggingArea.SetExpectedWeight(scannedProducts.CalculateWeight()); }