Helpful error message on import

This commit is contained in:
2016-01-21 14:14:29 -05:00
parent 42f0c12249
commit d92ccb1f02
+11 -3
View File
@@ -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)