Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 2
0
 public void DeleteProduct(Quantumart.QP8.BLL.Article product, ProductDefinition definition)
 {
     using (var transaction = CreateTransaction())
     {
         DeleteProduct(product, definition, true, false, null);
         transaction.Commit();
     }
 }
Ejemplo n.º 3
0
 protected virtual void InitializeArticle(Quantumart.QP8.BLL.Article article)
 {
 }
Ejemplo n.º 4
0
 protected override void InitializeArticle(Quantumart.QP8.BLL.Article article)
 {
     article.Archived = false;
 }
Ejemplo n.º 5
0
 private void VerifyArticleOnSave(Quantumart.QP8.BLL.Article article)
 {
     Assert.IsNotNull(Transaction, "Article " + article.Id + " saved not in transaction");
     Assert.IsFalse(Transaction.IsCommited, "Article " + article.Id + " saved after transaction been committed");
     Assert.IsFalse(Transaction.IsDispossed, "Article " + article.Id + " saved out of transaction scope");
 }