Ejemplo n.º 1
0
        public async Task <LstNewsModel> GetListContentNewsisHome(int pageSize, int pageIndex)
        {
            var lstNews = new LstNewsModel();
            var listTransactionHistory = await _newsManager.GetListContentNewsisHome(pageSize, pageIndex);

            // var allTransactionHistory = await _newsManager.GetTotalContentNews(status);
            lstNews.LstNews = _mapper.Map <List <ContentNews>, List <ContentNewsModel> >(listTransactionHistory);
            // lstNews.TotalCount = allTransactionHistory;
            return(lstNews);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> ListNews()
        {
            try
            {
                //if (!_userService.IsSignedIn(User))
                //{
                //    return RedirectToAction(nameof(HomeController.Index), "Home");
                //}
                //get contact from db
                LstNewsModel model = new LstNewsModel();
                model = await _newsService.GetListContentNewsPaging(10, 1, 1);


                return(View(model));
                // return View("~/Views/Support/Contact.cshtml", contact);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }