diff --git a/Typography/TypographyBusinessLogic/BusinessLogics/ReportLogic.cs b/Typography/TypographyBusinessLogic/BusinessLogics/ReportLogic.cs index 56265fd..634af0b 100644 --- a/Typography/TypographyBusinessLogic/BusinessLogics/ReportLogic.cs +++ b/Typography/TypographyBusinessLogic/BusinessLogics/ReportLogic.cs @@ -13,7 +13,7 @@ using TypographyContracts.BusinessLogicsContracts; namespace TypographyBusinessLogic.BusinessLogics { - public class ReportLogic : IReportLogic + public class ReportLogic : IReportLogic { private readonly IComponentStorage _componentStorage; private readonly IPrintedStorage _printedStorage; diff --git a/Typography/TypographyBusinessLogic/OfficePackage/Implements/SaveToPdf.cs b/Typography/TypographyBusinessLogic/OfficePackage/Implements/SaveToPdf.cs index 7484680..abcf8fd 100644 --- a/Typography/TypographyBusinessLogic/OfficePackage/Implements/SaveToPdf.cs +++ b/Typography/TypographyBusinessLogic/OfficePackage/Implements/SaveToPdf.cs @@ -6,7 +6,7 @@ using MigraDoc.Rendering; namespace TypographyBusinessLogic.OfficePackage.Implements { - public class SaveToPdf : AbstractSaveToPdf + public class SaveToPdf : AbstractSaveToPdf { private Document? _document; private Section? _section; diff --git a/Typography/TypographyDatabaseImplement/Implements/OrderStorage.cs b/Typography/TypographyDatabaseImplement/Implements/OrderStorage.cs index 7b7d149..981f0f4 100644 --- a/Typography/TypographyDatabaseImplement/Implements/OrderStorage.cs +++ b/Typography/TypographyDatabaseImplement/Implements/OrderStorage.cs @@ -28,14 +28,14 @@ namespace TypographyDatabaseImplement.Implements public List GetFilteredList(OrderSearchModel model) { - if (model.Id == null) + if (!model.DateFrom.HasValue || !model.DateTo.HasValue) { return new(); } using var context = new TypographyDatabase(); return context.Orders .Include(x => x.Printed) - .Where(x => x.Id == model.Id) + .Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo) .Select(x => x.GetViewModel) .ToList(); } diff --git a/Typography/TypographyFileImplement/Implements/OrderStorage .cs b/Typography/TypographyFileImplement/Implements/OrderStorage .cs index b1f5cf9..7514355 100644 --- a/Typography/TypographyFileImplement/Implements/OrderStorage .cs +++ b/Typography/TypographyFileImplement/Implements/OrderStorage .cs @@ -25,22 +25,21 @@ namespace TypographyFileImplement.Implements private OrderViewModel DefinePrintedName(OrderViewModel model) { string? printedName = source.Printeds.FirstOrDefault(x => model.PrintedId == x.Id)?.PrintedName; - if (printedName == null) + if (printedName != null) { - return null; + model.PrintedName = printedName; } - model.PrintedName = printedName; return model; } public List GetFilteredList(OrderSearchModel model) { - if (model.Id == null) + if (!model.DateFrom.HasValue || !model.DateTo.HasValue) { return new(); } return source.Orders - .Where(x => x.Id == model.Id) + .Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo) .Select(x => DefinePrintedName(x.GetViewModel)) .ToList(); } @@ -51,8 +50,7 @@ namespace TypographyFileImplement.Implements { return null; } - return DefinePrintedName(source.Orders - .FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel); + return DefinePrintedName(source.Orders.FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel); } public OrderViewModel? Insert(OrderBindingModel model) diff --git a/Typography/TypographyView/ReportOrder.rdlc b/Typography/TypographyView/ReportOrder.rdlc index 3596fca..baccfb9 100644 --- a/Typography/TypographyView/ReportOrder.rdlc +++ b/Typography/TypographyView/ReportOrder.rdlc @@ -559,11 +559,7 @@ 5.72875cm - - - +