public void LooseItemAreaWeightChanged(int weightOfLooseItem) { ProductsDAO.GetRandomLooseProduct(); currentProduct.SetWeight(weightOfLooseItem); scannedProducts.Add(currentProduct); baggingArea.SetExpectedWeight(scannedProducts.CalculateWeight()); looseItemScale.Disable(); }
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 }
private SelfCheckout selfCheckout; //This correct? How does it get passed this? // Operations public void BarcodeDetected() { // NOTE: In reality BarcodeScanner would see a real barcode and convert // it to a number. We have to fake this, so we grab a random // barcode from the available products and pretend we saw that int barcode = ProductsDAO.GetRandomProductBarcode(); selfCheckout.BarcodeWasScanned(barcode); //passes selfcheckout the random barcode }
public void BarcodeDetected() { selfCheckout.BarcodeWasScanned(ProductsDAO.GetRandomProductBarcode()); }
// Operations public void LooseProductSelected() { looseItemScale.Enable(); currentProduct = ProductsDAO.GetRandomLooseProduct(); //enable scale and get the current loose product (just finding random one for now) }
public void BarcodeWasScanned(int barcode) { scannedProducts.Add(ProductsDAO.SearchUsingBarcode(barcode)); baggingArea.SetExpectedWeight(scannedProducts.CalculateWeight()); }
// Operations public void LooseProductSelected() { ProductsDAO.GetRandomLooseProduct(); looseItemScale.Enable(); }