示例#1
0
        public ActionResult GetAnswerNews(
            int pageNumber = 1,
            int pageSize   = DefualtPageSize)
        {
            var news = Service.GetAnswerNews(CurrentUser.Id, pageNumber, pageSize);
            var page = PageDataMapper.Map(news, AnswerNewsMapper.Map);

            page.UrlFormat = "#/NewAnswers?";
            return(View("AnswerNewsPageView", page));
        }
示例#2
0
        private PageDataViewModel <QuestionViewModel> LoadUserQuestions(
            int userId,
            int pageNumber,
            int pageSize)
        {
            var questions = Service.GetUserQuestions(userId, pageNumber, pageSize);
            var page      = PageDataMapper.Map(questions, QuestionMapper.Map);

            page.UrlFormat = "#/GetUserQuestionsPage?";
            return(page);
        }
示例#3
0
        private PageDataViewModel <ArticleViewModel> LoadUserArticles(
            int userId,
            int pageNumber,
            int pageSize)
        {
            var articles = Service.GetUserArticles(userId, pageNumber, pageSize);
            var page     = PageDataMapper.Map(articles, ArticleMapper.Map);

            page.UrlFormat = "#/GetUserArticlesPage?";
            return(page);
        }
示例#4
0
        private PageDataViewModel <AnswerViewModel> LoadQuestionAnswers(
            int questionId,
            int pageNumber,
            int pageSize)
        {
            var answers = Service.GetQuestionAnswers(questionId, pageNumber, pageSize);
            var page    = PageDataMapper.Map(answers, AnswerMapper.Map);

            page.UrlFormat = String.Format("#/GetQuestionAnswers?questionId={0}&", questionId);
            return(page);
        }
示例#5
0
        private PageDataViewModel <AnswerViewModel> LoadUserAnswers(
            int userId,
            int pageNumber,
            int pageSize)
        {
            var answers = Service.GetUserAnswers(userId, pageNumber, pageSize);
            var page    = PageDataMapper.Map(answers, SingleAnswerMapper.Map);

            page.UrlFormat = "#/GetUserAnswers?";
            return(page);
        }
示例#6
0
        private PageDataViewModel <CommentViewModel> LoadArticleComments(
            int articleId,
            int pageNumber,
            int pageSize)
        {
            var comments = Service.GetArticleComments(articleId, pageNumber, pageSize);
            var page     = PageDataMapper.Map(comments, CommentMapper.Map);

            page.UrlFormat = String.Format("#/GetArticleComments?articleId={0}&", articleId);
            return(page);
        }
示例#7
0
        // TODO: Refactor to avoid copy paste
        private PageDataViewModel <NoteViewModel> LoadUserNotes(
            int userId,
            int pageNumber,
            int pageSize)
        {
            var notes = Service.GetUserNotes(userId, pageNumber, pageSize);
            var page  = PageDataMapper.Map(notes, NoteMapper.Map);

            page.UrlFormat = "#/GetUserNotes?";
            return(page);
        }
示例#8
0
        private PageDataViewModel <CommentViewModel> LoadUserComments(
            int userId,
            int pageNumber,
            int pageSize)
        {
            var comments = Service.GetUserComments(userId, pageNumber, pageSize);
            var page     = PageDataMapper.Map(comments, SingleCommentMapper.Map);

            page.AreaId    = "userComments";
            page.UrlFormat = "#/GetUserComments?";
            return(page);
        }