Exemplo n.º 1
0
        /// <summary>
        /// buy new products
        /// </summary>
        public void BuyNewProducts()
        {
            // instantiate a new product
            Product _product = new Product();

            _product.Type = _consoleView.DisplayBuyNewProducts(_salesperson);

            if (_product.Type != Product.ProductType.None)
            {
                // get the number of units to buy and adds them to the product
                int numberOfUnits = _consoleView.GetNumberOfUnitsToBuy();
                _product.AddProducts(numberOfUnits);
                _product.OnBackorder = false;

                // add products to the current stock list
                _salesperson.CurrentStock.Add(_product);

                // update city object
                city.SalesInfo.Add(new Product(_product.Type, numberOfUnits, 0));
            }
        }