Add vehicle filtering for fuellog and vehicle service
This commit is contained in:
@@ -663,6 +663,10 @@ namespace MileageTraker.Web.DAL
|
||||
{
|
||||
fuelLogs = fuelLogs.Where(l => l.Log == null);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(query.TagNumber))
|
||||
{
|
||||
fuelLogs = fuelLogs.Where(l => l.TagNumber == query.TagNumber);
|
||||
}
|
||||
return fuelLogs;
|
||||
}
|
||||
|
||||
@@ -842,8 +846,10 @@ namespace MileageTraker.Web.DAL
|
||||
var start = new DateTime(query.Year.Value, query.Month.Value, 1);
|
||||
var monthRange = query.MonthRange.HasValue ? query.MonthRange.Value : 1;
|
||||
var end = start.AddMonths(monthRange);
|
||||
vehicleServices = vehicleServices.Where(l => l.InvoiceDate >= start && l.InvoiceDate < end);
|
||||
vehicleServices = vehicleServices.Where(vs => vs.InvoiceDate >= start && vs.InvoiceDate < end);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(query.VehicleId))
|
||||
vehicleServices = vehicleServices.Where(vs => vs.Vehicle.VehicleId == query.VehicleId);
|
||||
return vehicleServices;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user