コード例 #1
0
        public Ingredients()
        {
            InMenuIngredients = new List <pizza>();

            pizza olives = new pizza(1, "olives", "", "", Category.INGREDIENTS, 2);

            InMenuIngredients.Add(olives);
            pizza cheese = new pizza(2, "cheese", "", "", Category.INGREDIENTS, 1.5);

            InMenuIngredients.Add(cheese);
            pizza ananas = new pizza(3, "ananas", "", "", Category.INGREDIENTS, 0.9);

            InMenuIngredients.Add(ananas);
            pizza jalapeno = new pizza(4, "jalapeno", "", "", Category.INGREDIENTS, 0.7);

            InMenuIngredients.Add(jalapeno);
            pizza pizzaSauce = new pizza(5, "pizza sauce", "", "", Category.INGREDIENTS, 0.7);

            InMenuIngredients.Add(pizzaSauce);
            pizza ham = new pizza(6, "ham", "", "", Category.INGREDIENTS, 3.5);

            InMenuIngredients.Add(ham);
            pizza chicken = new pizza(7, "chicken", "", "", Category.INGREDIENTS, 3.5);

            InMenuIngredients.Add(chicken);
            pizza smokedChicken = new pizza(7, "smoked chicken", "", "", Category.INGREDIENTS, 3.5);

            InMenuIngredients.Add(smokedChicken);
            pizza tunaFish = new pizza(8, "tuna fish", "", "", Category.INGREDIENTS, 3.5);

            InMenuIngredients.Add(tunaFish);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: anniks2010/PizzaShop
        public static void AddToShoppingCart2(Ingredients extraIngredients, ShoppingCart itemsInShoppingCart)
        {
            Console.WriteLine($"Enter the id of the extra ingredients on menu to add it to the shopping cart: ");
            int productId = int.Parse(Console.ReadLine());

            Console.WriteLine("Enter the numbers of items to add to the shopping cart: ");
            int quantity = int.Parse(Console.ReadLine());

            pizza articleToAdd = extraIngredients.GetFromMenuIngredients(productId);

            itemsInShoppingCart.AddToShoppingCart(articleToAdd, quantity);
            itemsInShoppingCart.PrintShoppingCart();
        }
コード例 #3
0
ファイル: Menu.cs プロジェクト: anniks2010/PizzaShop
        public Menu()
        {
            InMenu = new List <pizza>();

            pizza hawaij = new pizza(1, "Hawaij_pizza", "Cheese, tex-mex sauce, barbeque chicken, onion", "thin dough", Category.PIZZA_TYPE, 8.5);

            InMenu.Add(hawaij);
            pizza hawaijWithThickDough = new pizza(2, "Hawaij_pizza", "Cheese, tex-mex sauce, barbeque chicken, onion", "thick dough", Category.PIZZA_TYPE, 8.5);

            InMenu.Add(hawaijWithThickDough);
            pizza meat = new pizza(3, "meat_pizza", "Pizza sauce, cheese, shrimps, crab meat", "thin dough", Category.PIZZA_TYPE, 10.6);

            InMenu.Add(meat);
            pizza meatWithThickDough = new pizza(4, "meat_pizza", "Pizza sauce, cheese, shrimps, crab meat", "thick dough", Category.PIZZA_TYPE, 10.6);

            InMenu.Add(meatWithThickDough);
            pizza children = new pizza(5, "children_pizza", "Pizza sauce, cheese, smoked chicken, sweet pepper", "thin dough", Category.PIZZA_TYPE, 5.5);

            InMenu.Add(children);
            pizza childrenWithThickDough = new pizza(6, "children_pizza", "Pizza sauce, cheese, smoked chicken, sweet pepper", "thick dough", Category.PIZZA_TYPE, 5.5);

            InMenu.Add(childrenWithThickDough);
            pizza veggy = new pizza(7, "veggy_pizza", "Pizza sauce, cheese, broccoli, sweet pepper,", "thin dough", Category.PIZZA_TYPE, 6);

            InMenu.Add(veggy);
            pizza veggyWithTcikDough = new pizza(8, "veggy_pizza", "Pizza sauce, cheese, broccoli, sweet pepper,", "thick dough", Category.PIZZA_TYPE, 6);

            InMenu.Add(veggyWithTcikDough);
            pizza fish = new pizza(9, "fish_pizza", "Pizza sauce, cheese, bacon, tuna fish", "thin dough", Category.PIZZA_TYPE, 9.9);

            InMenu.Add(fish);
            pizza fishWithThickDough = new pizza(10, "fish_pizza", "Pizza sauce, cheese, bacon, tuna fish", "thick dough", Category.PIZZA_TYPE, 9.9);

            InMenu.Add(fishWithThickDough);
            pizza custom = new pizza(11, "custome_pizza", "", "thin dough", Category.PIZZA_TYPE, 7.6);

            InMenu.Add(custom);
            pizza customWithThickDough = new pizza(12, "custome_pizza", "", "thick dough", Category.PIZZA_TYPE, 7.6);

            InMenu.Add(customWithThickDough);
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: anniks2010/PizzaShop
        public static void AddToShoppingCart(Menu itemsInMenu, ShoppingCart itemsInShoppingCart)
        {
            Console.WriteLine($"Enter the id of the pizza on menu to add it to the shopping cart: ");
            int productId = int.Parse(Console.ReadLine());

            if (productId == 11 || productId == 12)
            {
                Ingredients extraIngredients = new Ingredients();
                extraIngredients.PrintIngredients();
                Console.WriteLine($"Enter 4 ingredients from the aboved list:");
                string userInput = Console.ReadLine();
            }


            Console.WriteLine("Enter the numbers of items to add to the shopping cart: ");
            int quantity = int.Parse(Console.ReadLine());

            pizza articleToAdd = itemsInMenu.GetFromMenu(productId);

            itemsInShoppingCart.AddToShoppingCart(articleToAdd, quantity);
            itemsInShoppingCart.PrintShoppingCart();
        }
コード例 #5
0
 public Items(pizza _pizza, int _quantity)
 {
     pizza    = _pizza;
     quantity = _quantity;
 }
コード例 #6
0
        public void AddToShoppingCart(pizza pizza, int quantity)
        {
            Items newproduct = new Items(pizza, quantity);

            shoppingCart.Add(newproduct);
        }