public HttpResponseMessage GetAllByBotID(HttpRequestMessage request, int botId)
 {
     return(CreateHttpResponse(request, () =>
     {
         HttpResponseMessage response = null;
         var lstGroupCard = _groupCardService.GetListGroupCardByBotID(botId);
         var lstGroupCardVm = Mapper.Map <IEnumerable <GroupCard>, IEnumerable <GroupCardViewModel> >(lstGroupCard);
         if (lstGroupCardVm != null && lstGroupCardVm.Count() != 0)
         {
             foreach (var item in lstGroupCardVm)
             {
                 var lstCard = _cardService.GetListCardByGroupCardID(item.ID).ToList();
                 item.Cards = Mapper.Map <IEnumerable <Card>, IEnumerable <CardViewModel> >(lstCard);
             }
         }
         response = request.CreateResponse(HttpStatusCode.OK, lstGroupCardVm);
         return response;
     }));
 }
        public ActionResult QnA(int formQnAId, int botId, string botName)
        {
            if (String.IsNullOrEmpty(botName))
            {
                return(RedirectToAction("Index", "Dashboard"));
            }
            var formQnA        = _qnaService.GetFormQnAnswerById(formQnAId);
            var formQnAVm      = Mapper.Map <FormQuestionAnswer, FormQuestionAnswerViewModel>(formQnA);
            var lstGroupCard   = _groupCardService.GetListGroupCardByBotID(botId);
            var lstGroupCardVm = Mapper.Map <IEnumerable <GroupCard>, IEnumerable <GroupCardViewModel> >(lstGroupCard);

            if (lstGroupCardVm != null && lstGroupCardVm.Count() != 0)
            {
                foreach (var item in lstGroupCardVm)
                {
                    var lstCard = _cardService.GetListCardByGroupCardID(item.ID).ToList();
                    item.Cards = Mapper.Map <IEnumerable <Card>, IEnumerable <CardViewModel> >(lstCard);
                }
            }
            ViewBag.BotQnAnswerID = formQnAId;
            ViewBag.BotName       = botName;
            ViewBag.Cards         = lstGroupCardVm;
            return(View(formQnAVm));
        }