// Constructor public UserInterface() { InitializeComponent(); // NOTE: This is where we set up all the objects, // and create the various relationships between them. baggingAreaScale = new BaggingAreaScale(); scannedProducts = new ScannedProducts(); barcodeScanner = new BarcodeScanner(); looseItemScale = new LooseItemScale(); selfCheckout = new SelfCheckout(baggingAreaScale, scannedProducts, looseItemScale); barcodeScanner.LinkToSelfCheckout(selfCheckout); baggingAreaScale.LinkToSelfCheckout(selfCheckout); looseItemScale.LinkToSelfCheckout(selfCheckout); //button enabled/disabled btnUserWeighsLooseProduct.Enabled = false; btnUserPutsProductInBaggingAreaCorrect.Enabled = false; btnUserPutsProductInBaggingAreaIncorrect.Enabled = false; btnUserChooseToPay.Enabled = false; btnAdminOverridesWeight.Enabled = false; UpdateDisplay(); }
// Constructor public UserInterface() { InitializeComponent(); displayList = new List <DisplayList>(); baggingAreaScale = new BaggingAreaScale(); scannedProducts = new ScannedProducts(); barcodeScanner = new BarcodeScanner(); looseItemScale = new LooseItemScale(); selfCheckout = new SelfCheckout(baggingAreaScale, scannedProducts, looseItemScale); barcodeScanner.LinkToSelfCheckout(selfCheckout); baggingAreaScale.LinkToSelfCheckout(selfCheckout); looseItemScale.LinkToSelfCheckout(selfCheckout); UpdateDisplay(); }
public void AdminOverrideWeight(BaggingAreaScale bagArea) //Override the weight with the inputted weight { baggingArea = bagArea; //sets to new baggingarea to get correct weight }
// Constructor public SelfCheckout(BaggingAreaScale baggingArea, ScannedProducts scannedProducts, LooseItemScale looseItemScale) { this.baggingArea = baggingArea; this.scannedProducts = scannedProducts; this.looseItemScale = looseItemScale; }