Ejemplo n.º 1
0
        public void AddProduct(int id, int amount)
        {
            var cycle_checker = new CycleChecker(Id);

            if (cycle_checker.IsCycle(id))
            {
                return;
            }
            //TODO DialogInfo about it
            //TODO Check if it is not infinite loop
            if (Id != id)
            {
                product_manager.Add(id, amount);
            }
        }
Ejemplo n.º 2
0
        private void ReadDeps(int id, int amount, bool addToOrder)
        {
            if (addToOrder)
            {
                full_order_manager.Add(id, amount);
            }
            else
            {
                full_order_manager.Delete(id, amount);
            }
            DataTable table = Database.ProductDependencyTable.SelectDependency(id);

            foreach (var child in table.Select())
            {
                ReadDeps((int)child [1], (int)child [2] * amount, addToOrder);
            }
        }
Ejemplo n.º 3
0
 public void AddProduct(int id, int amount)
 {
     OrderManager.Add(id, amount);
     ReadDeps(id, amount, true);
 }