add note records to attachment export.

This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2024-10-13 12:25:02 -06:00
parent 3f31f091dc
commit 29a90fe814
2 changed files with 16 additions and 1 deletions

View File

@@ -292,6 +292,17 @@ namespace CarCareTracker.Controllers
Files = x.Files
}));
}
if (exportTabs.Contains(ImportMode.NoteRecord))
{
var records = _noteDataAccess.GetNotesByVehicleId(vehicleId).Where(x => x.Files.Any());
attachmentData.AddRange(records.Select(x => new GenericReportModel
{
DataType = ImportMode.NoteRecord,
Date = DateTime.Now,
Odometer = 0,
Files = x.Files
}));
}
if (attachmentData.Any())
{
attachmentData = attachmentData.OrderBy(x => x.Date).ThenBy(x => x.Odometer).ToList();