Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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]);
            }
        }