Пример #1
0
        static void Main()
        {
            OutputEncoding = Encoding.UTF8;
            PizzaMenu    pizzaMenu    = new PizzaMenu();
            ShoppingCart shoppingCart = new ShoppingCart();
            string       firstUserChoise;
            string       secondUserChoise;
            string       doughUserChoise;
            string       thirdUserChoise;

            WriteLine("Hello! Welcome to the PitsaKiosk!\n");
            WriteLine("Menu:");
            pizzaMenu.PrintMenu();
            shoppingCart.PrintShoppingCart();
            while (true)
            {
                WriteLine("\nMake your choise:");
                WriteLine("add = add pizza | own = make your own pizza | exit = leave PitsaKiosk...");
                firstUserChoise = ReadLine().ToLower();

                if (firstUserChoise == "add")
                {
                    Clear();
                    pizzaMenu.PrintMenu();
                    Write("Did not find what you wanted? exit = exit shop. Found? Then choose your pizza: ");
                    var pizzaChoise = ReadLine().ToLower();
                    if (pizzaChoise == "exit")
                    {
                        Exit();
                        break;
                    }
                    Clear();
                    shoppingCart.StandardPizzaShoppingCart(pizzaChoise);
                    shoppingCart.PrintShoppingCart();
                    WriteLine("\nWhat type of dough you want - thick or thin?: ");
                    doughUserChoise = ReadLine().ToLower();
                    shoppingCart.StandardPizzaDough(doughUserChoise);
                    WriteLine("\nCheckout?");
                    WriteLine("Yes = y | No = n");
                    secondUserChoise = ReadLine().ToLower();
                    if (secondUserChoise == "y")
                    {
                        Clear();
                        WriteLine("Your order is being prepared:\n");
                        shoppingCart.PrintShoppingCart();
                        break;
                    }
                    else if (secondUserChoise == "n")
                    {
Start:
                        WriteLine("Want to add another pizza or change your order all together?");
                        WriteLine("add = add another pizza || delete = change your order");
                        thirdUserChoise = ReadLine().ToLower();

                        if (thirdUserChoise == "add")
                        {
                            Clear();
                            pizzaMenu.PrintMenu();
                            WriteLine("Pizza in the shopping cart:");
                            shoppingCart.PrintShoppingCart();
                            WriteLine("\nAdd another pizza of your choise: ");
                            var pizzaAnotherChoise = ReadLine().ToLower();
                            shoppingCart.StandardPizzaShoppingCart(pizzaAnotherChoise);
                            WriteLine("What type of dough you want - thick or thin?: ");
                            doughUserChoise = ReadLine();
                            shoppingCart.StandardPizzaDough(doughUserChoise);
                            Clear();
                            shoppingCart.PrintShoppingCart();
                            WriteLine("\nCheckout?");
                            WriteLine("Yes = y | No = n");
                            secondUserChoise = ReadLine().ToLower();
                            if (secondUserChoise == "y")
                            {
                                Clear();
                                WriteLine("Your order is being prepared:\n");
                                shoppingCart.PrintShoppingCart();
                                break;
                            }

                            if (secondUserChoise == "n")
                            {
                                goto Start;
                            }
                        }

                        else if (thirdUserChoise.Contains("del"))
                        {
                            Clear();
                            WriteLine("Your order is:");
                            shoppingCart.PrintShoppingCart();
                            WriteLine("\nChoose which order to delete:");
                            var deletePizzaChoise = ReadLine().ToLower();
                            shoppingCart.EmptyStandardPizzaShoppingCart(deletePizzaChoise, doughUserChoise);
                            Clear();
                            shoppingCart.PrintShoppingCart();
                            WriteLine("\nCheckout?");
                            WriteLine("Yes = y | No = n");
                            secondUserChoise = ReadLine().ToLower();
                            if (secondUserChoise == "y")
                            {
                                Clear();
                                WriteLine("Your order is being prepared:\n");
                                shoppingCart.PrintShoppingCart();
                                break;
                            }
                        }
                    }
                }
                else if (firstUserChoise == "own")
                {
                }
                else if (firstUserChoise == "exit")
                {
                    Exit();
                    break;
                }
            }