예제 #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 ConfirmUpdateProductDirections(SecurityInfo securityInfo, List <long> itemIds)
 {
     if (ValidatePassword(securityInfo))
     {
         IShapingProductDirections shaping = new ShapingProductDirections(dataService, optionService);
         shaping.ConfirmUpdate(securityInfo.Login, itemIds);
     }
 }
예제 #3
0
        public ProductDirections GetProductDirections(SecurityInfo securityInfo, DateTimeOffset lastUpdate)
        {
            ProductDirections productDirections = null;

            if (ValidatePassword(securityInfo))
            {
                IShapingProductDirections shaping = new ShapingProductDirections(dataService, optionService);
                productDirections = shaping.GetItems(securityInfo.Login, lastUpdate);
            }

            return(productDirections);
        }
예제 #4
0
        public ProductDirectionInfo GetProductDirection(SecurityInfo securityInfo, long id)
        {
            ProductDirectionInfo productDirectionInfo = null;

            if (ValidatePassword(securityInfo))
            {
                IShapingProductDirections shaping = new ShapingProductDirections(dataService, optionService);
                productDirectionInfo = shaping.GetItem(id);
            }

            return(productDirectionInfo);
        }