Exemple #1
0
        public static bool DeleteComment(string commentId, string commentType)
        {
            try
            {
                var contentComment = ContentCommentRepository.SelectById(CurrentUser.Instance.SiteID, Guid.Parse(commentId), commentType.ToEnum <CommentTables>());
                if (contentComment != null && !string.IsNullOrEmpty(contentComment.FileName))
                {
                    var fsp = new FileSystemProvider();
                    fsp.Delete(CurrentUser.Instance.SiteID, EnumHelper.GetEnumDescription(commentType.ToEnum <CommentTables>()), contentComment.FileName, FileType.Attachment);
                }

                ContentCommentRepository.Delete(CurrentUser.Instance.SiteID, Guid.Parse(commentId), commentType.ToEnum <CommentTables>());
                return(true);
            }
            catch (Exception ex)
            {
                Log.Error(string.Format("ContentComment DeleteComment({0}, {1})", commentId, commentType), ex);
                return(false);
            }
        }