add missed_fuelup column to csv imports.

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-01-10 20:14:59 -07:00
parent ad8c27a2e6
commit d69ede1447
3 changed files with 7 additions and 0 deletions

View File

@@ -277,6 +277,11 @@ namespace CarCareTracker.Controllers
var parsedBool = importModel.IsFillToFull.Trim() == "1" || importModel.IsFillToFull.Trim() == "Full";
convertedRecord.IsFillToFull = parsedBool;
}
if (!string.IsNullOrWhiteSpace(importModel.MissedFuelUp))
{
var parsedBool = importModel.MissedFuelUp.Trim() == "1";
convertedRecord.MissedFuelUp = parsedBool;
}
//insert record into db, check to make sure fuelconsumed is not zero so we don't get a divide by zero error.
if (convertedRecord.Gallons > 0)
{

View File

@@ -16,6 +16,7 @@ namespace CarCareTracker.MapProfile
Map(m => m.PartialFuelUp).Name(["partial_fuelup"]);
Map(m => m.IsFillToFull).Name(["isfilltofull", "filled up"]);
Map(m => m.Description).Name(["description"]);
Map(m => m.MissedFuelUp).Name(["missed_fuelup"]);
}
}
}

View File

@@ -14,6 +14,7 @@
public string Price { get; set; }
public string PartialFuelUp { get; set; }
public string IsFillToFull { get; set; }
public string MissedFuelUp { get; set; }
}
public class ServiceRecordExportModel
{