예제 #1
0
 public ReviewsController(
     IProductsDataService productsData,
     IReviewsDataService reviewsData)
 {
     this.productsData = productsData;
     this.reviewsData  = reviewsData;
 }
        /// <summary>
        /// Validate Product Update
        /// </summary>
        /// <param name="product"></param>
        /// <param name="dataService"></param>
        public void ValidateProductUpdate(Product product, IProductsDataService dataService)
        {
            productsDataService = dataService;

            InitializeValidationRules(product);

            ValidateRequired("ProductCode", "Product Code");
            ValidateRequired("Description", "Description");
            ValidateRequired("UnitOfMeasure", "UnitOfMeasure");
            ValidateDecimalIsNotZero("UnitPrice", "Unit Price");
            ValidateDecimalGreaterThanZero("UnitPrice", "Unit Price");

            ValidateUniqueProductCode(product.ProductID, product.ProductCode);
        }
예제 #3
0
 public ProductsController(
     IProductsDataService productsData,
     ICategoriesDataService categoriesData,
     ISellersDataService sellersData,
     IImagesDataService imagesData,
     IReviewsDataService reviewsData,
     IHostingEnvironment appEnvironment)
 {
     this.productsData   = productsData;
     this.categoriesData = categoriesData;
     this.sellersData    = sellersData;
     this.imagesData     = imagesData;
     this.reviewsData    = reviewsData;
     this.appEnvironment = appEnvironment;
 }
        /// <summary>
        /// Validate Product Update
        /// </summary>
        /// <param name="product"></param>
        /// <param name="dataService"></param>
        public void ValidateProductUpdate(Product product, IProductsDataService dataService)
        {
            productsDataService = dataService;

            InitializeValidationRules(product);

            ValidateRequired("ProductCode", "Product Code");
            ValidateRequired("Description", "Description");
            ValidateRequired("UnitOfMeasure", "UnitOfMeasure");
            ValidateDecimalIsNotZero("UnitPrice", "Unit Price");
            ValidateDecimalGreaterThanZero("UnitPrice", "Unit Price");

            ValidateUniqueProductCode(product.ProductID, product.ProductCode);


        }
예제 #5
0
 public ShoppingCartController(IProductsDataService productsData, UserManager <User> userManager)
 {
     this.productsData = productsData;
     this.userManager  = userManager;
 }
 /// <summary>
 /// Constructor with Dependency Injection using Ninject
 /// </summary>
 /// <param name="dataService"></param>
 public ProductsApiController()
 {
     productsDataService = new ProductsDataService();
 }
        /// <summary>
        /// Initialize user Business Rules
        /// </summary>
        /// <param name="user"></param>
        /// <param name="dataService"></param>
        public void InitializeProductsBusinessRules(Product product, IProductsDataService dataService)
        {
            productsDataService = dataService;
            InitializeValidationRules(product);

        }
 /// <summary>
 /// Constructor
 /// </summary>
 public ProductsBusinessService(IProductsDataService dataService)
 {
     _productsDataService = dataService;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 public ProductsBusinessService(IProductsDataService dataService)
 {
     _productsDataService = dataService;
 }
예제 #10
0
 public ProductsController(IProductsDataService service)
 {
     _service = service;
 }
예제 #11
0
 public CategoriesController(IProductsDataService productsData, ICategoriesDataService categoriesData)
 {
     this.productsData   = productsData;
     this.categoriesData = categoriesData;
 }
 public ProductsManagerProvider(IUnitOfWork uow, IProductsDataService dataService)
 {
     _dataService = dataService;
     _uow         = uow;
 }
 /// <summary>
 /// Initialize user Business Rules
 /// </summary>
 /// <param name="user"></param>
 /// <param name="dataService"></param>
 public void InitializeProductsBusinessRules(Product product, IProductsDataService dataService)
 {
     productsDataService = dataService;
     InitializeValidationRules(product);
 }
 /// <summary>
 /// Constructor with Dependency Injection using Ninject
 /// </summary>
 /// <param name="dataService"></param>
 public ProductsApiController()
 {
     productsDataService = new ProductsDataService();
   
 }