Moved API and DB methods to interfaces in order to leverage Dependency Injection, disolved APICaller class, including functionality in several other functions, included Single Load Lock information into Production Passdown report, changed persistant data file to json instead of xml, and adjusted persistant data file to include a week's worth of data instead of a single day.
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ReportingServices.Dependency_Injections;
|
||||
using ReportingServices.HelperClasses;
|
||||
using ReportingServices.Models.PlanningReport;
|
||||
|
||||
@ -6,19 +7,25 @@ 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)
|
||||
public IActionResult WeeklyPartChangesReport(DateTime startDate, DateTime endDate)
|
||||
{
|
||||
DBCaller caller = new();
|
||||
int numberOfPartChanges = _scrapeDatabaseRepository.GetNumberOfPartChanges(startDate.ToString(), endDate.ToString());
|
||||
List<ReactorPSNWORuns> reactorPSNWORuns = _scrapeDatabaseRepository.GetReactorPSNWORuns(startDate.ToString(), endDate.ToString());
|
||||
|
||||
List<WeeklyPartChanges> weeklyPartChanges = caller.GetWeeklyPartChanges(StartDate.ToString(), EndDate.ToString());
|
||||
ViewBag.NumberOfPartChanges = caller.GetNumberOfPartChanges(StartDate.ToString(), EndDate.ToString());
|
||||
ViewBag.StartDate = StartDate.ToShortDateString();
|
||||
ViewBag.EndDate = EndDate.ToShortDateString();
|
||||
WeeklyPartChanges weeklyPartChanges = new WeeklyPartChanges(numberOfPartChanges, startDate.ToShortDateString(),
|
||||
endDate.ToShortDateString(), reactorPSNWORuns);
|
||||
|
||||
return View(weeklyPartChanges);
|
||||
}
|
||||
|
Reference in New Issue
Block a user