Пример #1
0
        public ActionResult Index()
        {
            var viewModel = new IndexNewsViewModel()
            {
                News = this.news.GetAll().To <NewsViewModel>().ToList()
            };

            return(this.View(viewModel));
        }
Пример #2
0
        public async Task <IndexNewsViewModel> GetHotStocksForFeeding(int newsCount)
        {
            var result   = new IndexNewsViewModel();
            var newsList = await GetHotStocks(newsCount).ToListAsync();

            result.News = MapFinwireNewToViewModel(newsList);

            return(result);
        }
Пример #3
0
        public ActionResult Index()
        {
            var viewModel = new IndexNewsViewModel()
            {
                News = this.news.GetAll().To<NewsViewModel>().ToList()
            };

            return this.View(viewModel);
        }
Пример #4
0
        public async Task <IndexNewsViewModel> GetMainNewsForFeeding(int newsCount)
        {
            var result   = new IndexNewsViewModel();
            var newsList = await GetNewsForFeedingWithPrio(newsCount);

            result.News = MapFinwireNewToViewModel(newsList);
            var first = result.News.FirstOrDefault();

            if (first?.IsFinwireNews ?? false)
            {
                first.IsTopFinwireNews = true;
            }

            return(result);
        }
Пример #5
0
 public ActionResult CreateNews(IndexNewsViewModel model)
 {
     this.news.CreateNews(this.Mapper.Map <News>(model.InputModel));
     return(this.RedirectToAction("Index"));
 }
Пример #6
0
        public async Task <IActionResult> Index()
        {
            var indexViewModel = new IndexNewsViewModel(await _newsRepository.GetSliderNewsAsync(), await _newsRepository.GetLatestNewsAsync());

            return(View(indexViewModel));
        }
Пример #7
0
 public ActionResult CreateNews(IndexNewsViewModel model)
 {
     this.news.CreateNews(this.Mapper.Map<News>(model.InputModel));
     return this.RedirectToAction("Index");
 }