Пример #1
0
        public void UpdateInv(Cupcake lookupCupcake, int qnty)
        {
            double[] cupcakeRequirements = lookupCupcake.GetIngredients();

            int i = 0;

            foreach (var item in StoreInv)
            {
                StoreInv[i] -= (double)(cupcakeRequirements[i] * qnty);
                i++;
            }
        }
Пример #2
0
        public bool CheckInv(Cupcake lookupCupcake, int qnty)
        {
            double[] cupcakeRequirements = lookupCupcake.GetIngredients();

            int i = 0;

            foreach (var item in StoreInv)
            {
                if (StoreInv[i] < (double)(cupcakeRequirements[i] * qnty))
                {
                    return(false);
                }
                i++;
            }
            return(true);
        }
Пример #3
0
        public static Cupcake GetCupcake()
        {
            ILogger logger = LogManager.GetCurrentClassLogger();

            ConsoleDisplay.CupcakeList();
            Console.WriteLine("Please enter the name of a cupcake as it appears on the list:");
            var input = Console.ReadLine();

            try
            {
                if ()
                {
                    CupcakeNum cupcakeType = (CupcakeNum)Enum.Parse(typeof(CupcakeNum), input);
                }
                Cupcake lookupCupcake = Cupcake.FindCupcake(cupcakeType);
                return(cupcakeType, lookupCupcake);
            }
            catch (SystemException ex)
            {
                logger.Error(ex);
                return(null);
            }
        }