еще фиксы

This commit is contained in:
Леонид Малафеев 2024-05-28 11:09:56 +04:00
parent f9e191a08f
commit 6acd4ab8a1
4 changed files with 11 additions and 3 deletions

View File

@ -10,6 +10,7 @@ namespace CarCenterContracts.SearchModels
{
public int? Id { get; set; }
public long? VINnumber { get; set; }
public int? StorekeeperId { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
}

View File

@ -10,7 +10,8 @@ namespace CarCenterContracts.SearchModels
public class OrderSearchModel
{
public int? Id { get; set; }
public List<IPresaleModel> Presales { get; set; } = new();
public int? WorkerId { get; set; }
public List<IPresaleModel> Presales { get; set; } = new();
public List<ICarModel> Cars { get; set; } = new();
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }

View File

@ -33,6 +33,7 @@ namespace CarCenterDatabaseImplement.Implements
{
//будет применятся в ReportLogic
return context.Cars
.Where(x => x.StorekeeperId == model.StorekeeperId)
.Include(x => x.Bundlings)
.ThenInclude(x => x.Bundling)
.Include(x => x.Feature)
@ -45,7 +46,8 @@ namespace CarCenterDatabaseImplement.Implements
else if (model.Id.HasValue)
{
return context.Cars
.Include(x => x.Bundlings)
.Where(x => x.StorekeeperId == model.StorekeeperId)
.Include(x => x.Bundlings)
.ThenInclude(x => x.Bundling)
.Include(x => x.Feature)
.Include(x => x.Order)

View File

@ -59,6 +59,7 @@ namespace CarCenterDatabaseImplement.Implements
{
//будет применятся в ReportLogic
return context.Orders
.Where(x => x.WorkerId == model.WorkerId)
.Include(x => x.Worker)
.Include(x => x.Cars)
.Include(x => x.Presales)
@ -76,6 +77,7 @@ namespace CarCenterDatabaseImplement.Implements
{
//будет применятся в ReportLogic
return context.Orders
.Where(x => x.WorkerId == model.WorkerId)
.Include(x => x.Worker)
.Include(x => x.Cars)
.Include(x => x.Presales)
@ -88,6 +90,7 @@ namespace CarCenterDatabaseImplement.Implements
{
//будет применятся в ReportLogic
return context.Orders
.Where(x => x.WorkerId == model.WorkerId)
.Include(x => x.Worker)
.Include(x => x.Cars)
.Include(x => x.Presales)
@ -99,7 +102,8 @@ namespace CarCenterDatabaseImplement.Implements
else if (model.Id.HasValue)
{
return context.Orders
.Include(x => x.Worker)
.Where(x => x.WorkerId == model.WorkerId)
.Include(x => x.Worker)
.Include(x => x.Cars)
.Include(x => x.Presales)
.ThenInclude(x => x.Presale)