Ejemplo n.º 1
0
        public ActionResult Tickers()
        {
            var context = new InvestContext();
            var query = context.Quest401KTransactions.Select(p => new { p.Ticker, p.Trantype }).Distinct().ToList();

            var tickersViewModel = new TickersViewModel { Tickers = new List<TickerViewModel>() };
            foreach (var _ticker in query)
            {
                var ticker = new TickerViewModel();
                ticker.Symbol  =  _ticker.Ticker;
                ticker.Name = _ticker.Trantype;

                tickersViewModel.Tickers.Add(ticker);
            }

            return View(tickersViewModel);
        }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            var tickersViewModel = new TickersViewModel();
            var tickerViewModels = new List<TickerViewModel>();

            var tickers = _tickerService.GetAllTickers();
            foreach (var ticker in tickers)
            {
                var tickerViewModel = ConvertToViewModel(ticker);
                tickerViewModels.Add(tickerViewModel);
            }
            tickersViewModel.Tickers = tickerViewModels;
            return View(tickersViewModel);
        }
Ejemplo n.º 3
0
        public ActionResult Tickers(int id)
        {
            var tickers = _tickerService.GetTickersByAccount(id);
            // var nav = _navService.GetTicker(id);
            var viewModel = new TickersViewModel
            {
                Tickers = new List<TickerViewModel>()
            };
            foreach (var ticker in tickers)
            {
                var TickerViewModel = new TickerViewModel();
                TickerViewModel.Symbol = ticker.Symbol;
                TickerViewModel.Name = ticker.Name;
                TickerViewModel.Id = ticker.Id;
                TickerViewModel.Type = ticker.Type;

                viewModel.Tickers.Add(TickerViewModel);
            }
            return View(viewModel);
        }