Reorganized project structure to separate backend process from frontend process.

This commit is contained in:
Daniel Wathen
2022-12-22 12:10:18 -07:00
parent b5def3da89
commit 80696e5fe6
131 changed files with 494 additions and 347 deletions

View 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);
}
}
}