Fuel Log Match
This commit is contained in:
@@ -45,7 +45,6 @@ namespace MileageTraker.Web.Controllers
|
||||
orderby log.Created descending
|
||||
select log).ToList();
|
||||
|
||||
|
||||
var viewModel = new LogResultsViewModel(filteredLogs, query, CustomExtensions.YearMonthList(validLogYearMonths));
|
||||
|
||||
Session.Add("LogPage", Request.Url.PathAndQuery);
|
||||
@@ -162,7 +161,21 @@ namespace MileageTraker.Web.Controllers
|
||||
DataService.AddLog(log);
|
||||
|
||||
TempData["StatusMessage"] = "Log created";
|
||||
return RedirectToAction("Index");
|
||||
|
||||
if (TempData.ContainsKey("FuelLogId"))
|
||||
{
|
||||
// update fuel log
|
||||
var fuelLogId = (int)TempData["FuelLogId"];
|
||||
var fuelLog = DataService.GetFuelLog(fuelLogId);
|
||||
fuelLog.Log = log;
|
||||
DataService.UpdateFuelLog(fuelLog);
|
||||
|
||||
// return to the fuel log match page
|
||||
TempData["StatusMessage"] = "Log created and matched to the fuel log";
|
||||
return RedirectToAction("Match", "FuelLog", new {id = fuelLogId});
|
||||
}
|
||||
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
viewModel.Purpose.Available = GetPurposeTypesSelectList();
|
||||
|
||||
Reference in New Issue
Block a user