Exemplo n.º 1
0
        // 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();
        }
Exemplo n.º 2
0
 // 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();
 }
Exemplo n.º 3
0
 public void AdminOverrideWeight(BaggingAreaScale bagArea) //Override the weight with the inputted weight
 {
     baggingArea = bagArea;                                //sets to new baggingarea to get correct weight
 }
Exemplo n.º 4
0
 // Constructor
 public SelfCheckout(BaggingAreaScale baggingArea, ScannedProducts scannedProducts, LooseItemScale looseItemScale)
 {
     this.baggingArea     = baggingArea;
     this.scannedProducts = scannedProducts;
     this.looseItemScale  = looseItemScale;
 }