53 lines
1.3 KiB
C#
53 lines
1.3 KiB
C#
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();
|
|
}
|
|
}
|
|
}
|