예제 #1
0
 /// <summary>
 /// delete product by productId
 /// </summary>
 /// <param name="productId"></param>
 /// <param name="sentToLuceneIndex"></param>
 /// <returns></returns>
 public static bool DeleteProduct(int productId, bool sentToLuceneIndex)
 {
     PhotoService.DeletePhotos(productId, PhotoType.Product);
     DeleteRelatedProducts(productId);
     SQLDataAccess.ExecuteNonQuery("[Catalog].[sp_DeleteProduct]", CommandType.StoredProcedure, new SqlParameter("@ProductID", productId));
     CategoryService.ClearCategoryCache();
     if (sentToLuceneIndex)
     {
         LuceneSearch.ClearLuceneIndexRecord(productId);
     }
     return(true);
 }
예제 #2
0
        /// <summary>
        /// delete category and photo of category
        /// </summary>
        /// <param name="categoryId"></param>
        public static void DeleteCategoryAndPhotos(int categoryId)
        {
            foreach (var id in DeleteCategory(categoryId, true))
            {
                PhotoService.DeletePhotos(id, PhotoType.CategoryBig);
                PhotoService.DeletePhotos(id, PhotoType.CategorySmall);
            }

            var cacheName = CacheNames.GetBottomMenuCacheObjectName();

            if (CacheManager.Contains(cacheName))
            {
                CacheManager.Remove(cacheName);
            }
        }
예제 #3
0
 public static void DeleteBrandLogo(int brandId)
 {
     PhotoService.DeletePhotos(brandId, PhotoType.Brand);
 }