Fixup areas expecting VehicleId

This commit is contained in:
2015-10-02 18:35:51 -04:00
parent 3a4da9d1a1
commit ad1623d05b
8 changed files with 16 additions and 6 deletions
+2
View File
@@ -63,6 +63,7 @@ namespace MileageTraker.Web.Controllers
throw new SecurityException();
viewModel.SetProperties(log);
log.Vehicle = DataService.GetVehicle(viewModel.VehicleId);
if (viewModel.Purpose != null)
log.Purpose =
DataService.GetPurposeTypes()
@@ -107,6 +108,7 @@ namespace MileageTraker.Web.Controllers
// Save the new log
var log = model.GetLog();
log.Vehicle = DataService.GetVehicle(model.VehicleId);
log.User = DataService.FindUserByUsername(User.Identity.Name);
log.Source = HttpContext.Request.Url.AbsolutePath;
log.UserHostAddress = HttpContext.Request.UserHostAddress;