コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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));
        }
コード例 #5
0
        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));
        }
コード例 #6
0
        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));
        }
コード例 #7
0
        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));
        }
コード例 #8
0
        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));
        }
コード例 #9
0
        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));
        }
コード例 #10
0
        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));
        }
コード例 #11
0
        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));
        }
コード例 #12
0
        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));
        }
コード例 #13
0
        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));
        }
コード例 #14
0
        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));
        }
コード例 #15
0
        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));
        }
コード例 #16
0
        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));
        }
コード例 #17
0
        public IEnumerable <ReservationDto> GetAllReservations()
        {
            var temp = _repository.GetAllWithOrder(filter => filter.Createtime);

            if (temp == null)
            {
                return(null);
            }
            return(QsMapper.CreateMapIEnume <Reservation, ReservationDto>(temp));
        }
コード例 #18
0
        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));
        }
コード例 #19
0
        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));
        }
コード例 #20
0
        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));
        }
コード例 #21
0
        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));
        }
コード例 #22
0
        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));
        }
コード例 #23
0
        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));
        }
コード例 #24
0
        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));
        }
コード例 #25
0
        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));
        }
コード例 #26
0
        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));
        }
コード例 #27
0
        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));
        }
コード例 #28
0
        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));
        }
コード例 #29
0
        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));
        }
コード例 #30
0
        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));
        }