예제 #1
0
        public CountInfo PrepareToUpdate(SecurityInfo securityInfo,
                                         DateTimeOffset lastUpdateBrands,
                                         DateTimeOffset lastUpdateCatalogs,
                                         DateTimeOffset lastUpdateDirectories,
                                         DateTimeOffset lastUpdateProductDirections,
                                         DateTimeOffset lastUpdatePhotos,
                                         bool needLoadPhotos,
                                         long[] ids)
        {
            CountInfo result = null;

            if (ValidatePassword(securityInfo))
            {
                IShapingBrands            shapingBrands            = new ShapingBrands(dataService, optionService);
                IShapingCatalogs          shapingCatalogs          = new ShapingCatalogs(dataService, optionService, priceService);
                IShapingDirectories       shapingDirectories       = new ShapingDirectories(dataService, optionService);
                IShapingProductDirections shapingProductDirections = new ShapingProductDirections(dataService,
                                                                                                  optionService);
                IShapingPhotos shapingPhotos = new ShapingPhotos(dataService, optionService);

                result = new CountInfo
                {
                    CountBrands            = shapingBrands.PrepareToUpdate(securityInfo.Login, lastUpdateBrands),
                    CountCatalogs          = shapingCatalogs.PrepareToUpdate(securityInfo.Login, lastUpdateCatalogs),
                    CountDirectories       = shapingDirectories.PrepareToUpdate(securityInfo.Login, lastUpdateDirectories),
                    CountProductDirections = shapingProductDirections.PrepareToUpdate(securityInfo.Login, lastUpdateProductDirections),
                    CountPhotos            = needLoadPhotos ? shapingPhotos.PrepareToUpdate(securityInfo.Login, lastUpdatePhotos, ids) : 0,
                    IsAuthorized           = true
                };
            }

            return(result);
        }
예제 #2
0
 public void ConfirmUpdateBrands(SecurityInfo securityInfo, List <long> itemIds)
 {
     if (ValidatePassword(securityInfo))
     {
         IShapingBrands shaping = new ShapingBrands(dataService, optionService);
         shaping.ConfirmUpdate(securityInfo.Login, itemIds);
     }
 }
예제 #3
0
        public Brands GetBrands(SecurityInfo securityInfo, DateTimeOffset lastUpdate)
        {
            Brands brands = null;

            if (ValidatePassword(securityInfo))
            {
                IShapingBrands shaping = new ShapingBrands(dataService, optionService);
                brands = shaping.GetItems(securityInfo.Login, lastUpdate);
            }

            return(brands);
        }
예제 #4
0
        public BrandInfo GetBrand(SecurityInfo securityInfo, long id)
        {
            BrandInfo brands = null;

            if (ValidatePassword(securityInfo))
            {
                IShapingBrands shaping = new ShapingBrands(dataService, optionService);
                brands = shaping.GetItem(id);
            }

            return(brands);
        }