Compare commits
10 Commits
f6ced73b9f
...
7cc645c188
Author | SHA1 | Date | |
---|---|---|---|
|
7cc645c188 | ||
|
fbeb8b3cf7 | ||
|
27728bd0c4 | ||
|
7330647172 | ||
|
167db67027 | ||
|
9c5c938157 | ||
|
989d0f401e | ||
|
15c7a15b8e | ||
|
7e4a17845c | ||
|
1f96c01a5b |
@ -11,7 +11,7 @@ using System.Web.Mvc;
|
||||
using Kendo.Mvc.Extensions;
|
||||
using Fab2ApprovalSystem.Misc;
|
||||
using System.Configuration;
|
||||
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Fab2ApprovalSystem.Controllers
|
||||
{
|
||||
@ -762,68 +762,6 @@ namespace Fab2ApprovalSystem.Controllers
|
||||
}
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
public bool RunOOOTrainingReport()
|
||||
{
|
||||
bool isSuccess = false;
|
||||
try
|
||||
{
|
||||
string emailBody = "<h1>Mesa Approval Open Training Assignments Report - OOO</h1> <br />";
|
||||
emailBody += "<p>The following contains open training assignments in the Mesa Approval system for out of office users.";
|
||||
emailBody += " Please ensure they complete their training assignments promptly upon their return.</p><br />";
|
||||
emailBody += "<style>table,th,td{border: 1px solid black;}</style>";
|
||||
//Get all users set up to receive the training report email.
|
||||
List<TrainingReportUser> trainingReportUsers = adminDMO.GetTrainingReportUsers();
|
||||
List<string> emailList = new List<string>();
|
||||
//foreach (var user in trainingReportUsers)
|
||||
//{
|
||||
// string userEmail = userDMO.GetUserByID(user.UserId).Email;
|
||||
// emailList.Add(userEmail);
|
||||
//}
|
||||
emailList.Add("Chase.Tucker@infineon.com");
|
||||
//Get a list of open trainings
|
||||
List<Training> openTrainings = trainingDMO.GetAllOpenTrainings();
|
||||
|
||||
foreach (Training training in openTrainings)
|
||||
{
|
||||
string trainingSection = "";
|
||||
int trainingSectionUserCount = 0;
|
||||
string ecnTitle = ecnDMO.GetECN(training.ECN).Title;
|
||||
trainingSection += "<h3>" + training.ECN + " - " + ecnTitle + "</h3>";
|
||||
|
||||
trainingSection += "<table>";
|
||||
trainingSection += "<tr><th>Name</th><th>Date Assigned</th></tr>";
|
||||
List<TrainingAssignment> openAssignments = trainingDMO.GetOpenAssignmentsByTrainingID(training.TrainingID);
|
||||
foreach (TrainingAssignment assignment in openAssignments)
|
||||
{
|
||||
|
||||
if (userDMO.GetUserByID(assignment.UserID).OOO)
|
||||
{
|
||||
trainingSectionUserCount++;
|
||||
|
||||
DateTime? assignmentDate = assignment.DateAssigned;
|
||||
|
||||
string DateAssigned = assignmentDate.HasValue ? assignmentDate.Value.ToString("MM/dd/yyyy") : "<not available>";
|
||||
|
||||
trainingSection += "<tr><td>" + assignment.FullName + "</td><td>" + DateAssigned + "</td>";
|
||||
|
||||
trainingSection += "</tr>";
|
||||
}
|
||||
}
|
||||
trainingSection += "</table>";
|
||||
if (trainingSectionUserCount > 0) emailBody += trainingSection;
|
||||
}
|
||||
string recipientEmail = "";
|
||||
List<string> ccRecipients = emailList;
|
||||
emailer.SendNotification("MesaFabApproval@infineon.com", ccRecipients, "Mesa Approval Open Training Report - OOO", emailBody, "Open Training Report - OOO");
|
||||
isSuccess = true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
isSuccess = false;
|
||||
}
|
||||
return isSuccess;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -45,15 +45,6 @@ namespace Fab2ApprovalSystem.Controllers
|
||||
{
|
||||
return request.CreateResponse(HttpStatusCode.InternalServerError);
|
||||
}
|
||||
case "TrainingReportOOO":
|
||||
if (trainingFunctions.RunOOOTrainingReport())
|
||||
{
|
||||
return request.CreateResponse(HttpStatusCode.OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
return request.CreateResponse(HttpStatusCode.InternalServerError);
|
||||
}
|
||||
case "CARDueDates":
|
||||
if (carFunctions.ProcessCARDueDates())
|
||||
{
|
||||
|
@ -1,13 +1,13 @@
|
||||
<font size="2" face="verdana">
|
||||
*****Please DO NOT reply to this email*****
|
||||
<br/><br/>
|
||||
Corrective Action# {1} section {3} has been approved.
|
||||
Corrective Action# {0} section {3} has been approved.
|
||||
<br/><br/>
|
||||
|
||||
Please log on to the Approval website to view the section and act accordingly
|
||||
<br/><br/>
|
||||
|
||||
https://messa016ec.ec.local/CorrectiveAction/Edit?issueID={0}
|
||||
https://messa016ec.ec.local/CorrectiveAction/Edit?issueID={1}
|
||||
<br/><br/>
|
||||
|
||||
If you have any questions or trouble logging on please contact a site administrator.
|
||||
|
@ -130,6 +130,7 @@
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="JobSchedules\OOOTrainingReportJobSchedule.cs" />
|
||||
<Compile Include="Misc\DemoHelper.cs" />
|
||||
<Compile Include="Misc\Documentum.cs" />
|
||||
<Compile Include="Misc\EmailNotification.cs" />
|
||||
@ -248,6 +249,7 @@
|
||||
<Compile Include="ViewModels\LTMaterial.cs" />
|
||||
<Compile Include="ViewModels\OOOViewModel.cs" />
|
||||
<Compile Include="ViewModels\ReportsViewModels.cs" />
|
||||
<Compile Include="Jobs\OOOTrainingReportJob.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Content\bootstrap-theme.css" />
|
||||
@ -1966,6 +1968,9 @@
|
||||
<PackageReference Include="Owin">
|
||||
<Version>1.0.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Quartz">
|
||||
<Version>3.7.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Respond">
|
||||
<Version>1.2.0</Version>
|
||||
</PackageReference>
|
||||
|
@ -11,6 +11,7 @@ using System.Web.Security;
|
||||
using System.Configuration;
|
||||
using Fab2ApprovalSystem.DMO;
|
||||
using System.Web.Http;
|
||||
using Fab2ApprovalSystem.JobSchedules;
|
||||
|
||||
namespace Fab2ApprovalSystem
|
||||
{
|
||||
@ -44,9 +45,11 @@ namespace Fab2ApprovalSystem
|
||||
|
||||
//GlobalVars.AttachmentUrl = connectionstring.ToUpper().Contains("TEST") ? @"http://" + DevAttachmentUrl + "/" : @"http://" + ProdAttachmentUrl + "/"; ;
|
||||
|
||||
GlobalVars.hostURL = connectionstring.ToUpper().Contains("TEST") ? @"http://" + DevWebSiteUrl : @"http://" + ProdWebSiteUrl ;
|
||||
|
||||
GlobalVars.hostURL = connectionstring.ToUpper().Contains("TEST") ? @"https://" + DevWebSiteUrl : @"https://" + ProdWebSiteUrl ;
|
||||
|
||||
#if (!DEBUG)
|
||||
OOOTrainingReportJobSchedule.Start();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Fab2ApprovalSystem.Workers;
|
||||
using Quartz.Impl;
|
||||
using Quartz;
|
||||
|
||||
namespace Fab2ApprovalSystem.JobSchedules
|
||||
{
|
||||
public class OOOTrainingReportJobSchedule
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
|
||||
|
||||
IScheduler scheduler = schedulerFactory.GetScheduler().GetAwaiter().GetResult();
|
||||
scheduler.Start();
|
||||
|
||||
IJobDetail oooTrainingReportJob = JobBuilder.Create<OOOTrainingReportJob>()
|
||||
.WithIdentity("oooTrainingReportJob", "trainingReportGroup")
|
||||
.Build();
|
||||
|
||||
ITrigger oooTrainingReportTrigger = TriggerBuilder.Create()
|
||||
.WithIdentity("oooTrainingReportTrigger", "trainingReportGroup")
|
||||
.WithCronSchedule("0 0 12 ? * 2 *")
|
||||
.ForJob(oooTrainingReportJob)
|
||||
.Build();
|
||||
|
||||
scheduler.ScheduleJob(oooTrainingReportJob, oooTrainingReportTrigger);
|
||||
}
|
||||
}
|
||||
}
|
77
Fab2ApprovalSystem/Jobs/OOOTrainingReportJob.cs
Normal file
77
Fab2ApprovalSystem/Jobs/OOOTrainingReportJob.cs
Normal file
@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using Fab2ApprovalSystem.Controllers;
|
||||
using Fab2ApprovalSystem.DMO;
|
||||
using Fab2ApprovalSystem.Models;
|
||||
using Fab2ApprovalSystem.Utilities;
|
||||
using Quartz;
|
||||
|
||||
namespace Fab2ApprovalSystem.Workers
|
||||
{
|
||||
public class OOOTrainingReportJob:IJob
|
||||
{
|
||||
UserAccountDMO userDMO = new UserAccountDMO();
|
||||
AdminDMO adminDMO = new AdminDMO();
|
||||
TrainingDMO trainingDMO = new TrainingDMO();
|
||||
ECN_DMO ecnDMO = new ECN_DMO();
|
||||
public EmailUtilities emailer = new EmailUtilities();
|
||||
|
||||
async Task IJob.Execute(IJobExecutionContext context)
|
||||
{
|
||||
await Task.Run(() => {
|
||||
|
||||
string emailBody = "<h1>Mesa Approval Open Training Assignments Report - OOO</h1> <br />";
|
||||
emailBody += "<p>The following contains open training assignments in the Mesa Approval system for out of office users.";
|
||||
emailBody += " Please ensure they complete their training assignments promptly upon their return.</p><br />";
|
||||
emailBody += "<style>table,th,td{border: 1px solid black;}</style>";
|
||||
//Get all users set up to receive the training report email.
|
||||
List<TrainingReportUser> trainingReportUsers = adminDMO.GetTrainingReportUsers();
|
||||
List<string> emailList = new List<string>();
|
||||
foreach (var user in trainingReportUsers)
|
||||
{
|
||||
string userEmail = userDMO.GetUserByID(user.UserId).Email;
|
||||
emailList.Add(userEmail);
|
||||
}
|
||||
//emailList.Add("Chase.Tucker@infineon.com");
|
||||
//Get a list of open trainings
|
||||
List<Training> openTrainings = trainingDMO.GetAllOpenTrainings();
|
||||
|
||||
foreach (Training training in openTrainings)
|
||||
{
|
||||
string trainingSection = "";
|
||||
int trainingSectionUserCount = 0;
|
||||
string ecnTitle = ecnDMO.GetECN(training.ECN).Title;
|
||||
trainingSection += "<h3>" + training.ECN + " - " + ecnTitle + "</h3>";
|
||||
|
||||
trainingSection += "<table>";
|
||||
trainingSection += "<tr><th>Name</th><th>Date Assigned</th></tr>";
|
||||
List<TrainingAssignment> openAssignments = trainingDMO.GetOpenAssignmentsByTrainingID(training.TrainingID);
|
||||
foreach (TrainingAssignment assignment in openAssignments)
|
||||
{
|
||||
|
||||
if (userDMO.GetUserByID(assignment.UserID).OOO)
|
||||
{
|
||||
trainingSectionUserCount++;
|
||||
|
||||
DateTime? assignmentDate = assignment.DateAssigned;
|
||||
|
||||
string DateAssigned = assignmentDate.HasValue ? assignmentDate.Value.ToString("MM/dd/yyyy") : "<not available>";
|
||||
|
||||
trainingSection += "<tr><td>" + assignment.FullName + "</td><td>" + DateAssigned + "</td>";
|
||||
|
||||
trainingSection += "</tr>";
|
||||
}
|
||||
}
|
||||
trainingSection += "</table>";
|
||||
if (trainingSectionUserCount > 0) emailBody += trainingSection;
|
||||
}
|
||||
string recipientEmail = "";
|
||||
List<string> ccRecipients = emailList;
|
||||
emailer.SendNotification("MesaFabApproval@infineon.com", ccRecipients, "Mesa Approval Open Training Report - OOO", emailBody, "Open Training Report - OOO");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,9 @@
|
||||
using System.Web.Http;
|
||||
using Fab2ApprovalSystem.Workers;
|
||||
using Microsoft.Owin;
|
||||
using Owin;
|
||||
using Quartz;
|
||||
using Quartz.Impl;
|
||||
|
||||
[assembly: OwinStartupAttribute(typeof(Fab2ApprovalSystem.Startup))]
|
||||
namespace Fab2ApprovalSystem
|
||||
@ -10,6 +13,22 @@ namespace Fab2ApprovalSystem
|
||||
protected void Application_Start()
|
||||
{
|
||||
GlobalConfiguration.Configure(WebApiConfig.Register);
|
||||
|
||||
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
|
||||
|
||||
IScheduler scheduler = schedulerFactory.GetScheduler().GetAwaiter().GetResult();
|
||||
|
||||
IJobDetail oooTrainingReportJob = JobBuilder.Create<OOOTrainingReportJob>()
|
||||
.WithIdentity("oooTrainingReportJob", "trainingReportGroup")
|
||||
.Build();
|
||||
|
||||
ITrigger oooTrainingReportTrigger = TriggerBuilder.Create()
|
||||
.WithIdentity("oooTrainingReportTrigger", "trainingReportGroup")
|
||||
.WithCronSchedule("15 13 * * MON")
|
||||
.ForJob(oooTrainingReportJob)
|
||||
.Build();
|
||||
|
||||
scheduler.ScheduleJob(oooTrainingReportJob, oooTrainingReportTrigger);
|
||||
}
|
||||
public void Configuration(IAppBuilder app)
|
||||
{
|
||||
|
@ -2235,10 +2235,6 @@
|
||||
if ($('#D6Validated').is(':checked'))
|
||||
$('#D6Validated').attr("disabled",true);
|
||||
|
||||
if (currentUserId != currentRequestor)
|
||||
$('#D6Validated').attr("disabled", true);
|
||||
|
||||
|
||||
if ($('#D8Completed').is(':checked')) {
|
||||
$('#D8Completed').attr("disabled", true);
|
||||
$('#txtD8TeamRecognition').attr("disabled", true);
|
||||
@ -3174,7 +3170,7 @@
|
||||
})
|
||||
$('#D6Validated').on('change', function () {
|
||||
data = ReturnModelObject();
|
||||
if (currentUserId == data.RequestorID) {
|
||||
if (currentUserId == data.RequestorID || '@ViewBag.Is8DQA' == "true" || '@ViewBag.CanCompleteCA' == "true") {
|
||||
if (!checkCanCompleteCA()) {
|
||||
$('#D6Validated').prop('checked', false);
|
||||
$('#cover-spin').hide(0);
|
||||
@ -3198,7 +3194,7 @@
|
||||
else {
|
||||
|
||||
$('#D6Validated').prop('checked', false);
|
||||
alert('Only the 8D requestor can validate')
|
||||
alert('Only the 8D requestor or QA can validate')
|
||||
$('#cover-spin').hide(0);
|
||||
return;
|
||||
|
||||
|
@ -58,7 +58,7 @@
|
||||
<add key="SPNMRBHoldFlagFTPLogDirectory" value="D:\Websites\SPNMRBHoldFlagFTPLog\" />
|
||||
<add key="LotTempPipeLine" value="D:\Websites\FabApprovalTempPipeLine\" />
|
||||
<add key="DevWebSiteURL" value="mestsa05ec.ec.local:8065" />
|
||||
<add key="ProdWebSiteURL" value="messa016ec.ec.local:8021" />
|
||||
<add key="ProdWebSiteURL" value="messa016ec.ec.local" />
|
||||
<!--<add key="ECDomain" value="TEMSCEC01.ec.local"/>-->
|
||||
<add key="ECDomain" value="ELSSREC01.ec.local" />
|
||||
<add key="ECADGroup" value="EC-MES-ALL-Users-R-L" />
|
||||
|
@ -47,7 +47,8 @@ stages:
|
||||
echo Assembly title: $(AssemblyTitle)
|
||||
displayName: "Echo Check"
|
||||
|
||||
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Restore /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(BuildConfiguration);TargetFrameworkVersion=$(TargetFrameworkVersion) /p:RestoreSources=$(NugetSource) $(AssemblyTitle).csproj'
|
||||
|
||||
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Restore /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(BuildConfiguration);TargetFrameworkVersion=$(TargetFrameworkVersion) /p:RestoreSources=D:/nupkg $(AssemblyTitle).csproj'
|
||||
workingDirectory: Fab2ApprovalSystem
|
||||
displayName: "Framework Restore"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user