示例#1
0
        public ActionResult Create(TickerViewModel viewModel)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
示例#2
0
        private Invest.Web.Models.TickerViewModel ConvertToViewModel(Invest.BusinessLogic.Service.Contract.Dto.TickerDto ticker)
        {
            var tickerModel = new Invest.Web.Models.TickerViewModel();

            tickerModel.Active = ticker.Active;
            tickerModel.BCFirstDate = ticker.BCFirstDate;
            tickerModel.BH = ticker.BH;
            // public System.Data.Objects.DataClasses.EntityCollection<Buy> Buys { get; set; }
            tickerModel.CBSFirstDate = ticker.CBSFirstDate;
            tickerModel.Comments = ticker.Comments;
            tickerModel.component = ticker.component;
            tickerModel.current = ticker.current;
            tickerModel.DateAdded = ticker.DateAdded;
            tickerModel.DateModified = ticker.DateModified;
            tickerModel.endDate = ticker.endDate;
            tickerModel.FirstBuy = ticker.FirstBuy;
            tickerModel.Id = ticker.Id;
            tickerModel.InceptionDate = ticker.InceptionDate;
            tickerModel.LastSell = ticker.LastSell;
            tickerModel.MCFirstDate = ticker.MCFirstDate;
            tickerModel.Name = ticker.Name;
            tickerModel.priceDecimal = ticker.priceDecimal;
            // public System.Data.Objects.DataClasses.EntityCollection<Sell> Sells { get; set; }
            tickerModel.shareDecimal = ticker.shareDecimal;
            tickerModel.startDate = ticker.startDate;
            tickerModel.Symbol = ticker.Symbol;
            tickerModel.TickerBC = ticker.TickerBC;
            tickerModel.TickerBH = ticker.TickerBH;
            tickerModel.tickerGUID = ticker.tickerGUID;
            tickerModel.TickerYahoo = ticker.TickerYahoo;
            tickerModel.Type = ticker.Type ?? "";

            return tickerModel;
        }
示例#3
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);
        }
示例#4
0
        public ActionResult Edit(TickerViewModel viewModel)
        {
            try
            {
                var tickerDto = ConvertToDto(viewModel);

                var success = _tickerService.SaveTicker(tickerDto);

                return RedirectToAction("Index");
            }
            catch
            {
                return View(viewModel);
            }
        }
示例#5
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);
        }