Ejemplo n.º 1
0
        static void Welcome()
        {
            System.Console.WriteLine("Welcome to the Pizza Zone - Home of the best pizza ever made");
            System.Console.WriteLine("Please selet which store to use:");
            System.Console.WriteLine("1 for Pizza Zone on 10th");
            System.Console.WriteLine("2 for Pizza Zone on 5th");
            int selection;

            int.TryParse(System.Console.ReadLine(), out selection);
            var store = new Store(selection);

            System.Console.WriteLine(store.Name);
            System.Console.WriteLine();
            List <Pizza> cart    = new List <Pizza>();
            var          startup = new PizzaStore.Client.Startup();
            var          u       = new User();

            try
            {
                Menu(startup.CreateOrder(u, store));
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 2
0
        static void Welcome()
        {
            System.Console.WriteLine("Welcome to PizzaWorld");
            System.Console.WriteLine("Best Pizza in the World");
            System.Console.WriteLine();

            //array
            //1-dimensional array
            string[] cart1 = { "", "", "" };              // initial values
            string[] cart2 = new string[3];               // default values
            string[] cart3 = new string[] { "", "", "" }; //initial values - custom datatyoe or earlier C# versions

            //list
            List <string> cart4 = new List <string> {
                "", "", ""
            };                                       // initial
            List <Pizza> cart5 = new List <Pizza>(); // default

            //Menu(cart2);
            //Menu2(cart5);

            var startup = new PizzaStore.Client.Startup();
            var user    = new User();
            var store   = new Store();

            //var order  = startup.CreateOrder(user, store);
            // if (order != null)
            // {
            //     Menu3(order);
            // }
            // else
            // {
            //     System.Console.WriteLine("technical difficulties, we'll be back!");
            // }

            try
            {
                Menu3(startup.CreateOrder(user, store));
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 3
0
        static void Welcome()
        {
            System.Console.WriteLine("Welcome to PizzaWorld");
            System.Console.WriteLine("Best Pizza in the World");
            System.Console.WriteLine();

            var startup = new PizzaStore.Client.Startup();
            var user    = new User();
            var store   = new Store();

            try
            {
                Menu(startup.CreateOrder(user, store));
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 4
0
        static void Welcome()
        {
            System.Console.WriteLine("Welcome to the Pizza Zone - Home of the best pizza ever made");
            System.Console.WriteLine("Please make a selection");
            System.Console.WriteLine();

            //array
            //string[] cart1 = { "", "", "" }; //initial values
            //string[] cart2 = new string[3]; //default values
            //string[] cart3 = new[] { "", "", "" }; //initial values for custom datatypes or earlies c# versions

            //list
            //List<string> cart4 = new List<string>{"", "", ""};//initial values
            //List<string> cart5 = new List<string>();//default values
            List <Pizza> cart6 = new List <Pizza>();

            //Menu(cart2);
            //Menu2(cart6);

            var startup = new PizzaStore.Client.Startup();
            var user    = new User();
            var store   = new Store();

            //var order = startup.CreateOrder(user , store)
            // if (order != null)
            // {
            //     Menu3(order);
            // }
            // else
            // {
            //     System.Console.WriteLine("We are experiencing some technical difficulties right now, please try again later");
            // }

            try
            {
                Menu3(startup.CreateOrder(user, store));
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 5
0
        static void Welcome()
        {
            Console.WriteLine("Welcome to the pizza ordering service");
            System.Console.WriteLine();
            System.Console.WriteLine();
            List <Pizza> cart4   = new List <Pizza>();
            var          startup = new PizzaStore.Client.Startup();
            var          user    = new User();
            var          store   = new Store();
            var          order   = startup.CreateOrder(user, store);

            try
            {
                Menu2(startup.CreateOrder(user, store), store);
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 6
0
        static void Welcome()
        {
            Console.WriteLine("Welcome to PizzaWorld!");
            System.Console.WriteLine("Best Pizza in the World!");
            System.Console.WriteLine();

            /*
             * arrays
             */
            //string[] cart1 = {"","",""};//1 dimensional array, this one is initialized values set
            string[] cart2 = new string[3];//array is not initialized this way unless keyword 'new' is used, uses default values
            //string[] cart3 = new[]{"","",""};//initial values - used for earlier C# versions or custom datatypes

            //list
            List <Pizza> cart4 = new List <Pizza>(); //default values
            //List<string> cart5 = new List<string>{""};//initial values
            //Menu(cart4);
            var startup = new PizzaStore.Client.Startup();
            var user    = new User();
            var store   = new Store();
            var order   = startup.CreateOrder(user, store);

            /*  if(order != null)
             * {
             * Menu2(order);
             * }
             * else
             * {
             * System.Console.WriteLine("technical difficulties");
             * } */
            try
            {
                Menu2(startup.CreateOrder(user, store));
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 7
0
        //  static void Main(string[] args)
        //  {
        //      Welcome();
        //  }

        static void Welcome()
        {
            Console.WriteLine("Welcome to PizzaWorld");
            Console.WriteLine("Best Pizza in the World");
            Console.WriteLine("What is your name?");

            var name = Console.ReadLine();
            // name = new Store().Name;
            var startup = new PizzaStore.Client.Startup();
            var user    = new User(name);
            var store   = new Store();
            var order   = startup.CreateOrder(user, store);

            try
            {
                Menu3(startup.CreateOrder(user, store));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 8
0
        //WelcomeBanner displays startup text and calls the MainMenu function
        static void WelocmeBanner()
        {
            System.Console.WriteLine("Welcome to PizzaWorld");
            System.Console.WriteLine("Best Pizza this side of Alpha Centuri");
            System.Console.WriteLine();

            //List<Pizza> cart = new List<Pizza>();

            var startup = new PizzaStore.Client.Startup();
            var user    = new User();
            var store   = new Store();
            var order   = startup.CreateOrder(user, store);

            try
            {
                MainMenu(order);
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 9
0
        static void Welcome()
        {
            System.Console.WriteLine("Welcome to PizzaWorld");
            System.Console.WriteLine("Best Pizza Around");
            System.Console.WriteLine();

            //array
            //1-d
            string[] cart1 = { "", "", "" };        //initial values
            string[] cart2 = new string[3];         // default values
            string[] cart3 = new [] { "", "", "" }; // initial values - custom datatypes or earlier C# version

            // list
            List <string> cart4 = new List <string>()
            {
                "", "", "",
            };                                         // initial values
            List <string> cart5 = new List <string>(); // default values

            List <Pizza> cart6 = new List <Pizza>();

            //Menu2(cart6);
            //Menu(cart2);
            var startup = new PizzaStore.Client.Startup();
            var user    = new User();
            var store   = new Store();

            //var order = startup.CreateOrder(user, store);

            try
            {
                Menu3(startup.CreateOrder(user, store));
            } catch (Exception ex) {
                System.Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 10
0
        static void Menu3(Order cart)
        {
            if (cart is null)
            {
                throw new ArgumentNullException(nameof(cart));
            }

            int  numPizzas = 0;
            bool exit      = false;
            var  startup   = new PizzaStore.Client.Startup();

            string[] pizzaNames = { "Cheese", "Pepperoni", "Sausage", "Vegetarian", "Supreme", "Custom" };

            do
            {
                // if
                System.Console.WriteLine("Select 1 for Cheese Pizza");
                System.Console.WriteLine("Select 2 for Pepperoni Pizza");
                System.Console.WriteLine("Select 3 for Sausage Pizza");
                System.Console.WriteLine("Select 4 for Vegetarian Pizza");
                System.Console.WriteLine("Select 5 for Supreme Pizza");
                System.Console.WriteLine("Select 6 for Custom Pizza");
                System.Console.WriteLine("Select 7 to see cart");
                System.Console.WriteLine("Select 8 for Exit Pizza");
                System.Console.WriteLine("Select 9 to read pizza file");
                System.Console.WriteLine();

                int select = 0;
                int.TryParse(Console.ReadLine(), out select);

                switch (select)
                {
                case 1:
                    //var p = startup.CreatePizza("L","Stuffed", new List<string>{"Cheese"});
                    //cart.Add(p);
                    cart.CreatePizza("L", "Stuffed", new List <string> {
                        "Cheese"
                    });
                    System.Console.WriteLine("Added Cheese Pizza");
                    break;

                case 2:
                    cart.CreatePizza("L", "Stuffed", new List <string> {
                        "Pepperoni"
                    });
                    System.Console.WriteLine("Added Pepperoni Pizza");
                    break;

                case 3:
                    cart.CreatePizza("L", "Stuffed", new List <string> {
                        "Sausage"
                    });
                    System.Console.WriteLine("Added Sausage Pizza");
                    break;

                case 4:
                    cart.CreatePizza("L", "Stuffed", new List <string> {
                        "Tomato", "Olive", "Green Peppers", "Onion"
                    });
                    System.Console.WriteLine("Added Vegetarian Pizza");
                    break;

                case 5:
                    cart.CreatePizza("L", "Stuffed", new List <string> {
                        "Pepperoni", "Sausage", "Green Peppers", "Onions"
                    });
                    System.Console.WriteLine("Added Supreme Pizza");
                    break;

                case 6:
                    cart.CreatePizza("L", "Stuffed", new List <string> {
                        "Custom"
                    });
                    System.Console.WriteLine("Added Custom Pizza");
                    break;

                case 7:
                    DisplayCart3(cart);
                    break;

                case 8:
                    var fmw = new FileManager();
                    fmw.Write(cart);
                    exit = true;
                    break;

                case 9:
                    var fmr = new FileManager();
                    DisplayCart3(fmr.Read());
                    break;
                }
                System.Console.WriteLine("");
                if (select < 7)
                {
                    numPizzas++;
                }
            }while(!exit);
            System.Console.WriteLine($"Thank you for ordering {numPizzas} pizzas");
            DisplayCart3(cart);
        }
Ejemplo n.º 11
0
        // static void Menu(string[] cart)
        // {
        //     var exit = false;
        //     var number = 0;

        //     do
        //     {
        //         if(number < cart.Length)
        //         {
        //             System.Console.WriteLine("Select 1 Cheese Pizza");
        //             System.Console.WriteLine("Select 2 Pepperoni Pizza");
        //             System.Console.WriteLine("Select 3 Hawaiian Pizza");
        //             System.Console.WriteLine("Select 4 Custom Pizza");
        //             System.Console.WriteLine("Select 5 Display Cart");
        //             System.Console.WriteLine("Select 6 Exit Pizza");
        //             System.Console.WriteLine();

        //             int select;
        //             int.TryParse(Console.ReadLine(), out select);

        //             switch(select)
        //             {
        //                 case 1:
        //                     cart[number] = "cheese";
        //                     number += 1;
        //                     System.Console.WriteLine("added Cheese");
        //                     break;

        //                 case 2:
        //                     cart[number] = "pepperoni";
        //                     number += 1;
        //                     System.Console.WriteLine("added Pepperoni");
        //                     break;

        //                 case 3:
        //                     cart[number] = "pineapple";
        //                     number += 1;
        //                     System.Console.WriteLine("added Pineapple");
        //                     break;

        //                 case 4:
        //                     cart[number] = "custom";
        //                     number += 1;
        //                     System.Console.WriteLine("added Custom");
        //                     break;
        //                 case 5:
        //                     DisplayCart(cart);
        //                     break;
        //                 case 6:
        //                     exit = true;
        //                     break;
        //             }
        //         }
        //         else
        //         {
        //             DisplayCart(cart);
        //             exit = true;
        //         }
        //         System.Console.WriteLine();

        //     } while(!exit);
        // }
        // static void Menu2(List<Pizza> cart)
        // {
        //     var exit = false;
        //     var number = 0;
        //     var startup = new PizzaStore.Client.Startup();

        //     do
        //     {

        //             System.Console.WriteLine("Select 1 Cheese Pizza");
        //             System.Console.WriteLine("Select 2 Pepperoni Pizza");
        //             System.Console.WriteLine("Select 3 Hawaiian Pizza");
        //             System.Console.WriteLine("Select 4 Custom Pizza");
        //             System.Console.WriteLine("Select 5 Display Cart");
        //             System.Console.WriteLine("Select 6 Exit Pizza");
        //             System.Console.WriteLine();

        //             int select;
        //             int.TryParse(Console.ReadLine(), out select);

        //             switch(select)
        //             {
        //                 case 1:

        //                     cart.Add(startup.CreatePizza("L", "Stuffed", new List<string>{"cheese"}));
        //                     number += 1;
        //                     System.Console.WriteLine("added Cheese");
        //                     break;

        //                 case 2:

        //                     cart.Add(startup.CreatePizza("L", "Stuffed", new List<string>{"pepperoni"}));
        //                     number += 1;
        //                     System.Console.WriteLine("added Pepperoni");
        //                     break;

        //                 case 3:

        //                     cart.Add(startup.CreatePizza("L", "Stuffed", new List<string>{"pineapple"}));
        //                     number += 1;
        //                     System.Console.WriteLine("added Pineapple");
        //                     break;

        //                 case 4:
        //                     cart.Add(startup.CreatePizza("L", "Stuffed", new List<string>{"custom"}));
        //                     number += 1;
        //                     System.Console.WriteLine("added Custom");
        //                     break;
        //                 case 5:
        //                     DisplayCart2(cart);
        //                     break;
        //                 case 6:
        //                     exit = true;
        //                     break;
        //             }


        //         System.Console.WriteLine();

        //     } while(!exit);
        // }

        static void Menu3(Order cart)
        {
            var exit    = false;
            var startup = new PizzaStore.Client.Startup();

            do
            {
                System.Console.WriteLine("Select 1 Cheese Pizza");
                System.Console.WriteLine("Select 2 Pepperoni Pizza");
                System.Console.WriteLine("Select 3 Hawaiian Pizza");
                System.Console.WriteLine("Select 4 Custom Pizza");
                System.Console.WriteLine("Select 5 Display Cart");
                System.Console.WriteLine("Select 6 Exit Pizza");
                System.Console.WriteLine();

                int select;
                int.TryParse(Console.ReadLine(), out select);

                switch (select)
                {
                case 1:

                    cart.CreatePizza("L", "Stuffed", new List <string> {
                        "cheese"
                    });
                    System.Console.WriteLine("added Cheese");
                    break;

                case 2:

                    cart.CreatePizza("L", "Stuffed", new List <string> {
                        "pepperoni"
                    });
                    System.Console.WriteLine("added Pepperoni");
                    break;

                case 3:

                    cart.CreatePizza("L", "Stuffed", new List <string> {
                        "pineapple"
                    });
                    System.Console.WriteLine("added Pineapple");
                    break;

                case 4:
                    cart.CreatePizza("L", "Stuffed", new List <string> {
                        "custom"
                    });
                    System.Console.WriteLine("added Custom");
                    break;

                case 5:
                    DisplayCart3(cart);
                    break;

                case 6:
                    var smw = new SaveManager();
                    smw.Write(cart);
                    exit = true;
                    break;

                case 7:
                    var smr = new SaveManager();
                    DisplayCart3(smr.Read());
                    exit = true;
                    break;
                }


                System.Console.WriteLine();
            } while(!exit);
        }
Ejemplo n.º 12
0
        static void Menu2(List <Pizza> cart)
        {
            var exit    = false;
            var number  = 0;
            var startup = new PizzaStore.Client.Startup();

            do
            {
                System.Console.WriteLine("Select 1 for Cheese Pizza");
                System.Console.WriteLine("Select 2 for Pepperoni Pizza");
                System.Console.WriteLine("Select 3 for Pineapple Pizza");
                System.Console.WriteLine("Select 4 for Custom Pizza");
                System.Console.WriteLine("Select 5 fto Display Cart");
                System.Console.WriteLine("Select 6 to Exit");

                int select;

                int.TryParse(Console.ReadLine(), out select);

                switch (select)
                {
                case 1:
                    cart.Add(startup.CreatePizza("L", "Stuffed", new List <string> {
                        "Cheese"
                    }));
                    number += 1;
                    System.Console.WriteLine("added Cheese Pizza");
                    break;

                case 2:
                    cart.Add(startup.CreatePizza("L", "Stuffed", new List <string> {
                        "Pepperoni"
                    }));
                    System.Console.WriteLine("Added Pepperoni Pizza");
                    number += 1;
                    break;

                case 3:
                    cart.Add(startup.CreatePizza("L", "Stuffed", new List <string> {
                        "Pineapple"
                    }));
                    System.Console.WriteLine("Added Pineapple Pizza");
                    number += 1;
                    break;

                case 4:
                    cart.Add(startup.CreatePizza("L", "Stuffed", new List <string> {
                        "Custom"
                    }));
                    System.Console.WriteLine("Added Custom");
                    number += 1;
                    break;

                case 5:
                    DisplayCart2(cart);
                    break;

                case 6:
                    System.Console.WriteLine("Exiting...");
                    exit = true;
                    break;
                }
            } while (!exit);
        }