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");
        }
 public void AddToPool(TradingSystemPool entity)
 {
     db.TradingSystemPool.Add(entity);
     db.SaveChanges();
 }