moved more stuff around and gas record functionality.

This commit is contained in:
ivancheahhh
2024-01-03 06:18:39 -07:00
parent 928d18c8e5
commit 8dfaf49e05
6 changed files with 61 additions and 35 deletions

View File

@@ -115,7 +115,19 @@ namespace CarCareTracker.Controllers
}
previousMileage = result[i].Mileage;
}
return PartialView("_GasRecords", computedResults);
return PartialView("_Gas", computedResults);
}
[HttpPost]
public IActionResult SaveGasRecordToVehicleId(GasRecordInput gasRecord)
{
gasRecord.Files = gasRecord.Files.Select(x => { return new UploadedFiles { Name = x.Name, Location = _fileHelper.MoveFileFromTemp(x.Location, "documents/") }; }).ToList();
var result = _gasRecordDataAccess.SaveGasRecordToVehicle(gasRecord.ToGasRecord());
return Json(result);
}
[HttpGet]
public IActionResult GetAddGasRecordPartialView()
{
return PartialView("_GasModal", new GasRecordInput());
}
#endregion
#region "Service Records"