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); }
public bool DestroyAllProductsForStore(long storeId) { var bvins = CatalogServices.Products.FindAllBvinsForStore(storeId); foreach (var bvin in bvins) { CatalogServices.DestroyProduct(bvin, storeId); } return(true); }
public bool DestroyProduct(string bvin, long storeId) { return(CatalogServices.DestroyProduct(bvin, storeId)); }