Ejemplo n.º 1
0
        } //CommentAdvancedInsert

        public static List <Blog.Comment.Reply> CommentAdvancedSelect()
        {
            List <Blog.Comment.Reply> list = null;

            DataProvider.ExecuteCmd(GetConnection, "dbo.CommentAdvanced_Select"
                                    , inputParamMapper : null, map : delegate(IDataReader reader, short set)
            {
                Blog.Comment.Reply b = new Blog.Comment.Reply();
                int startingIndex    = 0;

                b.ID              = reader.GetSafeInt32(startingIndex++);
                b.BlogPostID      = reader.GetSafeInt32(startingIndex++);
                b.ParentCommentID = reader.GetSafeInt32(startingIndex++);
                b.UserName        = reader.GetSafeString(startingIndex++);
                b.Title           = reader.GetSafeString(startingIndex++);
                b.Content         = reader.GetSafeString(startingIndex++);
                b.DateCreated     = reader.GetSafeDateTime(startingIndex++);
                b.DateModified    = reader.GetSafeDateTime(startingIndex++);

                if (list == null)
                {
                    list = new List <Blog.Comment.Reply>();
                }

                list.Add(b);
            }
                                    );


            return(list);
        } //CommentAdvancedSelect
        } //CommentReplySelect

        public static List <Blog.Comment.Reply> CommentReplySelectByCommentId(int commentId)
        {
            List <Blog.Comment.Reply> list = null;

            DataProvider.ExecuteCmd(GetConnection, "dbo.CommentReply_SelectByCommentId"
                                    , inputParamMapper : delegate(SqlParameterCollection paramCollection)
            {
                paramCollection.AddWithValue("@CommentId", commentId);
            }, map : delegate(IDataReader reader, short set)
            {
                Blog.Comment.Reply b = new Blog.Comment.Reply();
                int startingIndex    = 0;

                b.ParentCommentID = reader.GetSafeInt32(startingIndex++);
                b.UserName        = reader.GetSafeString(startingIndex++);
                b.Title           = reader.GetSafeString(startingIndex++);
                b.Content         = reader.GetSafeString(startingIndex++);
                b.DateCreated     = reader.GetSafeDateTime(startingIndex++);
                b.DateModified    = reader.GetSafeDateTime(startingIndex++);

                if (list == null)
                {
                    list = new List <Blog.Comment.Reply>();
                }

                list.Add(b);
            }
                                    );

            return(list);
        } // CommentReplySelectByBlogId
Ejemplo n.º 3
0
        } // CommentAdvancedSelectByBlogId -- in blogsapicontroller

        public static Blog.Comment.Reply CommentAdvancedSelectById(int commentAdvancedId)
        {
            Blog.Comment.Reply row = null;

            DataProvider.ExecuteCmd(GetConnection, "dbo.CommentAdvanced_SelectById"
                                    , inputParamMapper : delegate(SqlParameterCollection paramCollection)
            {
                paramCollection.AddWithValue("@ID", commentAdvancedId);
            }, map : delegate(IDataReader reader, short set)
            {
                Blog.Comment.Reply b = new Blog.Comment.Reply();
                int startingIndex    = 0;

                b.ID = reader.GetSafeInt32(startingIndex++);
                b.ParentCommentID = reader.GetSafeInt32(startingIndex++);
                b.UserName        = reader.GetSafeString(startingIndex++);
                b.Title           = reader.GetSafeString(startingIndex++);
                b.Content         = reader.GetSafeString(startingIndex++);
                b.DateCreated     = reader.GetSafeDateTime(startingIndex++);
                b.DateModified    = reader.GetSafeDateTime(startingIndex++);

                if (row == null)
                {
                    row = b;
                }
            }
                                    );

            return(row);
        } // CommentAdvancedSelectById