public Pizza()
 {
     Toppings = new List <Topping>();
     Crust    = new Crust("Hand Tossed");
     Size     = new Size("Medium");
     Name     = "Custom";
 }
 public CustomPizza(List <string> size, List <string> crust, List <Toppings> toppings, int price)
 {
     Size.AddRange(size);
     Crust.AddRange(crust);
     Toppings.AddRange(toppings);
     Price = price;
 }
예제 #3
0
        //constructors

        public Pizza(Size size, Crust crust, List <Toppings> toppings, int price)
        {
            Size     = size;
            Crust    = crust;
            Toppings = toppings;
            Price    = price;
        }
예제 #4
0
        public void Create(domain.Crust crust)
        {
            var newCrust = new Crust();

            _db.Crust.Add(newCrust);
            newCrust.Name = crust.Name;
            _db.SaveChanges();
        }
예제 #5
0
 public Pizza(string name, List <Topping> toppings, Crust crust, Size size, double price)
 {
     Name     = name;
     Toppings = toppings;
     Crust    = crust;
     Size     = size;
     Price    = price;
 }
예제 #6
0
 public void CreatePizza(string name, List <Topping> toppings, Crust crust, Size size, double basePrice)
 {
     if (Pizzas.Count < 50)
     {
         Pizza newPizz = new Pizza(name, toppings, crust, size, basePrice);
         if (GetTotalPrice() + newPizz.GetTotalPrice() < 250)
         {
             Pizzas.Add(newPizz);
         }
     }
 }
 public Pizza(List <Topping> toppings, Crust crust, Size size, string name)
 {
     if (toppings.Count >= 6)
     {
         //Should never get here unless failed to handle in console app
         throw new System.Exception("Topping Overload! Too many toppings added to pizza.");
     }
     else
     {
         Toppings = toppings;
         Crust    = crust;
         Size     = size;
         Name     = name;
     }
 }
예제 #8
0
 public Pizza(Pizza pizza)
 {
     Name     = pizza.Name;
     Toppings = new List <Topping>();
     foreach (Topping top in pizza.Toppings)
     {
         Toppings.Add(top);
     }
     Crust = new Crust {
         CrustName = pizza.Crust.CrustName, Price = pizza.Crust.Price
     };
     Size = new Size {
         SizeName = pizza.Size.SizeName, Price = pizza.Size.Price
     };
     Price = pizza.Price;
 }
예제 #9
0
 public Pizza(Crust c, Size s, List <Toppings> t)
 {
     crust = c;
     size  = s;
     toppings.AddRange(t);
 }
예제 #10
0
 public void CreatePizza(Size size, Crust crust, List <Toppings> toppings, int price)
 {
     Pizzas.Add(new Pizza(size, crust, toppings, price));
 }
예제 #11
0
 public void AddCrust(Crust crust, Pizza pizza)
 {
     pizza.Crust = crust;
 }
 public void AddCrust(string crust)
 {
     Crust.Add(crust);
 }
예제 #13
0
파일: Order.cs 프로젝트: jpittman23/week_2
        public void CreatePizza(Size s, Crust c, List <Toppings> t)
        {
            var pizza = new Pizza(c, s, t);

            Pizzalist.Add(pizza);
        }
 public Pizza(string name, Size size, Crust crust)
 {
     Name  = name;
     Size  = size;
     Crust = crust;
 }