示例#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();
        }