Exemplo n.º 1
0
 public void addPizza(Topping topping, Size size, Crust crust)
 {
     if (pizzas.Count < 12)
     {
         pizzas.Add(pizzas.Count, new Pizza(topping, size, crust));
     }
 }
Exemplo n.º 2
0
        public void InsertCrust()
        {
            Crust crust = new Crust();

            crust.Crust1       = "Fake";
            crust.CrustCost    = 9.00;
            crust.ModifiedDate = System.DateTime.Now;
            dbContext.Crust.Add(crust);
            dbContext.SaveChanges();
        }
Exemplo n.º 3
0
        public double CalculateTotalCost(int p)
        {
            double total = 0;

            Size size = pizzas[p].Size;

            total += size.GetSizeCost();

            Topping topping = pizzas[p].Topping;

            total += 1 * topping.GetToppingCount();

            Crust crust = pizzas[p].Crust;

            total += crust.GetCrustCost();

            return(total);
        }
Exemplo n.º 4
0
        public string GetPizzaStringByPizzaID(int pizzaID)
        {
            Pizza          pizza    = dbContext.Pizza.Where(p => p.PizzaId == pizzaID).FirstOrDefault();
            Crust          crust    = dbContext.Crust.Where(c => c.CrustId == pizza.CrustId).FirstOrDefault();
            Sauce          sauce    = dbContext.Sauce.Where(s => s.SauceId == pizza.SauceId).FirstOrDefault();
            List <Cheese>  cheeses  = GetListCheesesByPizzaID(pizzaID);
            List <Topping> toppings = GetListToppingsByPizzaID(pizzaID);

            string pizzaString = "";

            pizzaString += "$" + pizza.TotalPizzaCost + " " + crust.Crust1 + ", " + sauce.Sauce1;
            foreach (var c in cheeses)
            {
                pizzaString += ", " + c.Cheese1;
            }
            foreach (var t in toppings)
            {
                pizzaString += ", " + t.Topping1;
            }

            return(pizzaString);
        }
Exemplo n.º 5
0
 public Pizza(Topping topping, Size size, Crust crust)
 {
     Topping = topping;
     Size    = size;
     Crust   = crust;
 }