Exemplo n.º 1
0
        public ActionResult Editstrategypage(EdiStrategyViewModel model)
        {
            Strategy strategy = _strategiesService.GetStrategy(model.ID);

            strategy.Name        = model.SimpleStrategyName;
            strategy.Description = model.SimpleStrategyDescription;
            _strategyStore.Update(strategy);

            return(Ok(strategy));
        }
Exemplo n.º 2
0
        public IActionResult Editstrategypage(Guid id)
        {
            var userId      = User.FindFirst(System.Security.Claims.ClaimTypes.NameIdentifier).Value;
            var currentUser = _traderStore.GetAll().FirstOrDefault(u => u.TraderId == Guid.Parse(userId));

            var strategy = _strategiesService.GetStrategy(id);

            ViewBag.id = id;

            if (strategy == null)
            {
            }
            EdiStrategyViewModel editStrategy = new EdiStrategyViewModel()
            {
                ID = strategy.StrategyID,
                SimpleStrategyName        = strategy.Name,
                SimpleStrategyDescription = strategy.Description,
                TraderID = currentUser.TraderId
            };

            return(View(editStrategy));
        }