Exemple #1
0
    /// <summary>
    /// render the HTML comments
    /// </summary>
    public string GenarateComments(AskAFriend askAFriend)
    {
        AjaxAAFComment[] commentList = AjaxAAFComment.GetAAFCommentsByAskAFriendIDWithJoin(askAFriend.AskAFriendID);

        StringBuilder sbComments = new StringBuilder();

        for (int i = 0; i < 10; i++)
        {
            if (commentList.Length <= i)
            {
                break;
            }

            sbComments.Append(commentList[i].ToHTML());
        }
        return(sbComments.ToString());
    }
        /// <summary>
        /// gets all the comments for an AskAFriend Question since the last request
        /// </summary>
        /// <param name="MemberCommentID"></param>
        /// <returns></returns>
        public static AjaxAAFComment[] GetAAFCommentsByWebAskAFriendSinceLastIDWithJoin(string WebAskAFriendID, string LastWebAskAFriendCommentID)
        {
            Database db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("HG_GetAAFCommentsByWebAskAFriendSinceLastIDWithJoin");
            db.AddInParameter(dbCommand, "WebAskAFriendID", DbType.String, WebAskAFriendID);
            db.AddInParameter(dbCommand, "LastWebAskAFriendCommentID", DbType.String, LastWebAskAFriendCommentID);

            //execute the stored procedure
            AjaxAAFComment[] AskAFriendComments = new AjaxAAFComment[0];

            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                AskAFriendComments = AjaxAAFComment.PopulateAjaxComment(dr);
                dr.Close();
            }
            return AskAFriendComments;
        }