Helpful error message on import
This commit is contained in:
+11
-3
@@ -60,8 +60,11 @@ namespace MileageTraker.Web.DAL
|
||||
return dateTimeValue.ToShortDateString();
|
||||
};
|
||||
|
||||
var logImportViewModel =
|
||||
new ImportLogViewModel
|
||||
ImportLogViewModel logImportViewModel;
|
||||
|
||||
try
|
||||
{
|
||||
logImportViewModel = new ImportLogViewModel
|
||||
{
|
||||
CityName = getRowValue("Destination City"),
|
||||
Date = getRowDateValue("Date"),
|
||||
@@ -72,8 +75,13 @@ namespace MileageTraker.Web.DAL
|
||||
Purpose = getRowValue("Purpose"),
|
||||
VehicleId = getRowValue("Vehicle ID")
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ImportException(ex.Message + " on row " + (r + 1));
|
||||
}
|
||||
yield return logImportViewModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static IDictionary<string, int> GetColumnIndex(Row headerRow, int columnCount)
|
||||
|
||||
Reference in New Issue
Block a user