First Commit

This commit is contained in:
Daniel Wathen
2022-11-30 13:15:01 -07:00
commit f996dcfb36
105 changed files with 76792 additions and 0 deletions

View File

@ -0,0 +1,27 @@
using Microsoft.AspNetCore.Mvc;
using ReportingServices.Models;
using System.Diagnostics;
namespace ReportingServices.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
public IActionResult Index()
{
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
}

View File

@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Mvc;
using ReportingServices.HelperClasses;
using ReportingServices.Models.PlanningReport;
namespace ReportingServices.Controllers
{
public class PlanningReportController : Controller
{
public IActionResult Index()
{
return View();
}
public IActionResult WeeklyPartChangesReport(DateTime StartDate, DateTime EndDate)
{
DBCaller caller = new();
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();
return View(weeklyPartChanges);
}
}
}

View File

@ -0,0 +1,52 @@
using Microsoft.AspNetCore.Mvc;
using ReportingServices.HelperClasses;
using ReportingServices.Models.ProductionReport;
using ReportingServices.ReportingObjects;
namespace ReportingServices.Controllers
{
public class ProductionReportController : Controller
{
public IActionResult Index()
{
return View();
}
public IActionResult DailyReport()
{
APICaller caller = new APICaller();
caller.CallAllAPIs();
DailyReport dailyReport = new DailyReport(caller.OutsByDay, caller.ScrapByDay, caller.ToolAvailibilityByTypes, caller.ToolStateByTypes);
return View(dailyReport);
}
public IActionResult EditDailyReport()
{
XMLReader xmlReader = new XMLReader();
DailyReportingSummary rpt = xmlReader.LoadJSONFile();
return View(rpt);
}
[HttpPost]
public IActionResult EditDailyReport(DailyReportingSummary rpt)
{
XMLReader xmlReader = new XMLReader();
//xmlReader.SaveXMLFile(rpt);
xmlReader.SaveJSONFile(rpt);
return RedirectToAction("DailyReport");
}
public IActionResult Headcount()
{
return View();
}
}
}