diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/ClientLogic.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/ClientLogic.cs index fcd05a9..7a58bac 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/ClientLogic.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/ClientLogic.cs @@ -132,7 +132,7 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogic //проверка на наличие почты if (string.IsNullOrEmpty(model.Email)) { - throw new ArgumentNullException("Отсутствие почты в учётной записи", nameof(model.Email)); + throw new ArgumentNullException("Отсутствие почты в учётной записи (логина)", nameof(model.Email)); } //проверка на наличие пароля @@ -153,7 +153,7 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogic //если элемент найден и его Id не совпадает с Id переданного объекта if (element != null && element.Id != model.Id) { - throw new InvalidOperationException("Аккаунт с таким именем уже есть"); + throw new InvalidOperationException("Аккаунт с таким логином уже есть"); } } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/OrderStorage.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/OrderStorage.cs index 7ee75e1..806deba 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/OrderStorage.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/OrderStorage.cs @@ -57,22 +57,17 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements public List GetFilteredList(OrderSearchModel model) { - if (!model.Id.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue) - { - return new(); - } + using var context = new BlacksmithWorkshopDatabase(); - using var context = new BlacksmithWorkshopDatabase(); - - if(!model.Id.HasValue && model.DateFrom.HasValue && model.DateTo.HasValue) + if (!model.Id.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue) { - return context.Orders - .Include(x => x.Manufacture) - .Include(x => x.Client) - .Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo) - .Select(x => x.GetViewModel) - .ToList(); - } + return context.Orders + .Include(x => x.Manufacture) + .Include(x => x.Client) + .Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo) + .Select(x => x.GetViewModel) + .ToList(); + } else if (model.Id.HasValue) { return context.Orders