Exemplo n.º 1
0
 public void DeleteProduct(int id, int amount)
 {
     if (product_manager.Delete(id, amount))
     {
         var rows = dependency_table.Select(Filter(id));
         if (rows.Length > 0)
         {
             rows [0].Delete();
         }
     }
 }
Exemplo n.º 2
0
 public void DeleteProduct(int id, int amount)
 {
     if (OrderManager.Delete(id, amount))
     {
         var rows = order_product_table.Select(Filter(id));
         if (rows.Length > 0)
         {
             rows [0].Delete();
         }
     }
     ReadDeps(id, amount, false);
 }
Exemplo n.º 3
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);
            }
        }