Esempio n. 1
0
        public ActionResult FAQ(int id)
        {
            string         filter = "q.ID = " + id;
            MdQnAViewModel qna    = new MdQnAViewModel();

            qna = _moduleSearchEngineService.GetListMdQnA(filter, "", 1, 1, null).ToList().FirstOrDefault();
            return(View(qna));
        }
Esempio n. 2
0
 public HttpResponseMessage GetListQuestionAnswer(HttpRequestMessage request, int page, int pageSize, string botId)
 {
     return(CreateHttpResponse(request, () =>
     {
         HttpResponseMessage response = null;
         int totalRow = 0;
         string filter = "q.BotID = " + botId;
         var lstSearchQna = _moduleSearchEngineService.GetListMdQnA(filter, "", page, pageSize, null).ToList();
         if (lstSearchQna.Count() != 0)
         {
             totalRow = lstSearchQna[0].Total;
         }
         var paginationSet = new PaginationSet <MdQnAViewModel>()
         {
             Items = lstSearchQna,
             Page = page,
             TotalCount = totalRow,
             MaxPage = pageSize,
             TotalPages = (int)Math.Ceiling((decimal)totalRow / pageSize)
         };
         response = request.CreateResponse(HttpStatusCode.OK, paginationSet);
         return response;
     }));
 }