Esempio n. 1
0
 public OrderProcess()
 { //called at system startup, this makes new objects ready for orders
     ChosenSandwhiches = new List <Sandwich>();
     ChosenBread       = new Stock();
     ChosenSpread      = new Stock();
     ChosenSauce       = new Stock();
     ChosenFilling     = new Filling();
     ChosenSalad       = new Salad();
     ReciptList        = new List <string>();
 }
Esempio n. 2
0
        public void SendCat3ToStorageClass()
        { //selects the active category and then sends the list to a temp store in the OrderProcess Class
            decimal cat3Price = 0;

            foreach (Stock item in listChosenCat3Items)
            { //calculates the total price of the selected fillings / salad items
                cat3Price += item.Price;
            }
            if (ActiveMainCatagory == "Filling")
            { //creates a new filling object and sends to storage in the OrderProcess Class
                Filling newFilling = new Filling();
                newFilling.Price    = cat3Price;
                newFilling.Fillings = listChosenCat3Items;
                Program.ProcessOrder.ChosenFilling = newFilling;
            }
            else if (ActiveMainCatagory == "Salad")
            {// creates a new salad object and sends to storage in the OrderProces Class.
                Salad newSalad = new Salad();
                newSalad.Price      = cat3Price;
                newSalad.SaladItems = listChosenCat3Items;
                Program.ProcessOrder.ChosenSalad = newSalad;
            }
        }