Пример #1
0
 public void Delete(int productID)
 {
     Task.Run(() =>
     {
         //LinqTools.RemoveProduct(productID);
         Product product          = LinqTools.GetProductById(productID);
         product.DiscontinuedDate = DateTime.Today;
         LinqTools.UpdateProduct(product);
         CollectionChanged?.Invoke();
     });
 }
Пример #2
0
        public void Upsert(Product product)
        {
            Task.Run(() =>
            {
                if (LinqTools.GetProductById(product.ProductID) != null)
                {
                    LinqTools.UpdateProduct(product);
                }
                else
                {
                    LinqTools.AddNewProduct(product);
                }

                CollectionChanged?.Invoke();
            });
        }