Example #1
0
        public async Task <IActionResult> Index()
        {
            var slides = await _slideApiClient.GetAllWithoutPaging();

            var listLastestNew = await _newApiClient.GetLastestNew();

            var listMostViewNew = await _newApiClient.GetMostViewNew();

            var listKHCNNewInIndex = await _newApiClient.GetKHCNNewInIndex();

            var listTuyenSinhNewInIndex = await _newApiClient.GetTuyenSinhViewInIndex();

            var homeViewModel = new HomeViewModel();

            homeViewModel.SlideViewModels      = slides.ResultObj;
            homeViewModel.LastestNews          = listLastestNew.ResultObj;
            homeViewModel.MostViewNews         = listMostViewNew.ResultObj;
            homeViewModel.KHCNNewInInDex       = listKHCNNewInIndex.ResultObj;
            homeViewModel.TuyenSinhNewInIndexs = listTuyenSinhNewInIndex.ResultObj;
            return(View(homeViewModel));
        }
Example #2
0
        public async Task <IActionResult> Index(int NewID)
        {
            var result = await _newApiClient.DetailNew(NewID);

            var listMostViewNew = await _newApiClient.GetMostViewNew();

            var detailNewVM = new DetailNewViewModel()
            {
                NewID           = NewID,
                NewDatePost     = result.ResultObj.NewDatePost,
                NewName         = result.ResultObj.NewName,
                NewContent      = result.ResultObj.NewContent,
                ImagePath       = result.ResultObj.ImagePath,
                NewCatetoryID   = result.ResultObj.NewCatetoryID,
                NewCatetoryName = result.ResultObj.NewCatetoryName,
                ListMostViewNew = listMostViewNew.ResultObj
            };
            var listRelatedNew = await _newApiClient.GetRelatedNew(detailNewVM.NewCatetoryID);

            detailNewVM.ListRelatedNew = listRelatedNew.ResultObj;
            return(View(detailNewVM));
        }