Пример #1
0
        public bool DeletePicture(int id)
        {
            PictureDTO resultData = pictureData.DeletePicture(id);
            bool       result     = false;

            if (resultData != null)
            {
                result = loader.DeleteMedia(resultData.Id, resultData.BelongsToNewsId);
                MessageQueueManager manager = MessageQueueManager.Instance;
                manager.PublishMessage(resultData.BelongsToNewsId, resultData.Id, resultData, MessageOperation.Delete);
            }
            return(result);
        }
Пример #2
0
        public bool DeleteNews(int newsId)
        {
            NewsDTO dataResult = newsData.DeleteNews(newsId);
            bool    result     = false;

            if (dataResult != null)
            {
                foreach (PictureDTO p in dataResult.Pictures)
                {
                    loader.DeleteMedia(p.Id, dataResult.Id);
                }
                if (dataResult.BackgroundPicture != null)
                {
                    loader.DeleteMedia(dataResult.BackgroundPicture.Id, dataResult.Id);
                }


                MessageQueueManager manager = MessageQueueManager.Instance;
                manager.PublishMessage(dataResult.Id, dataResult.Id, dataResult, MessageOperation.Delete);
                result = true;
            }
            return(result);
        }