Reorganized project structure to separate backend process from frontend process.
This commit is contained in:
37
ReportingServices.UI/Controllers/PlanningReportController.cs
Normal file
37
ReportingServices.UI/Controllers/PlanningReportController.cs
Normal file
@ -0,0 +1,37 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user