public ActionResult AccountsDeposeted(AccountDeposeted model)
 {
     if (!ModelState.IsValid)
     {
         return(View(model));
     }
     _accountService.Deposet(model.accountId, model.ammount);
     return(RedirectToAction("CustomerAccounts", new { customerId = model.customerId }));
 }
        public ActionResult AccountsDeposeted(int accountId, int customerId)
        {
            if (!_customerService.CustomerExist(customerId))
            {
                return(RedirectToAction("CustomerAccounts", new { customerId = customerId }));
            }
            var accounts = _accountService.GetAccountsForACustomer(customerId);
            var account  = accounts.SingleOrDefault(x => x.Id == accountId);

            if (account == null)
            {
                return(RedirectToAction("CustomerAccounts", new { customerId = customerId }));
            }
            var model = new AccountDeposeted()
            {
                customerId  = customerId,
                accountId   = account.Id,
                accountName = account.Name
            };

            return(View(model));
        }