public void FeedSearchList(string filter, int page, int defaultPageSize , FeedSearchListHeadFootTemplate head , FeedSearchListHeadFootTemplate foot , FeedSearchListItemTemplate item) { FeedSearchFilter feedSearchFilter = FeedSearchFilter.GetFromFilter(filter); int totalCount; FeedCollection feeds = new FeedCollection(); //int pageSize; FeedSearchFilter tempFilter; if (feedSearchFilter.IsNull) { tempFilter = new FeedSearchFilter(); tempFilter.PageSize = defaultPageSize; tempFilter.Order = FeedSearchFilter.OrderBy.ID; tempFilter.IsDesc = true; } else { tempFilter = feedSearchFilter; } feeds = FeedBO.Instance.SearchFeeds(page, tempFilter, out totalCount); head(feedSearchFilter, totalCount > 0, totalCount, tempFilter.PageSize); int loginUserID = UserBO.Instance.GetCurrentUserID(); int i = 0; float timeDiffrence = UserBO.Instance.GetUserTimeDiffrence(User.Current); foreach (Feed feed in feeds) { string title = FeedBO.Instance.FormatFeedTitle(loginUserID, timeDiffrence, FeedType.AllUserFeed, feed); string description = FeedBO.Instance.FormatFeedDescription(loginUserID, feed); item(i++, feed, title, description, true); } foot(feedSearchFilter, totalCount > 0, totalCount, tempFilter.PageSize); }
public void FeedSearchList(string filter, int page, int defaultPageSize , FeedSearchListHeadFootTemplate head , FeedSearchListHeadFootTemplate foot , FeedSearchListItemTemplate item) { FeedSearchFilter feedSearchFilter = FeedSearchFilter.GetFromFilter(filter); int totalCount; FeedCollection feeds = new FeedCollection(); //int pageSize; FeedSearchFilter tempFilter; if (feedSearchFilter.IsNull) { tempFilter = new FeedSearchFilter(); tempFilter.PageSize = defaultPageSize; tempFilter.Order = FeedSearchFilter.OrderBy.ID; tempFilter.IsDesc = true; } else tempFilter = feedSearchFilter; feeds = FeedBO.Instance.SearchFeeds(page, tempFilter, out totalCount); head(feedSearchFilter, totalCount > 0, totalCount, tempFilter.PageSize); int loginUserID = UserBO.Instance.GetCurrentUserID(); int i = 0; float timeDiffrence = UserBO.Instance.GetUserTimeDiffrence(User.Current); foreach (Feed feed in feeds) { string title = FeedBO.Instance.FormatFeedTitle(loginUserID, timeDiffrence, FeedType.AllUserFeed, feed); string description = FeedBO.Instance.FormatFeedDescription(loginUserID, feed); item(i++, feed, title, description, true); } foot(feedSearchFilter, totalCount > 0, totalCount, tempFilter.PageSize); }