示例#1
0
        public void DeleteCommentAttachment(int commentAttachmentId)
        {
            var rows = CommentsAttachments.Select(string.Format("CommentAttachmentID = {0}", commentAttachmentId));

            if (!rows.Any())
            {
                return;
            }

            var deletingCommentAttachment = rows.First();

            deletingCommentAttachment.Delete();

            UpdateCommentsAttachments();
        }
示例#2
0
        public void AddCommentAttachment(int commentId, string commentAttachmentName)
        {
            var newCommentAttachment = CommentsAttachments.NewRow();

            newCommentAttachment["CommentID"]             = commentId;
            newCommentAttachment["CommentAttachmentName"] = commentAttachmentName;
            CommentsAttachments.Rows.Add(newCommentAttachment);

            UpdateCommentsAttachments();

            var commentAttachmentId = GetCommentAttachmentId(commentId, commentAttachmentName);

            newCommentAttachment["CommentAttachmentID"] = commentAttachmentId;
            newCommentAttachment.AcceptChanges();
        }
示例#3
0
        public void DeleteCommentAttachments(int commentId)
        {
            var rows = CommentsAttachments.Select(string.Format("CommentID = {0}", commentId));

            if (!rows.Any())
            {
                return;
            }

            foreach (var deletingCommentAttachment in rows)
            {
                deletingCommentAttachment.Delete();
            }

            UpdateCommentsAttachments();
        }