예제 #1
0
        public async Task <IActionResult> DeleteAsync(int id)
        {
            Domain.Answers.Hub answerHub = new Domain.Answers.Hub();
            var r = await answerHub.DeleteAsync(id);

            return(Pack(r));
        }
예제 #2
0
        public async Task <IActionResult> GetAnswersList(int questionId, int index, int size)
        {
            Domain.Paginator pager = Domain.Paginator.New(index, size);

            Domain.Answers.Hub answerHub = new Domain.Answers.Hub();
            var r = await answerHub.GetAnswersAsync(pager, questionId);

            return(Pack(r));
        }
예제 #3
0
        public async Task <IActionResult> GetDisabledListAsync(int index, int size, string questionTitle, int state)
        {
            Domain.Paginator pager = Domain.Paginator.New(index, size);
            pager["questionTitle"] = questionTitle;

            Domain.Answers.Hub answerHub = new Domain.Answers.Hub();
            var r = await answerHub.GetAnswersList(pager, (Domain.Answers.Answer.AnswerState) state);

            return(Pack(r));
        }
예제 #4
0
        public async Task <IActionResult> GetAnswersListAsync(int userId, int index, int size, string questionTitle)
        {
            Paginator pager = Paginator.New(index, size, 2);

            pager["userId"]        = userId.ToString();
            pager["currentUserId"] = CurrentUser.Id.ToString();
            pager["questionTitle"] = questionTitle;

            Domain.Answers.Hub answerHub = new Domain.Answers.Hub();

            var r = await answerHub.GetAnswerFormUserPageAsync(pager);

            return(Pack(r));
        }