diff --git a/ConfectionaryListImplement/ClientStorage.cs b/ConfectionaryListImplement/ClientStorage.cs index 0d441ec..7540b52 100644 --- a/ConfectionaryListImplement/ClientStorage.cs +++ b/ConfectionaryListImplement/ClientStorage.cs @@ -2,12 +2,6 @@ using ConfectioneryContracts.SearchModels; using ConfectioneryContracts.StoragesContract; using ConfectioneryContracts.ViewModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading.Tasks; namespace ConfectioneryListImplement { diff --git a/ConfectionaryListImplement/Order.cs b/ConfectionaryListImplement/Order.cs index 9954ae8..d6bfc12 100644 --- a/ConfectionaryListImplement/Order.cs +++ b/ConfectionaryListImplement/Order.cs @@ -58,7 +58,6 @@ namespace ConfectioneryListImplement.Models public OrderViewModel GetViewModel => new() { PastryId = PastryId, - ClientFIO = DataListSingleton.GetInstance().Clients.FirstOrDefault(x => x.Id == ClientId)?.ClientFIO ?? string.Empty, ClientId = ClientId, Count = Count, Sum = Sum, diff --git a/ConfectionaryListImplement/OrderStorage.cs b/ConfectionaryListImplement/OrderStorage.cs index 605c158..6c794aa 100644 --- a/ConfectionaryListImplement/OrderStorage.cs +++ b/ConfectionaryListImplement/OrderStorage.cs @@ -121,6 +121,14 @@ namespace ConfectioneryListImplement break; } } + foreach (var client in _source.Clients) + { + if (client.Id == res.ClientId) + { + res.ClientFIO = client.ClientFIO; + break; + } + } return res; } }