From 6a2ccb378720ee140482f6f9b6be4d5ba16094dd Mon Sep 17 00:00:00 2001 From: Sergey Kozyrev Date: Fri, 19 Apr 2024 13:42:36 +0400 Subject: [PATCH] Someneedchangeonsdacha --- .../SewingDressesBusinessLogic/BusinessLogic/WorkModeling.cs | 3 ++- .../Implements/ImplementStorage.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SewingDresses/SewingDressesBusinessLogic/BusinessLogic/WorkModeling.cs b/SewingDresses/SewingDressesBusinessLogic/BusinessLogic/WorkModeling.cs index 7e5ae49..32e2fa3 100644 --- a/SewingDresses/SewingDressesBusinessLogic/BusinessLogic/WorkModeling.cs +++ b/SewingDresses/SewingDressesBusinessLogic/BusinessLogic/WorkModeling.cs @@ -59,7 +59,8 @@ namespace SewingDressesBusinessLogic.BusinessLogic _logger.LogDebug("DoWork. Worker {Id} finish order { Order}", implement.Id, order.Id); _orderLogic.FinishOrder(new OrderBindingModel { - Id = order.Id + Id = order.Id, + ImplementId = implement.Id }); } catch (InvalidOperationException ex) diff --git a/SewingDresses/SewingDressesDatabaseImplement/Implements/ImplementStorage.cs b/SewingDresses/SewingDressesDatabaseImplement/Implements/ImplementStorage.cs index 7683b04..d2b1a37 100644 --- a/SewingDresses/SewingDressesDatabaseImplement/Implements/ImplementStorage.cs +++ b/SewingDresses/SewingDressesDatabaseImplement/Implements/ImplementStorage.cs @@ -48,7 +48,7 @@ namespace SewingDressesDatabaseImplement.Implements if (string.IsNullOrEmpty(model.ImplementFIO) && !model.Id.HasValue) return null; using var context = new SewingDressesDatabase(); - return context.Implements.FirstOrDefault(x => (string.IsNullOrEmpty(model.ImplementFIO) || x.ImplementFIO.Equals(model.ImplementFIO)) && (!model.Id.HasValue && model.Id == x.Id))?.GetViewModel; + return context.Implements.FirstOrDefault(x => (string.IsNullOrEmpty(model.ImplementFIO) || x.ImplementFIO.Equals(model.ImplementFIO)) && (!model.Id.HasValue || model.Id == x.Id))?.GetViewModel; } public List GetFullList() {