diff --git a/Bank/BankClientApp/Views/Home/OperationUpdate.cshtml b/Bank/BankClientApp/Views/Home/OperationUpdate.cshtml index efdee9d..b8278fb 100644 --- a/Bank/BankClientApp/Views/Home/OperationUpdate.cshtml +++ b/Bank/BankClientApp/Views/Home/OperationUpdate.cshtml @@ -1,9 +1,9 @@  @{ - ViewData["Title"] = "OperationDelete"; + ViewData["Title"] = "OperationUpdate"; }
-

Удаление операции

+

Обновление операции

diff --git a/Bank/BankContracts/SearchModels/OperationSearchModel.cs b/Bank/BankContracts/SearchModels/OperationSearchModel.cs index 8aecfa4..8f45f47 100644 --- a/Bank/BankContracts/SearchModels/OperationSearchModel.cs +++ b/Bank/BankContracts/SearchModels/OperationSearchModel.cs @@ -13,5 +13,6 @@ namespace BankContracts.SearchModels public DateTime? DateTo { get; set; } public int? SenderCardId { get; set; } public int? RecipientCardId { get; set; } + public int? CardId { get; set; } } } diff --git a/Bank/BankContracts/SearchModels/RequestSearchModel.cs b/Bank/BankContracts/SearchModels/RequestSearchModel.cs index 2270880..16ec198 100644 --- a/Bank/BankContracts/SearchModels/RequestSearchModel.cs +++ b/Bank/BankContracts/SearchModels/RequestSearchModel.cs @@ -14,5 +14,6 @@ namespace BankContracts.SearchModels public DateTime? DateTo { get; set; } public string? CardNumber { get; set; } public RequestStatus? Status { get; set; } + public int? CardId { get; set; } } } diff --git a/Bank/BankContracts/SearchModels/TransferSearchModel.cs b/Bank/BankContracts/SearchModels/TransferSearchModel.cs index 5816e4a..31c6e8f 100644 --- a/Bank/BankContracts/SearchModels/TransferSearchModel.cs +++ b/Bank/BankContracts/SearchModels/TransferSearchModel.cs @@ -14,5 +14,6 @@ namespace BankContracts.SearchModels public int? OperationId { get; set; } public int? SenderAccountId { get; set; } public int? RecipientAccountId { get; set; } + public int? CardId { get; set; } } } diff --git a/Bank/BankDatabaseImplement/Implements/OperationStorage.cs b/Bank/BankDatabaseImplement/Implements/OperationStorage.cs index 9273b47..39a9186 100644 --- a/Bank/BankDatabaseImplement/Implements/OperationStorage.cs +++ b/Bank/BankDatabaseImplement/Implements/OperationStorage.cs @@ -27,7 +27,8 @@ namespace BankDatabaseImplement.Implements .Where(x => ( (!model.Id.HasValue || x.Id == model.Id) && (!model.DateFrom.HasValue || x.OperationTime >= model.DateFrom ) && - (!model.DateTo.HasValue || x.OperationTime <= model.DateTo) + (!model.DateTo.HasValue || x.OperationTime <= model.DateTo) && + (!model.CardId.HasValue || x.RecipientCardId == model.CardId || x.SenderCardId == model.CardId) )).Select(x => x.GetViewModel).ToList(); } public OperationViewModel? GetElement(OperationSearchModel model) diff --git a/Bank/BankDatabaseImplement/Implements/RequestStorage.cs b/Bank/BankDatabaseImplement/Implements/RequestStorage.cs index e03abf0..a729b39 100644 --- a/Bank/BankDatabaseImplement/Implements/RequestStorage.cs +++ b/Bank/BankDatabaseImplement/Implements/RequestStorage.cs @@ -31,7 +31,8 @@ namespace BankDatabaseImplement.Implements return context.Requests.Include(x => x.Cards).ThenInclude(x => x.Card) .Where(x => (model.Id.HasValue && x.Id == model.Id) && (!model.DateFrom.HasValue || x.RequestTime >= model.DateFrom) && - (!model.DateTo.HasValue || x.RequestTime <= model.DateTo) + (!model.DateTo.HasValue || x.RequestTime <= model.DateTo) && + (!model.CardId.HasValue || x.Cards.Select(x => x.CardId).ToList().Contains(model.CardId.Value)) ).ToList() .Select(x => x.GetViewModel).ToList(); } diff --git a/Bank/BankDatabaseImplement/Implements/TransferStorage.cs b/Bank/BankDatabaseImplement/Implements/TransferStorage.cs index 5e3e8bb..f4fcd33 100644 --- a/Bank/BankDatabaseImplement/Implements/TransferStorage.cs +++ b/Bank/BankDatabaseImplement/Implements/TransferStorage.cs @@ -37,7 +37,8 @@ namespace BankDatabaseImplement.Implements (!model.RecipientAccountId.HasValue || x.RecipientAccountId == model.RecipientAccountId) && (!model.OperationId.HasValue || x.OperationId == model.OperationId) && (!model.DateFrom.HasValue || x.TransferTime >= model.DateFrom) && - (!model.DateTo.HasValue || x.TransferTime <= model.DateTo) + (!model.DateTo.HasValue || x.TransferTime <= model.DateTo) && + (!model.CardId.HasValue || x.Operation.RecipientCardId == model.CardId || x.Operation.SenderCardId == model.CardId) ).Select(x => x.GetViewModel).ToList(); }