public IEnumerable <RecentActivityDto> GetAllRecentActivitys() { var allRecentActivity = _activityRepository.GetAll().OrderByDescending(n => n.StartTime).AsEnumerable(); //var allRecentActivity = _activityRepository.GetAll().OrderByDescending(n => n.IsTop).ThenByDescending(n => n.CreateTime).AsEnumerable(); return(QsMapper.CreateMapIEnume <RecentActivity, RecentActivityDto>(allRecentActivity)); }
public IEnumerable <MyMessageDto> GetAllMyMessages() { var allMyMessage = _myMessageRepository.GetAll().OrderByDescending(n => n.RecentTime).AsEnumerable(); //var allMyMessage = _myMessageRepository.GetAll().OrderByDescending(n => n.IsTop).ThenByDescending(n => n.CreateTime).AsEnumerable(); return(QsMapper.CreateMapIEnume <Core.Module.MyMessage, MyMessageDto>(allMyMessage)); }
public IEnumerable <VideoDto> GetVideosWithCategory(string category, int pageIndex, int pageCount, out int count) { var result = _videoRepository.GetPagedWithFilter(v => v.Category.Contains(category), pageIndex, pageCount, out count, v => v.CreateTime, false); return(QsMapper.CreateMapIEnume <Video, VideoDto>(result)); }
public IEnumerable <BookDto> GetHighGradeBooks(int num = 3) { var sql = String.Format("SELECT Top {0} * FROM Book ORDER BY Grade DESC", num); var results = _bookRepository.ExecuteQuery(sql); return(QsMapper.CreateMapIEnume <Book, BookDto>(results)); }
public IEnumerable <AtlasDto> GetRandomAtlases(int num = 8) { var sql = String.Format("SELECT TOP {0} * FROM Atlas ORDER BY NewID()", num); var results = _atlasRepository.ExecuteQuery(sql); return(QsMapper.CreateMapIEnume <Atlas, AtlasDto>(results)); }
public IEnumerable <SuggestionDto> GetAllSuggestions() { var allSuggestion = _suggestionRepository.GetAll().OrderByDescending(n => n.CreateTime).AsEnumerable(); //var allSuggestion = _suggestionRepository.GetAll().OrderByDescending(n => n.IsTop).ThenByDescending(n => n.CreateTime).AsEnumerable(); return(QsMapper.CreateMapIEnume <Suggestion, SuggestionDto>(allSuggestion)); }
public IEnumerable <BookDto> GetMostItemBooks(string field, int num = 5) { var sql = String.Format("SELECT Top {0} * FROM Book ORDER BY {1} DESC", num, field); var results = _bookRepository.ExecuteQuery(sql); return(QsMapper.CreateMapIEnume <Book, BookDto>(results)); }
public IEnumerable <ArticleDto> GetAllArticles() { var allArticle = _articleRepository.GetAll().OrderByDescending(n => n.CreateTime).AsEnumerable(); //var allArticle = _articleRepository.GetAll().OrderByDescending(n => n.IsTop).ThenByDescending(n => n.CreateTime).AsEnumerable(); return(QsMapper.CreateMapIEnume <Article, ArticleDto>(allArticle)); }
public IEnumerable <NewsDto> GetAllNews() { var allNews = _newsRepository.GetAll().OrderByDescending(n => n.CreateTime).AsEnumerable(); //var allNews = _newsRepository.GetAll().OrderByDescending(n => n.IsTop).ThenByDescending(n => n.CreateTime).AsEnumerable(); return(QsMapper.CreateMapIEnume <News, NewsDto>(allNews)); }
public IEnumerable <TagDto> GetAllTags() { var allTag = _tagRepository.GetAll().OrderByDescending(n => n.TagSum).AsEnumerable(); //var allTag = _tagRepository.GetAll().OrderByDescending(n => n.IsTop).ThenByDescending(n => n.CreateTime).AsEnumerable(); return(QsMapper.CreateMapIEnume <Core.Module.Tag, TagDto>(allTag)); }
public IEnumerable <BookDto> GetRandomBooks(int num = 6) { var sql = String.Format("SELECT TOP {0} * FROM Book ORDER BY NewID()", num); var results = _bookRepository.ExecuteQuery(sql); return(QsMapper.CreateMapIEnume <Book, BookDto>(results)); }
public ActionResult Index(int id = 1) { var cache = _newsService.GetAllNews(); var temp = QsMapper.CreateMapIEnume <NewsDto, NewsViewModel>(cache); var model = temp.ToPagedList(id, 8); return(View(model)); }
public ActionResult Index(int id = 1) { var cache = _articleService.GetAllArticles(); var temp = QsMapper.CreateMapIEnume <ArticleDto, ArticleViewModel>(cache); var model = temp.ToPagedList(id, 10); return(View(model)); }
public IEnumerable <VideoCommentDto> GetSecondsVideoComments(int number) { if (number <= 0) { number = 3; } var results = _videoRepository.GetPaged(0, number, com => com.CreateTime, false); return(QsMapper.CreateMapIEnume <VideoComment, VideoCommentDto>(results)); }
public IEnumerable <VideoDto> GetVideosWithCategory(string category, out int count, bool new2Old = true) { var result = _videoRepository.GetFiltered(v => v.Category.Contains(category), out count); if (new2Old) { result = result.OrderByDescending(v => v.CreateTime); } return(QsMapper.CreateMapIEnume <Video, VideoDto>(result)); }
public IEnumerable <ReservationDto> GetReservationsWithState(int state) { var temp = _repository.GetFiltered(ft => ft.State == state); if (temp == null) { return(null); } return(QsMapper.CreateMapIEnume <Reservation, ReservationDto>(temp)); }
public IEnumerable <ReservationDto> GetAllReservations() { var temp = _repository.GetAllWithOrder(filter => filter.Createtime); if (temp == null) { return(null); } return(QsMapper.CreateMapIEnume <Reservation, ReservationDto>(temp)); }
public IEnumerable <NewsDto> GetItemWithKeyword(string keyword) { if (String.IsNullOrEmpty(keyword)) { return(null); } var newsEnumrable = _newsRepository.GetFiltered(it => it.NewsTitle.Contains(keyword)); return(QsMapper.CreateMapIEnume <News, NewsDto>(newsEnumrable)); }
public IEnumerable <NewsDto> GetMostPopular(int number, bool onView = true) { if (number <= 0) { number = 3; } var results = _newsRepository.GetPaged(0, number, art => art.ViewTimes, false); return(QsMapper.CreateMapIEnume <News, NewsDto>(results)); }
public IEnumerable <ArticleDto> GetItemWithKeyword(string keyword) { if (String.IsNullOrEmpty(keyword)) { return(null); } //var articleEnumrable = _articleRepository.GetFiltered(it => it.ArticleTitle.Contains(keyword) || it.ArticleContent.Contains(keyword)); var articleEnumrable = _articleRepository.GetFiltered(it => it.ArticleTitle.Contains(keyword)); return(QsMapper.CreateMapIEnume <Article, ArticleDto>(articleEnumrable)); }
public IEnumerable <PhotoDto> GetPhotoPaged(int pageIndex, int pageCount, out int count) { if (pageCount <= 0 || pageIndex <= 0) { count = 0; return(null); } var photoEnumrable = _photoRepository.GetPaged <DateTime>(pageIndex, pageCount, out count, p => p.CreateTime, false); return(QsMapper.CreateMapIEnume <Photo, PhotoDto>(photoEnumrable)); }
public IEnumerable <TagDto> GetTagPaged(int pageIndex, int pageCount, out int count) { if (pageIndex <= 0 || pageCount <= 0) { count = 0; return(null); } var tagEnumrable = _tagRepository.GetPaged(pageIndex, pageCount, out count, n => n.TagSum, false); //var tagEnumrable = _tagRepository.GetPaged<Boolean, DateTime>(pageIndex, pageCount, n => n.IsTop, n => n.CreateTime, false, out count); return(QsMapper.CreateMapIEnume <Core.Module.Tag, TagDto>(tagEnumrable)); }
public IEnumerable <LoginLogDto> GetLoginLogPaged(int pageIndex, int pageCount, out int count) { if (pageCount <= 0 || pageIndex <= 0) { count = 0; return(null); } var loginLogEnumrable = _loginLogRepository.GetPaged(pageIndex, pageCount, out count, p => p.LoginTime, false); return(QsMapper.CreateMapIEnume <LoginLog, LoginLogDto>(loginLogEnumrable)); }
public IEnumerable <NewsDto> GetNewsPaged(int pageIndex, int pageCount, out int count) { if (pageIndex <= 0 || pageCount <= 0) { count = 0; return(null); } //var newsEnumrable = _newsRepository.GetPaged<Boolean, DateTime>(pageIndex, pageCount, n => n.IsTop, n => n.CreateTime, false, out count); var newsEnumrable = _newsRepository.GetPaged(pageIndex, pageCount, out count, n => n.CreateTime, false); return(QsMapper.CreateMapIEnume <News, NewsDto>(newsEnumrable)); }
public IEnumerable <RecentActivityDto> GetRecentActivityPaged(int pageIndex, int pageCount, out int count) { if (pageIndex <= 0 || pageCount <= 0) { count = 0; return(null); } var activityEnumrable = _activityRepository.GetPaged(pageIndex, pageCount, out count, n => n.StartTime, false); //var activityEnumrable = _activityRepository.GetPaged<Boolean, DateTime>(pageIndex, pageCount, n => n.IsTop, n => n.CreateTime, false, out count); return(QsMapper.CreateMapIEnume <RecentActivity, RecentActivityDto>(activityEnumrable)); }
public IEnumerable <SuggestionDto> GetSuggestionPaged(int pageIndex, int pageCount, out int count) { if (pageIndex <= 0 || pageCount <= 0) { count = 0; return(null); } var suggestionEnumrable = _suggestionRepository.GetPaged(pageIndex, pageCount, out count, n => n.CreateTime, false); //var suggestionEnumrable = _suggestionRepository.GetPaged<Boolean, DateTime>(pageIndex, pageCount, n => n.IsTop, n => n.CreateTime, false, out count); return(QsMapper.CreateMapIEnume <Suggestion, SuggestionDto>(suggestionEnumrable)); }
public IEnumerable <ArticleDto> GetArticlePaged(int pageIndex, int pageCount, out int count) { if (pageIndex <= 0 || pageCount <= 0) { count = 0; return(null); } var articleEnumrable = _articleRepository.GetPaged(pageIndex, pageCount, out count, n => n.CreateTime, false); //var articleEnumrable = _articleRepository.GetPaged<Boolean, DateTime>(pageIndex, pageCount, n => n.IsTop, n => n.CreateTime, false, out count); return(QsMapper.CreateMapIEnume <Article, ArticleDto>(articleEnumrable)); }
public IEnumerable <BookDto> GetBooksPaged(int pageIndex, int pageCount, out int count) { if (pageCount <= 0 || pageIndex <= 0) { count = 0; return(null); } var bookEnumrable = _bookRepository.GetPaged <DateTime>(pageIndex, pageCount, out count, p => p.CreateTime, false); return(QsMapper.CreateMapIEnume <Book, BookDto>(bookEnumrable)); }
public IEnumerable <AtlasDto> GetAtlasPaged(int pageIndex, int pageCount, out int count) { if (pageCount <= 0 || pageIndex <= 0) { count = 0; return(null); } var atlasEnumrable = _atlasRepository.GetPaged <DateTime>(pageIndex, pageCount, out count, p => p.CreateTime, false); return(QsMapper.CreateMapIEnume <Atlas, AtlasDto>(atlasEnumrable)); }
public IEnumerable <MyMessageDto> GetMyMessagePaged(int pageIndex, int pageCount, out int count) { if (pageIndex <= 0 || pageCount <= 0) { count = 0; return(null); } var myMessageEnumrable = _myMessageRepository.GetPaged(pageIndex, pageCount, out count, n => n.RecentTime, false); //var myMessageEnumrable = _myMessageRepository.GetPaged<Boolean, DateTime>(pageIndex, pageCount, n => n.IsTop, n => n.CreateTime, false, out count); return(QsMapper.CreateMapIEnume <Core.Module.MyMessage, MyMessageDto>(myMessageEnumrable)); }