rough draft of supply store.

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-01-21 21:13:03 -07:00
parent 5c8f03003e
commit 92b3bc3aea
4 changed files with 112 additions and 0 deletions

View File

@@ -1253,6 +1253,23 @@ namespace CarCareTracker.Controllers
}
return PartialView("_SupplyRecords", result);
}
[TypeFilter(typeof(CollaboratorFilter))]
[HttpGet]
public IActionResult GetSupplyRecordsForRecordsByVehicleId(int vehicleId)
{
var result = _supplyRecordDataAccess.GetSupplyRecordsByVehicleId(vehicleId);
result.RemoveAll(x => x.Quantity <= 0);
bool _useDescending = _config.GetUserConfig(User).UseDescending;
if (_useDescending)
{
result = result.OrderByDescending(x => x.Date).ToList();
}
else
{
result = result.OrderBy(x => x.Date).ToList();
}
return PartialView("_SupplyUsage", result);
}
[HttpPost]
public IActionResult SaveSupplyRecordToVehicleId(SupplyRecordInput supplyRecord)
{