From 7d89799f0e58cd0b1cb26fabcb37aa838d9dd9fd Mon Sep 17 00:00:00 2001 From: gg12 darfren Date: Sat, 27 Apr 2024 22:38:44 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B8=D1=85=D0=BE=D1=80=D0=B0?= =?UTF-8?q?=D1=88=D0=B8=D0=B2=D0=B0=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IceCreamShopBusinessLogic/BusinessLogic/ClientLogic.cs | 4 ++-- .../IceCreamShopClientApp/Controllers/HomeController.cs | 1 + .../Implements/ClientStorage.cs | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/IceCreamShop/IceCreamShopBusinessLogic/BusinessLogic/ClientLogic.cs b/IceCreamShop/IceCreamShopBusinessLogic/BusinessLogic/ClientLogic.cs index 1433f02..e72352d 100644 --- a/IceCreamShop/IceCreamShopBusinessLogic/BusinessLogic/ClientLogic.cs +++ b/IceCreamShop/IceCreamShopBusinessLogic/BusinessLogic/ClientLogic.cs @@ -102,12 +102,12 @@ namespace IceCreamShopBusinessLogic.BusinessLogic if (string.IsNullOrEmpty(model.Email)) { throw new ArgumentNullException("Нет Email клиента", - nameof(model.ClientFIO)); + nameof(model.Email)); } if (string.IsNullOrEmpty(model.Password)) { throw new ArgumentNullException("Нет пароля клиента", - nameof(model.ClientFIO)); + nameof(model.Password)); } _logger.LogInformation("Client. ClientFIO:{ClientFIO}." + "Email:{ Email}. Password:{ Password}. Id: { Id} ", model.ClientFIO, model.Email, model.Password, model.Id); diff --git a/IceCreamShop/IceCreamShopClientApp/Controllers/HomeController.cs b/IceCreamShop/IceCreamShopClientApp/Controllers/HomeController.cs index 7aac285..8284d6d 100644 --- a/IceCreamShop/IceCreamShopClientApp/Controllers/HomeController.cs +++ b/IceCreamShop/IceCreamShopClientApp/Controllers/HomeController.cs @@ -113,6 +113,7 @@ namespace IceCreamShopClientApp.Controllers [HttpGet] public IActionResult Create() { + var res = APIClient.GetRequest>("api/main/geticecreamlist"); ViewBag.IceCreams = APIClient.GetRequest>("api/main/geticecreamlist"); return View(); diff --git a/IceCreamShop/IceCreamShopDatabaseImplement/Implements/ClientStorage.cs b/IceCreamShop/IceCreamShopDatabaseImplement/Implements/ClientStorage.cs index c89e93d..afb7b5c 100644 --- a/IceCreamShop/IceCreamShopDatabaseImplement/Implements/ClientStorage.cs +++ b/IceCreamShop/IceCreamShopDatabaseImplement/Implements/ClientStorage.cs @@ -30,9 +30,9 @@ namespace IceCreamShopDatabaseImplement.Implements } using var context = new IceCreamShopDataBase(); return context.Clients - .Where(x => (string.IsNullOrEmpty(model.ClientFIO) || x.ClientFIO.Contains(model.ClientFIO) && - string.IsNullOrEmpty(model.Email) || x.ClientFIO.Contains(model.Email) && - string.IsNullOrEmpty(model.Password) || x.ClientFIO.Contains(model.Password))) + .Where(x => (string.IsNullOrEmpty(model.ClientFIO) || x.ClientFIO.Contains(model.ClientFIO)) && + (string.IsNullOrEmpty(model.Email) || x.ClientFIO.Contains(model.Email)) && + (string.IsNullOrEmpty(model.Password) || x.ClientFIO.Contains(model.Password))) .Select(x => x.GetViewModel) .ToList(); }