public PrepareOrder(string name, IList <string> listIngredients, int timeToBake)
        {
            _AcceptOrder = new AcceptOrder();
            AbstractStepOrderPreparing _BakeOrder = new BakeOrder();
            AbstractStepOrderPreparing _CutOrder  = new CutOrder();
            AbstractStepOrderPreparing _BoxOrder  = new BoxOrder();

            _AcceptOrder.SetNextStep(_BakeOrder);
            _BakeOrder.SetNextStep(_CutOrder);
            _CutOrder.SetNextStep(_BoxOrder);

            this.Name            = name;
            this.ListIngredients = listIngredients;
            this.TimeToBake      = timeToBake;
        }
        public AddRemoveForm(bool addRemove /* true = insert, false = remove */)
        {
            InitializeComponent();
            switch (addRemove)
            {
            case true:
                label.Text = "Insert Quantity";
                this.Size  = new Size(351, 150);
                labelOrder.Show();
                BoxOrder.Show();
                break;

            case false:
                label.Text = "Remove Quantity";
                this.Size  = new Size(351, 128);
                break;
            }
        }
        public System.Collections.Generic.IEnumerable <BoxOrder> SearchBoxes(SearchTicket search, out bool succes)
        {
            var cart = dataManger.SearchBoxes(search.X, search.Y, search.Amount, search.MaxSizeMulti, search.MaxDifBoxes);

            var list      = new LinkedList <BoxOrder>();
            var boxesLeft = search.Amount;

            while (!cart.IsEmpty)
            {
                Box box;
                cart.Dequeue(out box);
                var toAdd = Math.Min(boxesLeft, box.Quantity);
                var order = new BoxOrder()
                {
                    Box = box, Amount = toAdd
                };
                boxesLeft -= toAdd;
                list.AddLast(order);
            }

            succes = boxesLeft == 0;

            return(list);
        }