protected override void InitPresetPizza()
        {
            /*Meat*/
            CustomPizza tempP = new CustomPizza();

            tempP.Type = "Meat Pizza";
            tempP.AddCrust(CrustList[0]);
            tempP.AddTopping(ToppingsList[0]);
            tempP.AddTopping(ToppingsList[1]);
            tempP.AddTopping(ToppingsList[2]);
            tempP.AddTopping(ToppingsList[6]);
            tempP.AddTopping(ToppingsList[8]);
            tempP.CalculatePrice();
            PresetPizza.Add(tempP);
            /*Hawaiian*/
            tempP      = new CustomPizza();
            tempP.Type = "Hawaiian Pizza";
            tempP.AddCrust(CrustList[0]);
            tempP.AddTopping(ToppingsList[2]);
            tempP.AddTopping(ToppingsList[5]);
            tempP.AddTopping(ToppingsList[7]);
            tempP.CalculatePrice();
            PresetPizza.Add(tempP);
            /*Deluxe*/
            tempP      = new CustomPizza();
            tempP.Type = "Deluxe Pizza";
            tempP.AddCrust(CrustList[0]);
            tempP.AddTopping(ToppingsList[6]);
            tempP.AddTopping(ToppingsList[9]);
            tempP.AddTopping(ToppingsList[3]);
            tempP.AddTopping(ToppingsList[5]);
            tempP.AddTopping(ToppingsList[11]);
            tempP.CalculatePrice();
            PresetPizza.Add(tempP);
        }
Exemple #2
0
        public override ATruePizza Make()
        {
            ATruePizza FinalPizza = new CustomPizza();

            SelectCrust(ref FinalPizza);
            SelectSize(ref FinalPizza);
            SelectToppings(ref FinalPizza);
            return(FinalPizza);
        }
Exemple #3
0
        public double OrderCost()
        {
            double OrderCost = 0;

            foreach (var CustomPizza in PizzaOrder)
            {
                OrderCost += CustomPizza.Price();
            }
            return(OrderCost);
        }
Exemple #4
0
        public string PrintOrder()
        {
            string order = "This order contains: ";

            foreach (var CustomPizza in PizzaOrder)
            {
                order += CustomPizza.ToString() + " ";
            }
            order += "Grand Total: $" + OrderCost();
            return(order);
        }
        protected override void InitPresetPizza()
        {
            /*Veggie*/
            CustomPizza tempP = new CustomPizza();

            tempP.Type = "Basic Veggie Pizza";
            tempP.AddCrust(CrustList[0]);
            tempP.AddTopping(ToppingsList[0]);
            tempP.AddTopping(ToppingsList[1]);
            tempP.AddTopping(ToppingsList[4]);
            tempP.AddTopping(ToppingsList[6]);
            tempP.CalculatePrice();
            PresetPizza.Add(tempP);
        }
        protected void customPizza()
        {
            CustomPizza toAdd = new CustomPizza();

            toAdd.Size     = chooseSize();
            toAdd.Crust    = chooseCrust();
            toAdd.Toppings = chooseToppings();
            if (toAdd.getSuccess())
            {
                addPizzaToOrder(toAdd);
            }
            else
            {
                Console.WriteLine("Pizza cannot be added to order.");
                doNext();
            }
        }
        public void AddToOrder(Order o, CustomPizza p)
        {
            p.CalculatePrice();
            _db.Pizza.Add(new Data.Entities.Pizza
            {
                Crust = new PizzaBox.Data.Entities.Crust
                {
                    Name = p.Crust.Name
                },
                Size = new PizzaBox.Data.Entities.Size
                {
                    Name = p.Size.Name
                },
                Price = p.Price
            });

            _db.SaveChanges();

            o.Pizzas.Add(p);
        }
 public void StartCustomPizza()
 {
     CurrentPizza = new CustomPizza();
 }