Esempio n. 1
0
        /// <summary>
        /// Selects a product to buy
        /// </summary>
        private void SelectProduct()
        {
            this.DisplayInventory(this.vM500);
            Console.Write("Please select a product: ");
            string choice   = Console.ReadLine().ToUpper();
            VMItem purchase = null;
            string message  = string.Empty;
            var    result   = (item : purchase, message : message);

            result = this.vM500.Purchase(choice);
            if (result.item == null)
            {
                Console.WriteLine($"{result.message}");
            }
            else
            {
                Console.WriteLine($"{result.message} {result.item.ProductName}");
                this.currentPurchases.Add(result.item);
            }

            Console.ReadLine();
        }