Exemplo n.º 1
0
        public async Task <ActionResult> Disclosure(int lastPage = -1)
        {
            var news = await _investagramsApi.GetDisclosureNews(lastPage);

            var watchList = _watchListService.GetAllWatchList();

            var viewModels = NewsHelper.GetNewsViewModels(news, watchList);

            return(View(viewModels));
        }
Exemplo n.º 2
0
        public async Task <PartialViewResult> News()
        {
            var news      = new List <News>();
            var stockNews = await _investagramsApiService.GetNewsByStockId(-1);

            var disclosureNews = await _investagramsApiService.GetDisclosureNews();

            news.AddRange(stockNews);
            news.AddRange(disclosureNews);
            var watchList = _watchListService.GetAllWatchList();

            var viewModels = NewsHelper.GetNewsViewModels(news, watchList);

            return(PartialView("_News", viewModels));
        }
        public ActionResult Index(int id = 0)
        {
            var watchList = _watchListService.GetAllWatchList();

            if (watchList.Any(x => x.WatchListGroupId == 0))
            {
                watchList.Remove(watchList.First());
            }

            watchList.Insert(0, new WatchListGroup
            {
                GroupName        = "All",
                WatchListGroupId = 0,
                WatchLists       = watchList.SelectMany(x => x.WatchLists).ToList()
            });

            var viewModel = new WatchlistViewModel
            {
                WatchListGroups = watchList,
                SelectedId      = id
            };

            return(View(viewModel));
        }