display distance traveled.

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-03-10 08:02:44 -06:00
parent def9a7770f
commit 00b3145e79
2 changed files with 4 additions and 3 deletions

View File

@@ -1008,7 +1008,7 @@ namespace CarCareTracker.Controllers
{ {
MonthName = x.Key.MonthName, MonthName = x.Key.MonthName,
Cost = x.Sum(y => y.Cost), Cost = x.Sum(y => y.Cost),
DistanceTraveled = 0 DistanceTraveled = x.Max(y=>y.DistanceTraveled)
}).ToList(); }).ToList();
//get reminders //get reminders
var reminders = GetRemindersAndUrgency(vehicleId, DateTime.Now); var reminders = GetRemindersAndUrgency(vehicleId, DateTime.Now);
@@ -1380,7 +1380,7 @@ namespace CarCareTracker.Controllers
{ {
MonthName = x.Key.MonthName, MonthName = x.Key.MonthName,
Cost = x.Sum(y => y.Cost), Cost = x.Sum(y => y.Cost),
DistanceTraveled = 0 DistanceTraveled = x.Max(y => y.DistanceTraveled)
}).ToList(); }).ToList();
return PartialView("_GasCostByMonthReport", groupedRecord); return PartialView("_GasCostByMonthReport", groupedRecord);
} }

View File

@@ -24,7 +24,8 @@ namespace CarCareTracker.Helper
{ {
MonthId = x.Key, MonthId = x.Key,
MonthName = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(x.Key), MonthName = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(x.Key),
Cost = 0 Cost = 0,
DistanceTraveled = x.Sum(y=>y.DistanceTraveled)
}); });
} }
public IEnumerable<CostForVehicleByMonth> GetServiceRecordSum(List<ServiceRecord> serviceRecords, int year = 0) public IEnumerable<CostForVehicleByMonth> GetServiceRecordSum(List<ServiceRecord> serviceRecords, int year = 0)