public ActionResult TradingSystemOrder(int id)
        {
            var currentUser = _usersService.GetUserByLogin(HttpContext.User.Identity.Name);
            var tSystem = _tradingSystemService.GetSystemById(id);
            var activatedAccounts = _accountsService.GetAccountsByUserId(currentUser.Id).Where(x => x.Status.Id == 2).ToList();

            ViewBag.Error = false;

            if (tSystem == null)
            {
                ViewBag.Error = true;
                return this.View();
            }

            if (!activatedAccounts.Any())
            {
                ViewBag.NoActivatedAccounts = true;
            }

            ViewBag.SystemName = tSystem.Name;
            this.PrepareNotificationsForView();

            var model = new TradingSystemOrderPoco
                {
                    TradingSystemId = id,
                    Accounts = new SelectList(activatedAccounts, "Id", "AccountNumber")
                };

            return this.View(model);
        }
        public ActionResult OrderFinish(TradingSystemOrderPoco model)
        {
            if (ModelState.IsValid)
            {
                var currentUser = _usersService.GetUserByLogin(HttpContext.User.Identity.Name);
                var account = _accountsService.GetById(model.AccountId);

                if (account.UserId != currentUser.Id)
                {
                    return this.View("TradingSystemOrder");
                }

                var tradingSystemEntity = new TradingSystems
                    {
                        AccountId = model.AccountId,
                        UserId = currentUser.Id,
                        CreateDate = DateTime.Now,
                        StatusId = 1,
                        SystemId = model.TradingSystemId,
                        IsDeleted = false,
                        IsNew = false
                    };
                _tradingSystemService.Add(tradingSystemEntity);

                // Заявка
                var applicationEntity = new TradingSystemPool
                    {
                        AccountId = model.AccountId,
                        UserId = currentUser.Id,
                        ApplicationDate = DateTime.Now,
                        TradingSystemId = tradingSystemEntity.Id
                    };
                _tradingSystemService.AddToPool(applicationEntity);

                return RedirectToAction("OrderStatus");
            }

            return this.View("TradingSystemOrder");
        }