public ProductServiceImpl() { this.imageRepository = new ImageRepositoryImpl(); this.productSizeRepository = new ProductSizeRepositoryImpl(); this.productRepository = new ProductRepositoryImpl(); this.productColorRepository = new ProductColorRepositoryImpl(); }
public IEnumerable <ProductColor> GetColorFilters(List <FiltersView> filtersView) { var _colorRep = new ProductColorRepository(_context); List <ProductColor> colorFilter = new List <ProductColor> { }; foreach (FiltersView item in filtersView) { if (item.Checked) { string[] result = item.Id.Split(new char[] { '_' }, StringSplitOptions.None); if ((result[1] != null) && (result[0] == "color")) { colorFilter.Add(_colorRep.GetById(Int32.Parse(result[1]))); } } } return(colorFilter.ToList()); }
public string GetFilters() { var _colorRep = new ProductColorRepository(_context); var _metalRep = new ProductMetalRepository(_context); var _typeRep = new ProductTypeRepository(_context); var _statusRep = new ProductStatusRepository(_context); var _statusAvRep = new ProductAvStatusRepository(_context); var _genderRep = new GenderRepository(_context); var filters = new ProductsFilters() { ColorList = _colorRep.GetAllAvailable().Select(_mapper.Map <ProductColorView>), MetalList = _metalRep.GetAllAvailable(), GenderList = _genderRep.GetAllAvailable(), TypeList = _typeRep.GetAllAvailable(), StatusList = _statusRep.GetAllAvailable(), StatusAvList = _statusAvRep.GetAllAvailable() }; ViewBag.Data = JsonConvert.SerializeObject(filters); return(ViewBag.Data); }
public ProductColorController (ProductColorRepository productColorRepository) { _productColorRepository = productColorRepository; }
public ProductColorMappingController(ProductColorRepository mappingRepository) { this._mappingRepository = mappingRepository; }
public ProductController(ProductRepository productRepository, ProductColorRepository productColorRepository, BlogsRepository blogsRepository, ProductTypeRepository productTypeRepository) { _productRepository = productRepository; _productColorRepository = productColorRepository; _productTypeRepository = productTypeRepository; }