Beispiel #1
0
 public CustomPizza(int x, int y)
 {
     Name     = "CustomPizza";
     Crust    = new Crust(x);
     Size     = new Size(y);
     Toppings = new List <Topping>();
 }
        protected Crust chooseCrust()
        {
            var crust = new Crust();

            Console.WriteLine("Which type of crust would you like?");
            Console.WriteLine("1. Thin");
            Console.WriteLine("2. Thick - Adds $4.99");

            var input = Console.ReadLine();

            while (!(input.Equals("1") || input.Equals("2")))
            {
                Console.WriteLine("Please choose an option from the list.");
                input = Console.ReadLine();
            }

            switch (input)
            {
            case "1":
                crust.Name  = "Thin";
                crust.Price = 0M;
                break;

            case "2":
                crust.Name  = "Thick";
                crust.Price = 4.99M;
                break;
            }

            return(crust);
        }
Beispiel #3
0
 public Pizza(Crust c, Size s, List <Topping> t, decimal co)
 {
     PizzaCrust    = c;
     PizzaSize     = s;
     PizzaToppings = t;
     Cost          = co;
 }
 public override void AddCrust()
 {
     Crust = new Crust()
     {
         Name = "Original"
     };
 }
 public Pizza()
 {
     Name     = "";
     Size     = new Size();
     Crust    = new Crust();
     Toppings = new List <Topping>();
 }
 public Pizza(string name, Size size, Crust crust, List <Topping> toppings)
 {
     Name     = name;
     Size     = size;
     Crust    = crust;
     Toppings = toppings;
 }
Beispiel #7
0
 public VeggiePizza(Crust c, Size s)
 {
     Name        = "Veggie Pizza";
     Crust.Name  = c.Name;
     Crust.Price = c.Price;
     Size.Name   = s.Name;
     Size.Price  = s.Price;
 }
Beispiel #8
0
 public SausagePizza(Crust c, Size s)
 {
     Name        = "Sausage Pizza";
     Crust.Name  = c.Name;
     Crust.Price = c.Price;
     Size.Name   = s.Name;
     Size.Price  = s.Price;
 }
Beispiel #9
0
 public PepperoniPizza(Crust c, Size s)
 {
     Name        = "Pepperoni Pizza";
     Crust.Name  = c.Name;
     Crust.Price = c.Price;
     Size.Name   = s.Name;
     Size.Price  = s.Price;
 }
 public HawaiianPizza(Crust c, Size s)
 {
     Name        = "Hawaiian Pizza";
     Crust.Name  = c.Name;
     Crust.Price = c.Price;
     Size.Name   = s.Name;
     Size.Price  = s.Price;
 }
 public CheesePizza(Crust c, Size s)
 {
     Name        = "Cheese Pizza";
     Crust.Name  = c.Name;
     Crust.Price = c.Price;
     Size.Name   = s.Name;
     Size.Price  = s.Price;
 }
Beispiel #12
0
 protected override void AddCrust()
 {
     Crust = new Crust()
     {
         // Name="Thin",
         // Price=0.00M
     };
 }
Beispiel #13
0
 public VeganPizza(Crust crust, Size s)
 {
     Name        = "Vegan Pizza";
     Crust.Name  = crust.Name;
     Crust.Price = crust.Price;
     Size.Name   = s.Name;
     Size.Price  = s.Price;
 }
 public MeatPizza(Crust crust, Size s)
 {
     Name        = "Meat Pizza";
     Crust.Name  = crust.Name;
     Crust.Price = crust.Price;
     Size.Name   = s.Name;
     Size.Price  = s.Price;
 }
Beispiel #15
0
        protected Crust AddCrust()
        {
            Crust crust = new Crust();

            crust.Name  = "Thin";
            crust.Price = 0M;
            return(crust);
        }
Beispiel #16
0
 public Pizza()
 {
     Price         = 0;
     Name          = "";
     PizzaToppings = new List <PizzaTopping>();
     Crust         = new Crust();
     Size          = new Size();
     Order         = new Order();
 }
 public CustomPizza(Crust c, Size s, List <Topping> l)
 {
     Name        = "Custom Pizza";
     Crust.Name  = c.Name;
     Crust.Price = c.Price;
     Size.Name   = s.Name;
     Size.Price  = s.Price;
     Toppings    = l;
 }
 public MeatPizza() : base()
 {
     Name     = "Meat Pizza";
     Crust    = new Crust();
     Size     = new Size();
     Toppings = new List <Topping>();
     Toppings.Add(new Topping("Cheese", 1.00M));
     Toppings.Add(new Topping("Pepperoni", 1.00M));
     Toppings.Add(new Topping("Ham", 1.00M));
 }
Beispiel #19
0
 public HawiianPizza() : base()
 {
     Name     = "Hawiian Pizza";
     Crust    = new Crust();
     Size     = new Size();
     Toppings = new List <Topping>();
     Toppings.Add(new Topping("Cheese", 1.00M));
     Toppings.Add(new Topping("Pineapple", 1.00M));
     Toppings.Add(new Topping("Ham", 1.00M));
 }
 public VeganPizza() : base()
 {
     Name     = "Vegan Pizza";
     Crust    = new Crust("Cauliflower", 3.00M);
     Size     = new Size();
     Toppings = new List <Topping>();
     Toppings.Add(new Topping("Cheese", 1.00M));
     Toppings.Add(new Topping("Olives", 1.00M));
     Toppings.Add(new Topping("Pineapple", 1.00M));
 }
Beispiel #21
0
        //private PizzaBoxContext _db = new PizzaBoxContext();
        public MeatPizza()
        {
            Crust c = new Crust("St. Louis", 4);

            Crust = c;
            Size s = new Size("Large", 10);

            Size = s;
            Name = "MeatPizza";
        }
 public SupremePizza() : base()
 {
     Name     = "Supreme Pizza";
     Crust    = new Crust();
     Size     = new Size();
     Toppings = new List <Topping>();
     Toppings.Add(new Topping("Cheese", 1.00M));
     Toppings.Add(new Topping("Pepperoni", 1.00M));
     Toppings.Add(new Topping("Olives", 1.00M));
     Toppings.Add(new Topping("Pineapple", 1.00M));
     Toppings.Add(new Topping("Ham", 1.00M));
 }
Beispiel #23
0
        public static APizza MakePizza(string crust, string size, List <string> tops)
        {
            Crust madeCrust = new Crust(crust);
            Size  madeSize  = new Size(size);

            List <Toppings> toppings = new List <Toppings>();

            for (int i = 0; i < tops.Count; i++)
            {
                toppings.Add(GetTopping(tops[i]));
            }

            var pizza = new Pizza(madeCrust, madeSize, toppings);

            return(pizza);
        }
Beispiel #24
0
 public MeatPizza(int n)
 {
     Name     = "MeatPizza";
     Size     = new Size(2);
     Crust    = new Crust(2);
     Toppings = new List <Topping>
     {
         new Topping {
             Name  = "chicken",
             Price = 2,
         },
         new Topping
         {
             Name  = "beef",
             Price = 2,
         }
     };
 }
        private static bool FetchTypesOfCrustFromDB()
        {
            try
            {
                var ListOfCrustObjectFromDB = _db.Crust.ToList();
                _CrustTypesList = new List <Tuple <string, PizzaBox.Domain.Models.Crust> >();

                foreach (var crustObjectDB in ListOfCrustObjectFromDB)
                {
                    PizzaBox.Domain.Models.Crust a = new PizzaBox.Domain.Models.Crust(crustObjectDB.CrustId, crustObjectDB.Name, crustObjectDB.Price, crustObjectDB.Active);
                    _CrustTypesList.Add(Tuple.Create(a.Name, a));
                }
            }
            catch (System.Exception)
            {
                System.Console.WriteLine("Unable to fetch crust styles from our services.");
                return(false);
            }
            return(true);
        }//End Of FetchTypesOfCrustFromDB
Beispiel #26
0
 public bool RemoveCrustFromDBPizza(Order order, APizza pizza, Crust crust)
 {
     using (var db = new DbContextClass())
     {
         if (!db.Orders.Contains(order))
         {
             return(true);
         }
         if (!db.Pizzas.Contains(pizza))
         {
             return(true);
         }
         // if (component.GetType() == Topping.GetType())
         // {
         // Console.WriteLine("remove a topping");
         if (!db.Crusts.Contains(crust))
         {
             return(true);
         }
         // }
         db.Crusts.Remove(crust);
         return(db.SaveChanges() > 0);
     }
 }
Beispiel #27
0
        protected override void AddCrust()
        {
            Crust C = new Crust();

            Crust = C.type;
        }
Beispiel #28
0
 protected override void AddCrust()
 {
     Crust = new Crust();
 }
Beispiel #29
0
 public CustomPizza(Crust crust, List <Topping> toppings)
 {
     Crust    = crust;
     Toppings = toppings;
     Name     = "Custom Pizza";
 }
 public void AddCrust(Crust c)
 {
     Crust = c;
 }