예제 #1
0
        private ClearProductsData DeleteSome(long storeId, int howMany)
        {
            var items      = CatalogServices.Products.FindAllPagedWithCache(1, howMany);
            var totalCount = CatalogServices.Products.FindAllCount(storeId);

            if (items != null)
            {
                foreach (var p in items)
                {
                    CatalogServices.DestroyProduct(p.Bvin, p.StoreId);
                }
            }

            var left = totalCount - howMany;

            if (left < 0)
            {
                left = 0;
            }
            var cleared = howMany;

            if (totalCount < howMany)
            {
                cleared = totalCount;
            }
            var result = new ClearProductsData();

            result.ProductsCleared   = cleared;
            result.ProductsRemaining = left;

            return(result);
        }
예제 #2
0
        public bool DestroyAllProductsForStore(long storeId)
        {
            var bvins = CatalogServices.Products.FindAllBvinsForStore(storeId);

            foreach (var bvin in bvins)
            {
                CatalogServices.DestroyProduct(bvin, storeId);
            }
            return(true);
        }
예제 #3
0
 public bool DestroyProduct(string bvin, long storeId)
 {
     return(CatalogServices.DestroyProduct(bvin, storeId));
 }