示例#1
0
        public void DeleteProduct(Quantumart.QP8.BLL.Article product, ProductDefinition definition, bool doNotSendNotifications, bool checkRootArticlePermissions, string[] channels)
        {
            Dictionary <int, Product <DeletingMode> > dictionary;

            Article[] products;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Suppress))
            {
                dictionary = DoWithLogging(
                    () => GetProductsToBeProcessed(product, definition, ef => ef.DeletingMode, DeletingMode.Delete, false),
                    "Receiving articles to be deleted for product {id}", product.Id
                    );
                products = doNotSendNotifications ? null : Productservice.GetSimpleProductsByIds(new[] { product.Id });
            }

            DeleteProducts(dictionary, product.Id, checkRootArticlePermissions);

            if (!doNotSendNotifications)
            {
                using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Suppress))
                {
                    SendNotification(products, product.Id, channels);
                }
            }
        }
示例#2
0
 protected override Article[] GetNotificationProducts(int productId)
 {
     try
     {
         return(Productservice.GetSimpleProductsByIds(new[] { productId }));
     }
     catch (Exception ex)
     {
         throw new ProductException(productId, "Product notification preparing failed", ex)
               {
                   IsError = true
               };
     }
 }