public static List <BSComment> GetCommentsByUserID(int iUserID, CommentStates state) { List <BSComment> comments = new List <BSComment>(); using (DataProcess dp = new DataProcess()) { if (state == CommentStates.All) { dp.AddParameter("UserID", iUserID); dp.ExecuteReader("SELECT * FROM Comments WHERE [UserID]=@UserID ORDER By CreateDate DESC"); } else { dp.AddParameter("UserID", iUserID); dp.AddParameter("Approve", state == CommentStates.Approved); dp.ExecuteReader("SELECT * FROM Comments WHERE [UserID]=@UserID AND [Approve]=@Approve ORDER By CreateDate DESC"); } if (dp.Return.Status == DataProcessState.Success) { using (IDataReader dr = dp.Return.Value as IDataReader) { while (dr != null && dr.Read()) { BSComment bsComment = new BSComment(); FillComment(dr, bsComment); comments.Add(bsComment); } } } } return(comments); }
public static List <BSComment> GetComments(CommentStates state, int iCommentCount) { List <BSComment> comments = new List <BSComment>(); using (DataProcess dp = new DataProcess()) { string top = iCommentCount == 0 ? String.Empty : "TOP " + iCommentCount; if (state == CommentStates.All) { dp.ExecuteReader(String.Format("SELECT {0} * FROM Comments ORDER By CreateDate DESC", top)); } else { dp.AddParameter("Approve", state == CommentStates.Approved); dp.ExecuteReader(String.Format("SELECT {0} * FROM Comments WHERE [Approve]=@Approve ORDER By CreateDate DESC", top)); } if (dp.Return.Status == DataProcessState.Success) { using (IDataReader dr = dp.Return.Value as IDataReader) { while (dr != null && dr.Read()) { BSComment bsComment = new BSComment(); FillComment(dr, bsComment); comments.Add(bsComment); } } } } return(comments); }
public List <BSComment> GetComments(CommentStates state) { return(BSComment.GetCommentsByPostID(PostID, state)); }
public static List<BSComment> GetCommentsByUserID(int iUserID, CommentStates state) { List<BSComment> comments = new List<BSComment>(); using (DataProcess dp = new DataProcess()) { if (state == CommentStates.All) { dp.AddParameter("UserID", iUserID); dp.ExecuteReader("SELECT * FROM Comments WHERE [UserID]=@UserID ORDER By CreateDate DESC"); } else { dp.AddParameter("UserID", iUserID); dp.AddParameter("Approve", state == CommentStates.Approved); dp.ExecuteReader("SELECT * FROM Comments WHERE [UserID]=@UserID AND [Approve]=@Approve ORDER By CreateDate DESC"); } if (dp.Return.Status == DataProcessState.Success) { using (IDataReader dr = dp.Return.Value as IDataReader) { while (dr != null && dr.Read()) { BSComment bsComment = new BSComment(); FillComment(dr, bsComment); comments.Add(bsComment); } } } } return comments; }
public static List<BSComment> GetComments(CommentStates state, int iCommentCount) { List<BSComment> comments = new List<BSComment>(); using (DataProcess dp = new DataProcess()) { string top = iCommentCount == 0 ? String.Empty : "TOP " + iCommentCount; if (state == CommentStates.All) { dp.ExecuteReader(String.Format("SELECT {0} * FROM Comments ORDER By CreateDate DESC", top)); } else { dp.AddParameter("Approve", state == CommentStates.Approved); dp.ExecuteReader(String.Format("SELECT {0} * FROM Comments WHERE [Approve]=@Approve ORDER By CreateDate DESC", top)); } if (dp.Return.Status == DataProcessState.Success) { using (IDataReader dr = dp.Return.Value as IDataReader) { while (dr != null && dr.Read()) { BSComment bsComment = new BSComment(); FillComment(dr, bsComment); comments.Add(bsComment); } } } } return comments; }
public static List<BSComment> GetComments(CommentStates state) { return GetComments(state, 0); }
public List<BSComment> GetComments(CommentStates state) { return BSComment.GetCommentsByPostID(PostID, state); }
public static int GetCommentCount(int iUserID, CommentStates state) { return BSComment.GetCommentsByUserID(iUserID, state).Count; }
public static int GetCommentCount(CommentStates state) { return BSComment.GetComments(state).Count; }
public static List <BSComment> GetComments(CommentStates state) { return(GetComments(state, 0)); }
public static int GetCommentCount(int iUserID, CommentStates state) { return(BSComment.GetCommentsByUserID(iUserID, state).Count); }
public static int GetCommentCount(CommentStates state) { return(BSComment.GetComments(state).Count); }