Eliseev E.E. LabWork05_Hard #11
@ -14,9 +14,9 @@
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Reporting.WinForms.v11" Version="1.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
|
||||
<PackageReference Include="NLog.Extensions.Logging" Version="5.2.2" />
|
||||
<PackageReference Include="ReportViewerCore.WinForms" Version="15.1.17" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -34,7 +34,7 @@ namespace BlacksmithWorkshop
|
||||
Dock = DockStyle.Fill
|
||||
};
|
||||
|
||||
reportViewer.LocalReport.LoadReportDefinition(new FileStream("..\\..\\..\\ReportGroupedOrders.rdlc", FileMode.Open));
|
||||
reportViewer.LocalReport.LoadReportDefinition(new FileStream("C:\\Users\\Programmist73\\Desktop\\Практика\\2-й курс\\4-й семестр\\PIbd-21_Eliseev_E.E._BlacksmithWorkshop\\BlacksmithWorkshop\\BlacksmithWorkshop\\ReportGroupedOrders.rdlc", FileMode.Open));
|
||||
Controls.Clear();
|
||||
Controls.Add(reportViewer);
|
||||
Controls.Add(panel);
|
||||
|
@ -34,7 +34,7 @@ namespace BlacksmithWorkshop
|
||||
Dock = DockStyle.Fill
|
||||
};
|
||||
|
||||
reportViewer.LocalReport.LoadReportDefinition(new FileStream("..\\..\\..\\ReportOrders.rdlc", FileMode.Open));
|
||||
reportViewer.LocalReport.LoadReportDefinition(new FileStream("C:\\Users\\Programmist73\\Desktop\\Практика\\2-й курс\\4-й семестр\\PIbd-21_Eliseev_E.E._BlacksmithWorkshop\\BlacksmithWorkshop\\BlacksmithWorkshop\\ReportOrders.rdlc", FileMode.Open));
|
||||
|
||||
Controls.Clear();
|
||||
Controls.Add(reportViewer);
|
||||
|
@ -49,14 +49,23 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements
|
||||
|
||||
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
||||
{
|
||||
if (!model.Id.HasValue)
|
||||
if (!model.Id.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
return new();
|
||||
}
|
||||
|
||||
using var context = new BlacksmithWorkshopDatabase();
|
||||
using var context = new BlacksmithWorkshopDatabase();
|
||||
|
||||
return context.Orders
|
||||
if (!model.Id.HasValue && model.DateFrom.HasValue && model.DateTo.HasValue)
|
||||
{
|
||||
return context.Orders
|
||||
.Include(x => x.Manufacture)
|
||||
.Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo)
|
||||
.Select(x => x.GetViewModel)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
return context.Orders
|
||||
.Include(x => x.Manufacture)
|
||||
.Where(x => x.Id == model.Id)
|
||||
.Select(x => x.GetViewModel)
|
||||
|
Loading…
Reference in New Issue
Block a user