From 792eda80bc82db9e15b5942d7d3c73bd3c5e264f Mon Sep 17 00:00:00 2001 From: antoc0der <1@DESKTOP-K1L8ND3> Date: Wed, 10 Apr 2024 16:17:34 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FlowerShopClientApp/APIClient.cs | 3 +-- FlowerShopDatabaseImplement/OrderStorage.cs | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/FlowerShopClientApp/APIClient.cs b/FlowerShopClientApp/APIClient.cs index 7ae5c99..ab6bba1 100644 --- a/FlowerShopClientApp/APIClient.cs +++ b/FlowerShopClientApp/APIClient.cs @@ -13,8 +13,7 @@ namespace FlowerShopClientApp { _client.BaseAddress = new Uri(configuration["IPAddress"]); _client.DefaultRequestHeaders.Accept.Clear(); - _client.DefaultRequestHeaders.Accept.Add(new - MediaTypeWithQualityHeaderValue("application/json")); + _client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); } public static T? GetRequest(string requestUrl) { diff --git a/FlowerShopDatabaseImplement/OrderStorage.cs b/FlowerShopDatabaseImplement/OrderStorage.cs index e51926c..4d20bc9 100644 --- a/FlowerShopDatabaseImplement/OrderStorage.cs +++ b/FlowerShopDatabaseImplement/OrderStorage.cs @@ -18,7 +18,7 @@ namespace FlowerShopDatabaseImplement.Implements public List GetFullList() { using var context = new FlowerShopDataBase(); - return context.Orders.Include(x => x.Flower) + return context.Orders.Include(x => x.Flower).Include(x => x.Client) .Select(x => x.GetViewModel) .ToList(); } @@ -30,7 +30,8 @@ namespace FlowerShopDatabaseImplement.Implements return context.Orders.Include(x => x.Flower) .Where(x => ((!model.Id.HasValue || x.Id == model.Id) && (!model.DateFrom.HasValue || x.DateCreate >= model.DateFrom) && - (!model.DateTo.HasValue || x.DateCreate <= model.DateTo))) + (!model.DateTo.HasValue || x.DateCreate <= model.DateTo) && + (!model.ClientId.HasValue || x.ClientId == model.ClientId))) .Select(x => x.GetViewModel) .ToList(); }