diff --git a/SoftwareInstallation/SoftwareInstallationDataBaseImplement/SoftwareInstallationDataBase.cs b/SoftwareInstallation/SoftwareInstallationDataBaseImplement/SoftwareInstallationDataBase.cs index d72cf07..8fec7fd 100644 --- a/SoftwareInstallation/SoftwareInstallationDataBaseImplement/SoftwareInstallationDataBase.cs +++ b/SoftwareInstallation/SoftwareInstallationDataBaseImplement/SoftwareInstallationDataBase.cs @@ -9,7 +9,7 @@ namespace SoftwareInstallationDataBaseImplement { if (optionsBuilder.IsConfigured == false) { - optionsBuilder.UseSqlServer(@"Data Source=COMP-AVZH\SQLEXPRESS;Initial Catalog=SoftwareInstallationDataBaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); + optionsBuilder.UseSqlServer(@"Data Source=ANNZHIMOL\SQLEXPRESS;Initial Catalog=SoftwareInstallationDataBaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); } base.OnConfiguring(optionsBuilder); } diff --git a/SoftwareInstallation/SoftwareInstallationFileImplement/Implements/OrderStorage.cs b/SoftwareInstallation/SoftwareInstallationFileImplement/Implements/OrderStorage.cs index 6f45169..be1891f 100644 --- a/SoftwareInstallation/SoftwareInstallationFileImplement/Implements/OrderStorage.cs +++ b/SoftwareInstallation/SoftwareInstallationFileImplement/Implements/OrderStorage.cs @@ -42,12 +42,12 @@ namespace SoftwareInstallationFileImplement.Implements public List GetFilteredList(OrderSearchModel model) { - if (!model.Id.HasValue) + if (!model.Id.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue) { return new(); } - return source.Orders.Where(x => x.Id==model.Id).Select(x => x.GetViewModel).ToList(); + return source.Orders.Where(x => x.Id.Equals(model.Id)).Select(x => x.GetViewModel).ToList(); } public List GetFullList() diff --git a/SoftwareInstallation/SoftwareInstallationListImplement/Implements/OrderStorage.cs b/SoftwareInstallation/SoftwareInstallationListImplement/Implements/OrderStorage.cs index 5c444fa..ea44227 100644 --- a/SoftwareInstallation/SoftwareInstallationListImplement/Implements/OrderStorage.cs +++ b/SoftwareInstallation/SoftwareInstallationListImplement/Implements/OrderStorage.cs @@ -57,7 +57,7 @@ namespace SoftwareInstallationListImplement.Implements foreach (var order in _source.Orders) { - if (model.Id.HasValue && order.Id == model.Id) + if (order.Id == model.Id || model.DateFrom <= order.DateCreate && order.DateCreate <= model.DateTo) { result.Add(order.GetViewModel); }