public void addPizza(Topping topping, Size size, Crust crust) { if (pizzas.Count < 12) { pizzas.Add(pizzas.Count, new Pizza(topping, size, crust)); } }
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(); }
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); }
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); }
public Pizza(Topping topping, Size size, Crust crust) { Topping = topping; Size = size; Crust = crust; }