Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public bool DestroyAllProductsForStore(long storeId)
        {
            var bvins = CatalogServices.Products.FindAllBvinsForStore(storeId);

            foreach (var bvin in bvins)
            {
                CatalogServices.DestroyProduct(bvin, storeId);
            }
            return(true);
        }
Ejemplo n.º 3
0
 public bool DestroyProduct(string bvin, long storeId)
 {
     return(CatalogServices.DestroyProduct(bvin, storeId));
 }