예제 #1
0
        /// <summary>
        /// Loads all records which are active plus the one with the given ID. For situations where you want to only show active records except you also want to include the record that is already current.
        /// </summary>
        public static BlogCommentList LoadActivePlusExisting(object existingRecordID)
        {
            var result = new BlogCommentList();
            var sql    = (new BlogComment()).GetSqlWhereActivePlusExisting(existingRecordID);

            result.LoadRecords(sql);
            return(result);
        }
예제 #2
0
        /// <summary>
        /// Loads and returns a record list of all the "active" BlogComment objects.
        /// Parameters: itemsPerPage = max records to fetch; pageNum = one based page number if multiple pages (otherwise itemsPerPage is effectively TOP)
        /// eg LoadActive() = returns all active records; LoadActive(10) = returns top 10 active records by default sort order; LoadActive(10, 2) = returns second page of 10 active records by default sort order
        /// ("Active" can be defined for each record type by overriding in the partial model file. By default it looks for fields: PublishDate/ExpiryDate, IsActive,IsEnabled,IsPublished,Active,Enabled,Published,IsVisible,Visible.)
        /// </summary>
        public static BlogCommentList LoadActive()
        {
            var result = new BlogCommentList();
            var sql    = (new BlogComment()).GetSqlWhereActive();

            result.LoadRecords(sql);
            return(result);
        }
예제 #3
0
        public static BlogCommentList LoadIDs(string[] ids, bool useDefaultOrderBy)
        {
            var sql    = new Sql("where BlogCommentID in (", ids.SqlizeNumberList(), ")");
            var result = new BlogCommentList();

            result.LoadRecords(sql, useDefaultOrderBy);
            return(result);
        }
예제 #4
0
        public static BlogCommentList LoadActive(int itemsPerPage, int pageNum)
        {
            var result = new BlogCommentList();
            var sql    = (new BlogComment()).GetSqlWhereActive();

            sql.Paging(itemsPerPage, pageNum);
            result.LoadRecords(sql);
            return(result);
        }
예제 #5
0
        public static BlogCommentList LoadAll(int itemsPerPage, int pageNum)
        {
            var result = new BlogCommentList();
            var sql    = new Sql("where 1=1");

            sql.Paging(itemsPerPage, pageNum);
            result.LoadRecords(sql);
            return(result);
        }