Exemplo n.º 1
0
        public static void RemovePhotosOfDeletedAds()
        {
            SiteSettings s = SiteSettings.GetSharedSettings();

            // must remove photos from file system before removing from DB
            using (PhotosDataAdapter db = new PhotosDataAdapter())
            {
                if (s.StorePhotosInDatabase)
                {
                    AdsDataComponent.PhotosDataTable deletedAdPhotos = db.GetPhotosByAdStatus((int)AdStatus.Deleted);
                    RemovePhotoFilesInTable(deletedAdPhotos);
                }

                db.RemovePhotosByAdStatus((int)AdStatus.Deleted);
            }
        }
Exemplo n.º 2
0
 public static void RemovePhotosByAdId(int adId)
 {
     SiteSettings s = SiteSettings.GetSharedSettings();
     using (PhotosDataAdapter db = new PhotosDataAdapter())
     {
         if (s.StorePhotosInDatabase)
         {
             AdsDataComponent.PhotosDataTable photos = db.GetPhotosByAdStatus((int)AdStatus.Deleted);
             RemovePhotoFilesInTable(photos);
         }
     }
 }