Exemple #1
0
        public PizzaL(string C, string Si, string Sa, string FC, string SC)
        {
            SizeL   s  = new SizeL();
            CrustL  c  = new CrustL();
            SauceL  sa = new SauceL();
            CheeseL ch = new CheeseL();


            Crust   = c.FindCrustByName(C);
            Size    = s.FindSizeByName(Si);
            Sauce   = sa.FindSauceByName(Sa);
            Cheese1 = ch.FindCheeseByName(FC);
            Cheese2 = ch.FindCheeseByName(SC);
            Cost    = GetTotalCost(C, Si);

            if (!CheckTotalCost())
            {
                throw new Exception("The total cost is over $1,000!!!");
            }

            EFData ef = new EFData();

            ef.AddPizza(Crust, Size, Sauce, Cheese1, Cheese2, Cost);

            ef.AddPizzaOrder();

            c.ClearSelected();
            s.ClearSelected();
            sa.ClearSelected();
            ch.ClearSelected();
        }
Exemple #2
0
        public double GetTotalCost(string C, string S)
        {
            double total = 0;

            SizeL    s = new SizeL();
            CrustL   c = new CrustL();
            ToppingL t = new ToppingL();

            total += s.GetSizeCost(S);
            total += c.GetCrustCost(C);
            total += t.GetToppingCount();

            return(total);
        }