public CollectionViewModelService(
     ICollectionService collectionService,
     IProductCollectionService productCollectionService,
     ICollectionLayoutService collectionLayoutService,
     IProductService productService,
     ICustomerService customerService,
     IStoreService storeService,
     ISlugService slugService,
     IPictureService pictureService,
     ITranslationService translationService,
     IDiscountService discountService,
     ICustomerActivityService customerActivityService,
     IVendorService vendorService,
     IDateTimeService dateTimeService,
     ILanguageService languageService,
     IWorkContext workContext,
     SeoSettings seoSettings)
 {
     _collectionLayoutService  = collectionLayoutService;
     _collectionService        = collectionService;
     _productCollectionService = productCollectionService;
     _productService           = productService;
     _customerService          = customerService;
     _storeService             = storeService;
     _slugService             = slugService;
     _pictureService          = pictureService;
     _translationService      = translationService;
     _discountService         = discountService;
     _customerActivityService = customerActivityService;
     _vendorService           = vendorService;
     _dateTimeService         = dateTimeService;
     _languageService         = languageService;
     _workContext             = workContext;
     _seoSettings             = seoSettings;
 }
Exemplo n.º 2
0
 public LayoutController(ICategoryLayoutService categoryLayoutService,
                         IBrandLayoutService brandLayoutService,
                         ICollectionLayoutService collectionLayoutService,
                         IProductLayoutService productLayoutService,
                         IPageLayoutService pageLayoutService)
 {
     _categoryLayoutService   = categoryLayoutService;
     _brandLayoutService      = brandLayoutService;
     _collectionLayoutService = collectionLayoutService;
     _productLayoutService    = productLayoutService;
     _pageLayoutService       = pageLayoutService;
 }
Exemplo n.º 3
0
 public GetCollectionLayoutViewPathHandler(
     ICollectionLayoutService collectionLayoutService)
 {
     _collectionLayoutService = collectionLayoutService;
 }
Exemplo n.º 4
0
        public CollectionValidator(IEnumerable <IValidatorConsumer <CollectionDto> > validators,
                                   ITranslationService translationService, IPictureService pictureService, ICollectionService collectionService, ICollectionLayoutService collectionLayoutService)
            : base(validators)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessage(translationService.GetResource("Api.Catalog.Collection.Fields.Name.Required"));
            RuleFor(x => x).MustAsync(async(x, y, context) =>
            {
                if (!string.IsNullOrEmpty(x.PictureId))
                {
                    var picture = await pictureService.GetPictureById(x.PictureId);
                    if (picture == null)
                    {
                        return(false);
                    }
                }
                return(true);
            }).WithMessage(translationService.GetResource("Api.Catalog.Collection.Fields.PictureId.NotExists"));

            RuleFor(x => x).MustAsync(async(x, y, context) =>
            {
                if (!string.IsNullOrEmpty(x.CollectionLayoutId))
                {
                    var layout = await collectionLayoutService.GetCollectionLayoutById(x.CollectionLayoutId);
                    if (layout == null)
                    {
                        return(false);
                    }
                }
                return(true);
            }).WithMessage(translationService.GetResource("Api.Catalog.Collection.Fields.CollectionLayoutId.NotExists"));

            RuleFor(x => x).MustAsync(async(x, y, context) =>
            {
                if (!string.IsNullOrEmpty(x.Id))
                {
                    var collection = await collectionService.GetCollectionById(x.Id);
                    if (collection == null)
                    {
                        return(false);
                    }
                }
                return(true);
            }).WithMessage(translationService.GetResource("Api.Catalog.Collection.Fields.Id.NotExists"));
        }