From 24299f86ce4d2537679a3497d46b3741296c05d4 Mon Sep 17 00:00:00 2001 From: Zakharov_Rostislav Date: Sun, 26 May 2024 21:21:19 +0400 Subject: [PATCH] fix word report --- .../Implements/AccountStorage.cs | 22 +++++++++---------- .../Controllers/HomeController.cs | 1 + 2 files changed, 12 insertions(+), 11 deletions(-) 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]