public static StoryCollection GetStoriesByIsPublishedAndHostIDAndPublishedDate(int hostID, bool isPublished, DateTime startDate, DateTime endDate) { StoryCollection stories = new StoryCollection(); stories.Load(GetStoryQuery(hostID, isPublished, startDate, endDate).ExecuteReader()); return(stories); }
public static StoryCollection GetUserSubmittedStories(int userID, int hostID, int pageNumber, int pageSize) { StoryCollection stories = new StoryCollection(); stories.Load(SPs.Kick_GetPagedSubmittedStoriesByUserIDAndHostID(userID, hostID, pageNumber, pageSize).GetReader()); return(stories); }
public static StoryCollection GetUserTaggedStories(int?tagID, int userID, int hostID, int pageNumber, int pageSize) { StoryCollection stories = new StoryCollection(); if (tagID.HasValue) { stories.Load(SPs.Kick_GetPagedStoriesByTagIDAndHostIDAndUserID(tagID, hostID, userID, pageNumber, pageSize).GetReader()); } return(stories); }
public static StoryCollection GetStoriesByCategoryKickedStateAndHostID(short categoryID, bool isPublished, int hostID, int pageIndex, int pageSize) { Query query = GetStoryQuery(hostID, isPublished, categoryID); query = query.ORDER_BY(Story.Columns.PublishedOn, "DESC"); query.PageIndex = pageIndex; query.PageSize = pageSize; StoryCollection stories = new StoryCollection(); stories.Load(query.ExecuteReader()); return(stories); }
public static StoryCollection GetPopularStories(int hostID, bool isPublished, StoryListSortBy sortBy, int pageIndex, int pageSize) { Query query = GetStoryQuery(hostID, isPublished, GetStartDate(sortBy), DateTime.Now); query = query.ORDER_BY(Story.Columns.KickCount, "DESC"); query.PageIndex = pageIndex; query.PageSize = pageSize; StoryCollection stories = new StoryCollection(); stories.Load(query.ExecuteReader()); return(stories); }
public static Story FetchStoryByParameter(string columnName, object value) { //NOTE: GJ: maybe we should add support for this in SubSonic? (like rails does) StoryCollection t = new StoryCollection(); t.Load(Story.FetchByParameter(columnName, value)); if (t.Count == 0) { return(null); } else { return(t[0]); } }