Moved System.IO references from DMO classes to Static Helpers

Removed nugetSource from pipeline
Removed more comments
Created Static Classes for most DMO / Controller Classes
Push ConfigurationManager.AppSettings to controller
Align Tests with other Projects
This commit is contained in:
2024-12-11 09:29:01 -07:00
parent b1c6903c1c
commit b99b721458
86 changed files with 2961 additions and 4432 deletions

View File

@ -1,19 +1,22 @@
using Fab2ApprovalSystem.DMO;
using Fab2ApprovalSystem.Misc;
using Fab2ApprovalSystem.ViewModels;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Fab2ApprovalSystem.DMO;
using Fab2ApprovalSystem.Misc;
using Fab2ApprovalSystem.Models;
using Fab2ApprovalSystem.ViewModels;
namespace Fab2ApprovalSystem.Controllers;
[Authorize]
[SessionExpireFilter]
public class ReportsController : Controller {
public const String specialNullString = "~NULL~";
private readonly AppSettings _AppSettings = GlobalVars.AppSettings;
// GET: Export
public ActionResult Index() {
@ -84,14 +87,14 @@ public class ReportsController : Controller {
public SSRSHelper.SSRSClient SetupSSRSHelperClient() {
var useCfgForBindings = false;
if (String.Equals(System.Configuration.ConfigurationManager.AppSettings["SSRSBindingsByConfiguration"], "true", StringComparison.OrdinalIgnoreCase))
if (String.Equals(_AppSettings.SSRSBindingsByConfiguration, "true", StringComparison.OrdinalIgnoreCase))
useCfgForBindings = true;
var c = new SSRSHelper.SSRSClient(
Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SSRSBaseURL"]),
Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SSRSDomain"]),
Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SSRSUsername"]),
Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SSRSPassword"]),
Convert.ToString(_AppSettings.SSRSBaseURL),
Convert.ToString(_AppSettings.SSRSDomain),
Convert.ToString(_AppSettings.SSRSUsername),
Convert.ToString(_AppSettings.SSRSPassword),
useCfgForBindings);
c.Initialize();
@ -99,7 +102,7 @@ public class ReportsController : Controller {
}
private IEnumerable<SSRSHelper.ReportInfo> GetReportList(String docType) {
String folderName = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["SSRSFolder"]);
String folderName = Convert.ToString(_AppSettings.SSRSFolder);
if (folderName.EndsWith("/"))
folderName = folderName.TrimEnd('/');
if (!String.IsNullOrWhiteSpace(docType))
@ -181,7 +184,7 @@ public class ReportsController : Controller {
protected String MakeFilename(String reportName) {
String r = "";
var invalidChars = System.IO.Path.GetInvalidFileNameChars();
char[] invalidChars = System.IO.Path.GetInvalidFileNameChars();
foreach (char c in reportName) {
if (invalidChars.Contains(c))
r += '_';