Ready to test Max RDS
This commit is contained in:
@ -82,6 +82,8 @@ public class ExportController : Controller
|
||||
ModelState.AddModelError("Exception", ex.Message);
|
||||
string errorMessage = $"Error exporting: {ex}";
|
||||
_Logger.LogError(message: errorMessage);
|
||||
MonIn monIn = MonIn.GetInstance();
|
||||
_ = monIn.SendStatus(_AppSettings.MonASite, _AppSettings.MonAResource, "Heartbeat", State.Warning);
|
||||
}
|
||||
}
|
||||
return View("Index", model);
|
||||
|
@ -4,18 +4,21 @@ using OI.Metrology.Archive.Models;
|
||||
using OI.Metrology.Shared.Repositories;
|
||||
using OI.Metrology.Shared.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using IO = System.IO;
|
||||
|
||||
namespace OI.Metrology.Archive.Controllers;
|
||||
|
||||
public class PagesController : Controller
|
||||
{
|
||||
private readonly IMetrologyRepo _Repo;
|
||||
private readonly bool _IsTestDatabase;
|
||||
private readonly IRdsMaxRepo _RdsMaxRepo;
|
||||
private readonly IMetrologyRepo _MetrologyRepo;
|
||||
|
||||
public PagesController(AppSettings appSettings, IMetrologyRepo repo)
|
||||
public PagesController(AppSettings appSettings, IMetrologyRepo metrologyRepo, IRdsMaxRepo rdsMaxRepo)
|
||||
{
|
||||
_Repo = repo;
|
||||
_RdsMaxRepo = rdsMaxRepo;
|
||||
_MetrologyRepo = metrologyRepo;
|
||||
_IsTestDatabase = appSettings.ConnectionString.Contains("test", StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
@ -33,7 +36,8 @@ public class PagesController : Controller
|
||||
[HttpGet]
|
||||
[Route("/AwaitingDispo")]
|
||||
[Route("/Metrology/AwaitingDispo")]
|
||||
public IActionResult AwaitingDispo() => View();
|
||||
public IActionResult AwaitingDispo() =>
|
||||
View();
|
||||
|
||||
[HttpGet]
|
||||
[Route("/RunInfo")]
|
||||
@ -48,7 +52,7 @@ public class PagesController : Controller
|
||||
};
|
||||
if (headerid > 0)
|
||||
{
|
||||
m.HeaderAttachmentID = _Repo.GetHeaderAttachmentID(tooltypeid, headerid);
|
||||
m.HeaderAttachmentID = _MetrologyRepo.GetHeaderAttachmentID(tooltypeid, headerid);
|
||||
}
|
||||
return View(m);
|
||||
}
|
||||
@ -56,11 +60,13 @@ public class PagesController : Controller
|
||||
[HttpGet]
|
||||
[Route("/RunHeaders")]
|
||||
[Route("/Metrology/RunHeaders")]
|
||||
public IActionResult RunHeaders() => View();
|
||||
public IActionResult RunHeaders() =>
|
||||
View();
|
||||
|
||||
[HttpGet]
|
||||
[Route("/Crash")]
|
||||
public IActionResult Crash() => throw new Exception("Test unhandled exception");
|
||||
public IActionResult Crash() =>
|
||||
throw new Exception("Test unhandled exception");
|
||||
|
||||
[HttpGet]
|
||||
[Route("/Step1")]
|
||||
@ -72,33 +78,48 @@ public class PagesController : Controller
|
||||
_ = IO.Directory.CreateDirectory(directory);
|
||||
string[] model = new string[] { mod, equipment, layer, zone, rds, initials };
|
||||
if (!string.IsNullOrEmpty(initials))
|
||||
IO.File.WriteAllLines(IO.Path.Combine(directory, $"{DateTime.Now.Ticks}.rsv"), model);
|
||||
IO.File.WriteAllLines(IO.Path.Combine(directory, $"{DateTime.Now.Ticks}-{initials}.rsv"), model);
|
||||
return View(model);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Route("/Step2")]
|
||||
[Route("/Metrology/Step2")]
|
||||
public IActionResult Step2(string mod) => View(new string[] { mod });
|
||||
public IActionResult Step2(string mod) =>
|
||||
View(new string[] { mod });
|
||||
|
||||
[HttpGet]
|
||||
[Route("/Step3")]
|
||||
[Route("/Metrology/Step3")]
|
||||
public IActionResult Step3(string mod, string equipment) => View(new string[] { mod, equipment });
|
||||
public IActionResult Step3(string mod, string equipment) =>
|
||||
View(new string[] { mod, equipment });
|
||||
|
||||
[HttpGet]
|
||||
[Route("/Step4")]
|
||||
[Route("/Metrology/Step4")]
|
||||
public IActionResult Step4(string mod, string equipment, string layer) => View(new string[] { mod, equipment, layer });
|
||||
public IActionResult Step4(string mod, string equipment, string layer) =>
|
||||
View(new string[] { mod, equipment, layer });
|
||||
|
||||
[HttpGet]
|
||||
[Route("/Step5")]
|
||||
[Route("/Metrology/Step5")]
|
||||
public IActionResult Step5(string mod, string equipment, string layer, string zone) => View(new string[] { mod, equipment, layer, zone });
|
||||
public IActionResult Step5(string mod, string equipment, string layer, string zone) =>
|
||||
View(new string[] { mod, equipment, layer, zone });
|
||||
|
||||
[HttpGet]
|
||||
[Route("/Step6")]
|
||||
[Route("/Metrology/Step6")]
|
||||
public IActionResult Step6(string mod, string equipment, string layer, string zone, string rds) => View(new string[] { mod, equipment, layer, zone, rds });
|
||||
public IActionResult Step6(string mod, string equipment, string layer, string zone, string rds) =>
|
||||
View(new string[] { mod, equipment, layer, zone, rds });
|
||||
|
||||
[HttpGet]
|
||||
[Route("/RdsMax")]
|
||||
[Route("/Metrology/RdsMax")]
|
||||
public IActionResult RdsMax()
|
||||
{
|
||||
Shared.DataModels.RDS.Max[] collection = _RdsMaxRepo.GetMaxRDS();
|
||||
List<string[]> results = _RdsMaxRepo.Convert(collection);
|
||||
return View(results);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user