Get to compile
This commit is contained in:
@@ -243,6 +243,7 @@ namespace MileageTraker.Web.Controllers
|
||||
}
|
||||
|
||||
var log = viewModel.GetLog();
|
||||
log.Vehicle = DataService.GetVehicle(viewModel.VehicleId);
|
||||
log.User = DataService.FindUserByUsername(User.Identity.Name);
|
||||
log.Source = HttpContext.Request.Url.AbsolutePath;
|
||||
log.UserHostAddress = HttpContext.Request.UserHostAddress;
|
||||
@@ -266,7 +267,7 @@ namespace MileageTraker.Web.Controllers
|
||||
}, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
// verify vehicle exists
|
||||
if (DataService.GetVehicle(log.VehicleId) == null)
|
||||
if (log.Vehicle == null)
|
||||
{
|
||||
return Json(new
|
||||
{
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace MileageTraker.Web.Controllers
|
||||
|
||||
var logs = from l in DataService.GetPossibleMatchingLogs(fuelLog).ToList()
|
||||
where l != fuelLog.Log
|
||||
let v = DataService.GetVehicle(l.VehicleId)
|
||||
let v = l.Vehicle
|
||||
let vm = new LogMatchViewModel(l, v, fuelLogViewModel)
|
||||
orderby vm.MismatchCount ascending
|
||||
select vm;
|
||||
@@ -89,7 +89,7 @@ namespace MileageTraker.Web.Controllers
|
||||
};
|
||||
|
||||
if (fuelLog.Log != null)
|
||||
matchViewModel.CurrentlyMatchedLog = new LogMatchViewModel(fuelLog.Log, DataService.GetVehicle(fuelLog.Log.VehicleId), fuelLogViewModel);
|
||||
matchViewModel.CurrentlyMatchedLog = new LogMatchViewModel(fuelLog.Log, DataService.GetVehicle(fuelLog.Log.Vehicle.VehicleId), fuelLogViewModel);
|
||||
|
||||
// When creating a new Log to match the fuel log, this holds the ID between actions
|
||||
TempData["FuelLogId"] = id;
|
||||
|
||||
@@ -335,6 +335,7 @@ namespace MileageTraker.Web.Controllers
|
||||
}
|
||||
|
||||
var log = viewModel.GetLog();
|
||||
log.Vehicle = DataService.GetVehicle(viewModel.VehicleId);
|
||||
log.User = DataService.FindUserByFullName(userFullName);
|
||||
log.Source = HttpContext.Request.Url.AbsolutePath;
|
||||
log.UserHostAddress = HttpContext.Request.UserHostAddress;
|
||||
@@ -358,7 +359,7 @@ namespace MileageTraker.Web.Controllers
|
||||
}, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
// verify vehicle exists
|
||||
if (DataService.GetVehicle(log.VehicleId) == null)
|
||||
if (log.Vehicle == null)
|
||||
{
|
||||
return Json(new
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user