Track source filename for FuelLog

This commit is contained in:
2015-09-26 23:00:02 -04:00
parent a6ea6df177
commit a2368f5e69
4 changed files with 7 additions and 1 deletions
+3
View File
@@ -129,6 +129,9 @@ namespace MileageTraker.Web.Controllers
try try
{ {
var fuelLogs = FuelmanCsvImporter.Import(fileInfo); var fuelLogs = FuelmanCsvImporter.Import(fileInfo);
foreach (var fuelLog in fuelLogs)
fuelLog.SourceFilename = fileName;
// todo: delete file? // todo: delete file?
var fls = (from fuelLog in fuelLogs var fls = (from fuelLog in fuelLogs
@@ -20,6 +20,7 @@ namespace MileageTraker.Web.Migrations
MPG = c.Double(nullable: false), MPG = c.Double(nullable: false),
GasPurchased = c.Double(nullable: false), GasPurchased = c.Double(nullable: false),
TotalPrice = c.Decimal(nullable: false, precision: 18, scale: 2), TotalPrice = c.Decimal(nullable: false, precision: 18, scale: 2),
SourceFilename = c.String(),
Log_LogId = c.Int(), Log_LogId = c.Int(),
}) })
.PrimaryKey(t => t.FuelLogId) .PrimaryKey(t => t.FuelLogId)
File diff suppressed because one or more lines are too long
+2
View File
@@ -37,5 +37,7 @@ namespace MileageTraker.Web.Models
// Matched log // Matched log
public virtual Log Log { get; set; } public virtual Log Log { get; set; }
public string SourceFilename { get; set; }
} }
} }