34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using ReportingServices.Dependency_Injections;
|
|
using ReportingServices.HelperClasses;
|
|
using ReportingServices.Models.PlanningReport;
|
|
|
|
namespace ReportingServices.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 WeeklyPartChanges(numberOfPartChanges, startDate.ToShortDateString(),
|
|
endDate.ToShortDateString(), reactorPSNWORuns);
|
|
|
|
return View(weeklyPartChanges);
|
|
}
|
|
}
|
|
}
|