Added ControllerExtensions to be used instead of HtmlViewRenderer for net8

Added HttpException class for missing HttpException for net8

Wrapped HttpContext.Session, GetJsonResult, IsAjaxRequest and GetUserIdentityName in controllers for net8

Added AuthenticationService to test Fab2ApprovalMKLink code for net8

Compile conditionally flags to debug in dotnet core
This commit is contained in:
2025-05-19 13:29:54 -07:00
parent 8bae94de96
commit 83789cdd91
89 changed files with 3939 additions and 1455 deletions

View File

@ -33,7 +33,7 @@
</div>
<div id="alltasklistdiv" class="k-content" style="font-size: 11px;">
@if ((bool)Session[GlobalVars.IS_ADMIN])
@if (GlobalVars.IsAdmin(Session))
{
@(Html.Kendo().Grid<Fab2ApprovalSystem.ViewModels.IssuesViewModel>()
.Name("alltasklist")

View File

@ -38,7 +38,7 @@
columns.Bound(l => l.D8DueDate).Format("{0:MM/dd/yy}");
columns.Bound(l => l.NextDueDate).Format("{0:MM/dd/yy}");
columns.Bound(l => l.ClosedDate).Format("{0:MM/dd/yy}");
if ((bool)Session[GlobalVars.IS_ADMIN])
if (GlobalVars.IsAdmin(Session))
columns.Template(t => { }).HeaderTemplate("").ClientTemplate(@"<a href='javascript: void(0)' class='abutton delete' onclick='deleteRowCA(this)' title='button delete'>button delete</a>");
})

View File

@ -33,7 +33,7 @@
</div>
<div id="ecnTasklistdiv" class="k-content" style="font-size: 11px;">
@if ((bool)Session[GlobalVars.IS_ADMIN])
@if (GlobalVars.IsAdmin(Session))
{
@(Html.Kendo().Grid<Fab2ApprovalSystem.ViewModels.IssuesViewModel>()
.Name("ecnTasklist")

View File

@ -26,7 +26,7 @@
<ul class="nav navbar-nav" id="myTab">
<li><a href=@Url.Action("Index", "Home", new {tabName = "MyTasks"})>My Tasks</a></li>
<li><a href=@Url.Action("Index", "Home", new { tabName = "AllTasks" })>All Documents</a></li>
@*<li><a href=@Url.Action("ViewMyTrainingAssignments", "Training", new { userID = (int)Session[GlobalVars.SESSION_USERID] })>My Training</a></li>*@
@*<li><a href=@Url.Action("ViewMyTrainingAssignments", "Training", new { userID = GlobalVars.GetUserId(Session) })>My Training</a></li>*@
@*<li><a href=@Url.Action("SpecialWorkRequestList", "Home", new { tabName = "AllTasks" })>Special Work Requests</a></li>*@
@*<li><a href="file:////temirwfp001.irworld.irf.com/UserData/QA/CommonRO/Projects/AVI Tool/">AVI Tool</a></li>*@
<li class="dropdown">
@ -44,7 +44,7 @@
@*<div class="form-group">
<input type="text" class="form-control" placeholder="Search" style="font-size: 11px">
</div>*@
@if (!(bool)Session[GlobalVars.OOO])
@if (!GlobalVars.IsOOO(Session))
{
<button class="btn btn-default btn-primary" data-toggle="modal" id="OOO">Out Of Office</button>
}
@ -170,7 +170,7 @@
</div>
<div id="alltasklistdiv" class="k-content" style="font-size: 11px;">
@if ((bool)Session[GlobalVars.IS_ADMIN])
@if (GlobalVars.IsAdmin(Session))
{
@(Html.Kendo().Grid<Fab2ApprovalSystem.ViewModels.IssuesViewModel>()
.Name("alltasklist")
@ -427,7 +427,7 @@
var issueID="";
var docType = "";
var submitdate = "";
var userName = "@Session[@GlobalVars.SESSION_USERNAME].ToString()";
var userName = '@GlobalVars.GetUserName(Session)';
$(document).ready(function () {
})
@ -450,7 +450,7 @@
window.location.href = url.replace('__id__', issueID);
})*@
var userid = @Session[@GlobalVars.SESSION_USERID].ToString()
var userid = @GlobalVars.GetUserId(Session);
$("#IncludeAllDocuments").on("click", function () {

View File

@ -34,7 +34,7 @@
</div>
<div id="LotDispoTasklistdiv" class="k-content" style="font-size: 11px;">
@if ((bool)Session[GlobalVars.IS_ADMIN])
@if (GlobalVars.IsAdmin(Session))
{
@(Html.Kendo().Grid<Fab2ApprovalSystem.ViewModels.IssuesViewModel>()
.Name("LotDispoTasklist")

View File

@ -32,7 +32,7 @@
<table class="pull-right">
<tr>
<td class="pull-right">
@if ((bool)Session[GlobalVars.IS_ADMIN])
@if (GlobalVars.IsAdmin(Session))
{
@(Html.Kendo().Upload()
.Name("AddQDBFlag")
@ -45,7 +45,7 @@
}
</td>
<td class="pull-right">
@if ((bool)Session[GlobalVars.IS_ADMIN])
@if (GlobalVars.IsAdmin(Session))
{
@(Html.Kendo().Upload()
.Name("RemoveQDBFlag")
@ -72,7 +72,7 @@
</div>
<div id="mrbTasklistdiv" class="k-content" style="font-size: 11px;">
@if ((bool)Session[GlobalVars.IS_ADMIN])
@if (GlobalVars.IsAdmin(Session))
{
@(Html.Kendo().Grid<Fab2ApprovalSystem.ViewModels.IssuesViewModel>()
.Name("mrbTasklist")

View File

@ -175,7 +175,7 @@
</div>
@if (Convert.ToBoolean(Session[GlobalVars.CAN_CREATE_PARTS_REQUEST]) && !Convert.ToBoolean(Session[GlobalVars.IS_ADMIN]))
@if (GlobalVars.GetCanCreatePartsRequest(Session) && !GlobalVars.IsAdmin(Session))
{
<br /><br />
<div class="panel-heading" style="background-color:beige">

View File

@ -55,11 +55,11 @@
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
@*<li>@Html.ActionLink("Reports", "Index", "Reports")</li>*@
@if ((bool)@Session[GlobalVars.IS_ADMIN])
@if (@GlobalVars.IsAdmin(Session))
{
<li>@Html.ActionLink("Admin", "Index", "Admin")</li>
}
@if ((bool)@Session[GlobalVars.IS_MANAGER])
@if (GlobalVars.IsManager(Session))
{
<li>@Html.ActionLink("Manager", "Index", "Manager")</li>
}
@ -83,10 +83,10 @@
@*<li><a href=@Url.Action("Create", "LotDisposition")>Lot Dispostion</a></li>*@
@*<li><a href=@Url.Action("Create", "MRB")>Create MRB</a></li>*@
<li><a href=@Url.Action("Create", "ECN")>Create ECN/TECN</a></li>
@if (!string.IsNullOrWhiteSpace(Session["JWT"].ToString())) {
string jwt = Session["JWT"].ToString();
@if (!string.IsNullOrWhiteSpace(GlobalVars.GetJWT(Session))) {
string jwt = GlobalVars.GetJWT(Session);
string encodedJwt = System.Net.WebUtility.UrlEncode(jwt);
string refreshToken = Session["RefreshToken"].ToString();
string refreshToken = GlobalVars.GetRefreshToken(Session);
string encodedRefreshToken = System.Net.WebUtility.UrlEncode(refreshToken);
string wasmClientUrl = Environment.GetEnvironmentVariable("FabApprovalWasmClientUrl") ??
"https://localhost:7255";
@ -106,7 +106,7 @@
@*<li><a href=@Url.Action("Create", "ChangeControl")>Create PCR</a></li>*@
<li><a href=@Url.Action("Create", "Audit")>Create Audit</a></li>
<li><a href=@Url.Action("Create", "CorrectiveAction")>Create Corrective Action</a></li>
@*@if (Convert.ToBoolean(Session[GlobalVars.CAN_CREATE_PARTS_REQUEST]))
@*@if (GlobalVars.GetCanCreatePartsRequest(Session))
{
<li><a href=@Url.Action("Create", "PartsRequest")>Create New/Repair Spare Parts Request</a></li>
}*@
@ -118,7 +118,7 @@
@*<div class="form-group">
<input type="text" class="form-control" placeholder="Search" style="font-size: 11px">
</div>*@
@if (!(bool)Session[GlobalVars.OOO])
@if (!GlobalVars.IsOOO(Session))
{
<button class="btn btn-default btn-primary" data-toggle="modal" id="OOO">Out Of Office</button>
}
@ -144,9 +144,9 @@
menu.Add().Text("My Training").Action("ViewMyTrainingAssignments", "Training");
menu.Add().Text("Training Reports").Action("TrainingReports", "Training");
menu.Add().Text("All Documents").Action("AllDocuments", "Home");
string jwt = Session["JWT"].ToString();
string jwt = GlobalVars.GetJWT(Session);
string encodedJwt = System.Net.WebUtility.UrlEncode(jwt);
string refreshToken = Session["RefreshToken"].ToString();
string refreshToken = GlobalVars.GetRefreshToken(Session);
string encodedRefreshToken = System.Net.WebUtility.UrlEncode(refreshToken);
string wasmClientUrl = Environment.GetEnvironmentVariable("FabApprovalWasmClientUrl") ??
"https://localhost:7255";
@ -279,7 +279,7 @@
var issueID="";
var docType = "";
var submitdate = "";
var userName = "@Session[@GlobalVars.SESSION_USERNAME].ToString()";
var userName = '@GlobalVars.GetUserName(Session)';
$(document).ready(function () {
})
@ -302,7 +302,7 @@
window.location.href = url.replace('__id__', issueID);
})*@
var userid = @Session[@GlobalVars.SESSION_USERID].ToString()
var userid = @GlobalVars.GetUserId(Session);
$("#IncludeAllDocuments").on("click", function () {