/// <summary> /// Deletes the comment. /// </summary> /// <param name="comment">The comment.</param> /// <returns></returns> public int DeleteComment(EBlogPageComment comment) { return ExecuteNonQuery( "DELETE TBlogPageComment WHERE CommentID = @CommentID;", CreateParameter("CommentID", comment.CommentID) ); }
/// <summary> /// Changes the specified comment. /// </summary> /// <param name="comment">The comment.</param> /// <returns></returns> protected BBlogPageComment Change(EBlogPageComment comment) { return new BBlogPageComment() { Approved = comment.Approved, CommentDate = comment.CommentDate, CommentID = comment.CommentID, Content = comment.Content, PageID = comment.PageID, Title = comment.Title, UserID = comment.UserID, WriterName = comment.WriterName }; }
/// <summary> /// Inserts the comment. /// </summary> /// <param name="comment">The comment.</param> /// <returns></returns> public int InsertComment(EBlogPageComment comment) { return ExecuteInsertQueryReturnID( "TBlogPageComment", new Dictionary<string, object>() { {"PageID", comment.PageID}, {"UserID", comment.UserID}, {"WriterName", comment.WriterName}, {"Title", comment.Title}, {"Content", comment.Content}, {"CommentDate", comment.CommentDate}, {"Approved", comment.Approved}, }); }
/// <summary> /// Updates the comment. /// </summary> /// <param name="comment">The comment.</param> /// <returns></returns> public int UpdateComment(EBlogPageComment comment) { return ExecuteNonQuery( @"UPDATE TBlogPageComment SET PageID = @PageID, UserID = @UserID, WriterName = @WriterName, Title = @Title, [Content] = @Content, CommentDate = @CommentDate, Approved = @Approved WHERE CommentID = @CommentID", CreateParameter("@CommentID", DbType.Int32, comment.CommentID), CreateParameter("@PageID", DbType.Int32, comment.PageID), CreateParameter("@UserID", DbType.Guid, comment.UserID), CreateParameter("@WriterName", DbType.String, comment.WriterName), CreateParameter("@Title", DbType.String, comment.Title), CreateParameter("@Content", DbType.String, comment.Content), CreateParameter("@CommentDate", DbType.DateTime, comment.CommentDate), CreateParameter("@Approved", DbType.Boolean, comment.Approved)); }