Готовая 4 лаба
This commit is contained in:
parent
240d0c73a3
commit
27ae6b8d92
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -28,14 +28,14 @@ namespace TypographyDatabaseImplement.Implements
|
||||
|
||||
public List<OrderViewModel> 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();
|
||||
}
|
||||
|
@ -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<OrderViewModel> 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)
|
||||
|
@ -559,11 +559,7 @@
|
||||
</Textbox>
|
||||
</ReportItems>
|
||||
<Height>5.72875cm</Height>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
</Border>
|
||||
</Style>
|
||||
<Style />
|
||||
</Body>
|
||||
<Width>21cm</Width>
|
||||
<Page>
|
||||
|
Loading…
Reference in New Issue
Block a user