38 lines
1.3 KiB
C#
38 lines
1.3 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using ReportingServices.Shared.Repositories;
|
|
using ReportingServices.Shared.Models.PlanningReport;
|
|
|
|
namespace ReportingServices.UI.Controllers
|
|
{
|
|
public class PlanningReportController : Controller
|
|
{
|
|
private readonly IScrapeDatabaseRepository _scrapeDatabaseRepository;
|
|
|
|
public PlanningReportController(IScrapeDatabaseRepository scrapeDatabaseRepository)
|
|
{
|
|
_scrapeDatabaseRepository = scrapeDatabaseRepository;
|
|
}
|
|
|
|
public IActionResult Index()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public IActionResult WeeklyPartChangesReport(DateTime startDate, DateTime endDate)
|
|
{
|
|
int numberOfPartChanges = _scrapeDatabaseRepository.GetNumberOfPartChanges(startDate.ToString(), endDate.ToString());
|
|
List<ReactorPSNWORuns> reactorPSNWORuns = _scrapeDatabaseRepository.GetReactorPSNWORuns(startDate.ToString(), endDate.ToString());
|
|
|
|
WeeklyPartChanges weeklyPartChanges = new()
|
|
{
|
|
TotalPartChanges = numberOfPartChanges,
|
|
StartDate = startDate.ToShortDateString(),
|
|
EndDate = endDate.ToShortDateString(),
|
|
ReactorPSNWORuns = reactorPSNWORuns
|
|
};
|
|
|
|
return View(weeklyPartChanges);
|
|
}
|
|
}
|
|
}
|