Exemplo n.º 1
0
        public async Task <IActionResult> Index()
        {
            // TODO: Get user information
            int totalNumberOfItems = await _chatMessageService.Count(x => !x.Deleted);

            PageInformation           pageInformation           = new PageInformation(0, totalNumberOfItems, WebConstants.MAX_NUMBER_OF_CHAT_MESSAGES_PER_PAGE);
            TechnicalSupportViewModel technicalSupportViewModel = new TechnicalSupportViewModel(pageInformation)
            {
                ChatMessages = _mapper.Map <List <ChatMessageDTO>, List <ChatMessageViewModel> >(await _chatMessageService.GetWithDetails(0, WebConstants.MAX_NUMBER_OF_CHAT_MESSAGES_PER_PAGE))
            };

            return(View(technicalSupportViewModel));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> RedirectToChat(int pageNumber, HttpReponseStatusCode statusCode = HttpReponseStatusCode.NoStatus)
        {
            int totalNumberOfItems = await _chatMessageService.Count(x => !x.Deleted);

            PageInformation           pageInformation           = new PageInformation(pageNumber, totalNumberOfItems, WebConstants.MAX_NUMBER_OF_CHAT_MESSAGES_PER_PAGE);
            TechnicalSupportViewModel technicalSupportViewModel = new TechnicalSupportViewModel(pageInformation)
            {
                ChatMessages = _mapper.Map <List <ChatMessageDTO>, List <ChatMessageViewModel> >
                                   (await _chatMessageService.GetWithDetails(pageNumber * WebConstants.MAX_NUMBER_OF_CHAT_MESSAGES_PER_PAGE, WebConstants.MAX_NUMBER_OF_CHAT_MESSAGES_PER_PAGE))
            };

            ViewBag.InfoMessage = new InfoMessage(_stringLocalizer, statusCode);
            return(View("Index", technicalSupportViewModel));
        }