Пример #1
0
        public void AddProduct(Product product)
        {
            Product prodFromList = ProductMethods.GetProductById(product, ConnectionString);

            if (prodFromList == null)
            {
                if (product.Name.Length <= 200)
                {
                    ProductMethods.AddProduct(product, ConnectionString);
                }
            }
            else
            {
                ProductMethods.UpdateProduct(ConnectionString, $"update PRODUCTS set ProductCount += {product.Count} where Id = {prodFromList.Id};");
            }
        }