Esempio n. 1
0
 public static void StartEditOfOrderInOrderList()
 {
     CurrentOrder.Clear();
     foreach (Product product in Orderlist[IdOfSelectedOrderInOrderList].Products)
     {
         CurrentOrder.Add(product);
     }
 }
Esempio n. 2
0
        } //end DrawPastaMenu

        // Funktion som ritar ut Dryckesmenyn
        public void DrawDrinksMenu()
        {
            Console.Clear();
            foreach (string choices in MenuLists.Drinks)
            {
                Console.WriteLine(choices);
            }

            while (correctKey == false)
            {
                key = Console.ReadKey(true).KeyChar;
                switch (key)
                {
                case '1':
                    drinks.Add(new Drink("Läsk"));
                    CurrentOrder.Add("Läsk");
                    totalPrice += 20;
                    DrawConfirmationScreen();
                    correctKey = true;
                    break;

                case '2':
                    drinks.Add(new Drink("Öl"));
                    CurrentOrder.Add("Öl");
                    totalPrice += 50;
                    DrawConfirmationScreen();
                    correctKey = true;
                    break;

                case '3':
                    drinks.Add(new Drink("Vin"));
                    CurrentOrder.Add("Vin");
                    totalPrice += 50;
                    DrawConfirmationScreen();
                    correctKey = true;
                    break;

                case '4':
                    DrawFoodMenu();     //Återgår till maträttsmenyn
                    correctKey = true;
                    break;

                case '5':     //Avslutar och återgår till Startmenyn
                    StartOrder();
                    correctKey = true;
                    break;

                default:
                    Console.Clear();
                    foreach (string choices in MenuLists.Salads)
                    {
                        Console.WriteLine(choices);
                    }
                    continue;
                }
            }
        } //end DrawDrinksMenu();
Esempio n. 3
0
        private void AddOrderItem(object parameter)
        {
            int index = (int)parameter;

            CurrentOrder.Add(new Order()
            {
                SushiName = MenuList[index].Name, SushiPrice = MenuList[index].Price
            });
            OnPropertyChanged(nameof(CurrentOrder));
        }
        private void AddToOrder(MenuItem item)
        {
            CurrentOrder.Add(new OrderItem()
            {
                Name   = item.Name,
                Id     = item.Id,
                Price  = item.Price,
                Extras = item.Extras
            });

            OrderTotal += item.Price;
        }
Esempio n. 5
0
        } //end DrawDrinksMenu();

        // Funktion som ritar ut salladsmenyn
        public void DrawSaladMenu()
        {
            Console.Clear();
            foreach (string choices in MenuLists.Salads)
            {
                Console.WriteLine(choices);
            }

            while (correctKey == false)
            {
                key = Console.ReadKey(true).KeyChar;
                switch (key)
                {
                case '1':
                    salads.Add(new Salad("Mozzarellasallad"));
                    CurrentOrder.Add("Mozzarellasallad");
                    totalPrice += 80;
                    DrawConfirmationScreen();
                    correctKey = true;
                    break;

                case '2':
                    salads.Add(new Salad("Chevresallad"));
                    CurrentOrder.Add("Chevresallad");
                    totalPrice += 80;
                    DrawConfirmationScreen();
                    correctKey = true;
                    break;

                case '3':
                    DrawFoodMenu();     //Fortsätt handla
                    correctKey = true;
                    break;

                case '4':     //Återgå till maträttsmenyn
                    StartOrder();
                    correctKey = true;
                    break;

                default:
                    Console.Clear();
                    foreach (string choices in MenuLists.Salads)
                    {
                        Console.WriteLine(choices);
                    }
                    continue;
                }
            }
        } // end DrawSalad
Esempio n. 6
0
        } // end DrawExtras();

        // Funktion som ritar ut Pastamenyn
        public void DrawPastaMenu()
        {
            Console.Clear();
            foreach (string choices in MenuLists.Pastas)
            {
                Console.WriteLine(choices);
            }

            while (correctKey == false)
            {
                key = Console.ReadKey(true).KeyChar;
                switch (key)
                {
                case '1':
                    pastas.Add(new Pasta("Canneloni med kött"));
                    CurrentOrder.Add("Cannelloni med kött");
                    totalPrice += 80;
                    DrawConfirmationScreen();
                    correctKey = true;
                    break;

                case '2':
                    pastas.Add(new Pasta("Cannelloni vegetarisk"));
                    CurrentOrder.Add("Cannelloni vegetarisk");
                    totalPrice += 80;
                    DrawConfirmationScreen();
                    correctKey = true;
                    break;

                case '3':
                    DrawFoodMenu();     //Fortsätt handla
                    correctKey = true;
                    break;

                case '4':     //Återgå till maträttsmenyn
                    StartOrder();
                    correctKey = true;
                    break;

                default:
                    Console.Clear();
                    foreach (string choices in MenuLists.Pastas)
                    {
                        Console.WriteLine(choices);
                    }
                    continue;
                }
            }
        } //end DrawPastaMenu
Esempio n. 7
0
 public static void AddToCurrentOrder(Product product)
 {
     CurrentOrder.Add(product);
 }
Esempio n. 8
0
        } //end drawPizzaMenu();

        // Funktion som låter användaren välja botten och sparar resultatet till pizzalistan
        public void DrawPizzaBottomMenu(string pizza)
        {
            Console.Clear();
            foreach (string choices in MenuLists.PizzaBottoms)
            {
                Console.WriteLine(choices);
            }

            while (correctKey == false)
            {
                key = Console.ReadKey(true).KeyChar;
                switch (key)
                {
                case '1':
                    if (pizza == "Vesuvio")
                    {
                        pizzas.Add(new Pizza(pizza));
                        index = pizzas.Count - 1;
                        pizzas[index].AddIngredient(Ingredients[0]);     // lägg till tomatsås
                        pizzas[index].AddIngredient(Ingredients[1]);     //lägg till ost
                        pizzas[index].AddIngredient(Ingredients[2]);     // lägg till skinka
                    }
                    else if (pizza == "Margarita")
                    {
                        pizzas.Add(new Pizza(pizza));
                        index = pizzas.Count - 1;
                        pizzas[index].AddIngredient(Ingredients[0]);     // lägg till tomatsås
                        pizzas[index].AddIngredient(Ingredients[1]);     //lägg till ost
                    }
                    else if (pizza == "Hawaii")
                    {
                        pizzas.Add(new Pizza(pizza));
                        index = pizzas.Count - 1;
                        pizzas[index].AddIngredient(Ingredients[0]);     // lägg till tomatsås
                        pizzas[index].AddIngredient(Ingredients[1]);     //lägg till ost
                        pizzas[index].AddIngredient(Ingredients[2]);     // lägg till skinka
                        pizzas[index].AddIngredient(Ingredients[8]);     // lägg till ananas
                    }
                    else if (pizza == "Calzone" + " (Inbakad)")
                    {
                        pizzas.Add(new Pizza(pizza));
                        index = pizzas.Count - 1;
                        pizzas[index].AddIngredient(Ingredients[0]);     // lägg till tomatsås
                        pizzas[index].AddIngredient(Ingredients[1]);     //lägg till ost
                        pizzas[index].AddIngredient(Ingredients[2]);     // lägg till skinka
                    }
                    CurrentOrder.Add(pizza + ", " + pizzas[index].AddBottom(italiensk));
                    totalPrice += pizzas[index].price;
                    DrawExtras();
                    correctKey = true;
                    break;

                case '2':
                    if (pizza == "Vesuvio")
                    {
                        pizzas.Add(new Pizza(pizza));
                        index = pizzas.Count - 1;
                        pizzas[index].AddIngredient(Ingredients[0]);     // lägg till tomatsås
                        pizzas[index].AddIngredient(Ingredients[1]);     //lägg till ost
                        pizzas[index].AddIngredient(Ingredients[2]);     // lägg till skinka
                    }
                    else if (pizza == "Margarita")
                    {
                        pizzas.Add(new Pizza(pizza));
                        index = pizzas.Count - 1;
                        pizzas[index].AddIngredient(Ingredients[0]);     // lägg till tomatsås
                        pizzas[index].AddIngredient(Ingredients[1]);     //lägg till ost
                    }
                    else if (pizza == "Hawaii")
                    {
                        pizzas.Add(new Pizza(pizza));
                        index = pizzas.Count - 1;
                        pizzas[index].AddIngredient(Ingredients[0]);     // lägg till tomatsås
                        pizzas[index].AddIngredient(Ingredients[1]);     //lägg till ost
                        pizzas[index].AddIngredient(Ingredients[2]);     // lägg till skinka
                        pizzas[index].AddIngredient(Ingredients[8]);     // lägg till ananas
                    }
                    else if (pizza == "Calzone" + " (Inbakad)")
                    {
                        pizzas.Add(new Pizza(pizza));
                        index = pizzas.Count - 1;
                        pizzas[index].AddIngredient(Ingredients[0]);     // lägg till tomatsås
                        pizzas[index].AddIngredient(Ingredients[1]);     //lägg till ost
                        pizzas[index].AddIngredient(Ingredients[2]);     // lägg till skinka
                    }
                    CurrentOrder.Add(pizza + ", " + pizzas[index].AddBottom(amerikansk));
                    totalPrice += pizzas[index].price;
                    DrawExtras();
                    correctKey = true;
                    break;


                case '3':     //Återgå till Pizzameny
                    DrawPizzaMenu();
                    correctKey = true;
                    break;

                case '4':     //Avsluta
                    StartOrder();
                    correctKey = true;
                    break;

                default:

                    Console.Clear();
                    foreach (string choices in MenuLists.PizzaBottoms)
                    {
                        Console.WriteLine(choices);
                    }

                    continue;
                }
            }
        } //end DrawPizzaBottomMenu();