public bool Add(string name, decimal price) { NullCheck(name); EmptyStringCheck(name); PriceCheck(price); var product = new Product(name, price); return(productDao.Add(ref product)); }
public bool Add(Product product) { ProductNullCheck(product); NameCheck(product.Name); DescriptionCheck(product.Description); PhotoCheck(product.Photo); return(productDao.Add(product)); }
public bool InsertProduct(ProductViewModel model) { var product = new Product() { Category = model.Category, CategoryB = model.CategoryB, Description = model.Description, Name = model.Name, Price = model.Price }; return(_productDao.Add(product)); }
public IResult Add(Product product) { IResult result = BusinessRules.Run(CheckIfProductNameExists(product.ProductName), CheckIfProductCountCategoryCorrect(product.CategoryId), CheckIfCategoryLimitExceded()); if (result != result) { return(result); } _productDao.Add(product); return(new SuccessResult(Messages.ProductAdded)); }
public void Add(ProductDto product) { _productDao.Add(DtoConverter.Convert(product)); }
public IActionResult Add([FromForm] Product p) { _productDao.Add(p); return(Ok()); }
public IResult Add(Product product) { _productDao.Add(product); return(new SuccessResult(true, ResultMessages.ProductAdded)); }
public void Add(Product product) { _stockDao.Add(product); }
public void Add(Product entity) { _productDao.Add(entity); }