First Commit
This commit is contained in:
27
ReportingServices/Controllers/HomeController.cs
Normal file
27
ReportingServices/Controllers/HomeController.cs
Normal 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 });
|
||||
}
|
||||
}
|
||||
}
|
26
ReportingServices/Controllers/PlanningReportController.cs
Normal file
26
ReportingServices/Controllers/PlanningReportController.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
52
ReportingServices/Controllers/ProductionReportController.cs
Normal file
52
ReportingServices/Controllers/ProductionReportController.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user