49 lines
1.2 KiB
C#
49 lines
1.2 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using OI.Metrology.Shared.Repositories;
|
|
using OI.Metrology.Shared.ViewModels;
|
|
using System;
|
|
|
|
namespace OI.Metrology.Archive.Controllers;
|
|
|
|
//[Authorize]
|
|
public class PagesController : Controller
|
|
{
|
|
protected IMetrologyRepo _Repo;
|
|
|
|
public PagesController(IMetrologyRepo repo) => _Repo = repo;
|
|
|
|
[HttpGet]
|
|
[Route("/")]
|
|
public IActionResult Index() =>
|
|
//return View("Home");
|
|
View("RunHeaders");
|
|
|
|
[HttpGet]
|
|
[Route("/AwaitingDispo")]
|
|
public IActionResult AwaitingDispo() => View();
|
|
|
|
[HttpGet]
|
|
[Route("/RunInfo")]
|
|
public IActionResult RunInfo([FromQuery] int tooltypeid = 1, [FromQuery] int headerid = 0)
|
|
{
|
|
RunInfo m = new()
|
|
{
|
|
ToolTypeID = tooltypeid,
|
|
HeaderID = headerid,
|
|
HeaderAttachmentID = Guid.Empty,
|
|
};
|
|
if (headerid > 0)
|
|
{
|
|
m.HeaderAttachmentID = _Repo.GetHeaderAttachmentID(tooltypeid, headerid);
|
|
}
|
|
return View(m);
|
|
}
|
|
|
|
[HttpGet]
|
|
[Route("/RunHeaders")]
|
|
public IActionResult RunHeaders() => View();
|
|
|
|
[HttpGet]
|
|
[Route("/Crash")]
|
|
public IActionResult Crash() => throw new Exception("Test unhandled exception");
|
|
} |