/// <summary> /// Loads and returns a record list of all AutocompletePhrase objects. /// Parameters: itemsPerPage = max records to fetch; pageNum = one based page number if multiple pages (otherwise itemsPerPage is effectively TOP) /// eg LoadActive() = returns all records; LoadActive(10) = returns top 10 records by default sort order; LoadActive(10, 2) = returns second page of 10 records by default sort order /// ("Default sort order" can be defined for each record type by overriding in the partial model file. By default it looks for fields: SortPosition,SortOrder,Position, DateAdded,CreateDate,DateCreated and AutocompletePhraseID desc.) /// </summary> public static AutocompletePhraseList LoadAll() { var result = new AutocompletePhraseList(); result.LoadRecords(null); return(result); }
/// <summary> /// Returns a record list of AutocompletePhrase objects, given a SQL statement. /// </summary> /// <param name="sql">A SQL statement constructed using the Beweb.Sql class</param> /// <returns>A list of AutocompletePhrase records.</returns> public static AutocompletePhraseList Load(Sql sql) { var result = new AutocompletePhraseList(); result.LoadRecords(sql); return(result); }
/// <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 AutocompletePhraseList LoadActivePlusExisting(object existingRecordID) { var result = new AutocompletePhraseList(); var sql = (new AutocompletePhrase()).GetSqlWhereActivePlusExisting(existingRecordID); result.LoadRecords(sql); return(result); }
/// <summary> /// Loads and returns a record list of all the "active" AutocompletePhrase 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 AutocompletePhraseList LoadActive() { var result = new AutocompletePhraseList(); var sql = (new AutocompletePhrase()).GetSqlWhereActive(); result.LoadRecords(sql); return(result); }
public static AutocompletePhraseList LoadIDs(string[] ids, bool useDefaultOrderBy) { var sql = new Sql("where AutocompletePhraseID in (", ids.SqlizeNumberList(), ")"); var result = new AutocompletePhraseList(); result.LoadRecords(sql, useDefaultOrderBy); return(result); }
public static AutocompletePhraseList LoadActive(int itemsPerPage, int pageNum) { var result = new AutocompletePhraseList(); var sql = (new AutocompletePhrase()).GetSqlWhereActive(); sql.Paging(itemsPerPage, pageNum); result.LoadRecords(sql); return(result); }
public static AutocompletePhraseList LoadAll(int itemsPerPage, int pageNum) { var result = new AutocompletePhraseList(); var sql = new Sql("where 1=1"); sql.Paging(itemsPerPage, pageNum); result.LoadRecords(sql); return(result); }