public static bool SaveChanges(Product product) { var tmp = productDAO.FindByID(product.ProductID); if (tmp == null) { //int id = GetAll().Max(p => p.ProductID); //product.ProductID = id + 1; return(productDAO.Add(product)); } else { return(productDAO.Update(product)); } }
public bool Add(Product product) { return(productDAO.Add(product)); }
public bool AddProduct(string categoryName, Product product) => productDAO.Add(categoryName, product);