diff --git a/Bank/BankDatabaseImplement/Implements/AccountStorage.cs b/Bank/BankDatabaseImplement/Implements/AccountStorage.cs index 49e463a..1dd6224 100644 --- a/Bank/BankDatabaseImplement/Implements/AccountStorage.cs +++ b/Bank/BankDatabaseImplement/Implements/AccountStorage.cs @@ -117,18 +117,18 @@ namespace BankDatabaseImplement.Implements using var context = new BankDatabase(); return context.Accounts .Where(a => model.SelectedAccountIds == null || model.SelectedAccountIds.Contains(a.Id)) - .Select(a => new ReportRequestsViewModel() + .Select(account => new ReportRequestsViewModel() { - AccountNumber = a.Number, - Requests = context.Requests - .Include(x => x.Withdrawal) - .ThenInclude(x => x.Accounts) - .Where(x => x.Withdrawal != null && x.Withdrawal.Accounts - .Select(x => x.AccountId) - .ToList() - .Contains(a.Id)) - .Select (r => r.GetViewModel) - .ToList() + AccountNumber = account.Number, + Requests = context.AccountWithdrawals + .Include(x => x.Withdrawal) + .ThenInclude(x => x.Request) + .Where(x => x.AccountId == account.Id) + .Select(x => x.Withdrawal) + .Where(x => x.RequestId != null) + .Select(x => x.Request) + .Select(r => r.GetViewModel) + .ToList(), }) .ToList(); } diff --git a/Bank/BankManagersClientApp/Controllers/HomeController.cs b/Bank/BankManagersClientApp/Controllers/HomeController.cs index 430e2bd..3ed634c 100644 --- a/Bank/BankManagersClientApp/Controllers/HomeController.cs +++ b/Bank/BankManagersClientApp/Controllers/HomeController.cs @@ -500,6 +500,7 @@ namespace BankManagersClientApp.Controllers default: break; } + Response.Redirect("Index"); } [HttpGet]