Training report excludes OOO users
This commit is contained in:
parent
33599e51e8
commit
6ea927045f
@ -15,6 +15,8 @@ using System.Configuration;
|
|||||||
|
|
||||||
namespace Fab2ApprovalSystem.Controllers
|
namespace Fab2ApprovalSystem.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[SessionExpireFilter]
|
[SessionExpireFilter]
|
||||||
public class TrainingController : Controller
|
public class TrainingController : Controller
|
||||||
@ -716,35 +718,38 @@ namespace Fab2ApprovalSystem.Controllers
|
|||||||
string userEmail = userDMO.GetUserByID(user.UserId).Email;
|
string userEmail = userDMO.GetUserByID(user.UserId).Email;
|
||||||
emailList.Add(userEmail);
|
emailList.Add(userEmail);
|
||||||
}
|
}
|
||||||
//emailList.Add("Jonathan.Ouellette@infineon.com");
|
//emailList.Add("Chase.Tucker@infineon.com");
|
||||||
//Get a list of open trainings
|
//Get a list of open trainings
|
||||||
List<Training> openTrainings = trainingDMO.GetAllOpenTrainings();
|
List<Training> openTrainings = trainingDMO.GetAllOpenTrainings();
|
||||||
|
|
||||||
foreach (Training training in openTrainings)
|
foreach (Training training in openTrainings)
|
||||||
{
|
{
|
||||||
|
string trainingSection = "";
|
||||||
|
int trainingSectionUserCount = 0;
|
||||||
string ecnTitle = ecnDMO.GetECN(training.ECN).Title;
|
string ecnTitle = ecnDMO.GetECN(training.ECN).Title;
|
||||||
emailBody += "<h3>" + training.ECN + " - " + ecnTitle + "</h3>";
|
trainingSection += "<h3>" + training.ECN + " - " + ecnTitle + "</h3>";
|
||||||
|
|
||||||
emailBody += "<table>";
|
trainingSection += "<table>";
|
||||||
emailBody += "<tr><th>Name</th><th>Date Assigned</th><th>Out of Office</th></tr>";
|
trainingSection += "<tr><th>Name</th><th>Date Assigned</th></tr>";
|
||||||
List<TrainingAssignment> openAssignments = trainingDMO.GetOpenAssignmentsByTrainingID(training.TrainingID);
|
List<TrainingAssignment> openAssignments = trainingDMO.GetOpenAssignmentsByTrainingID(training.TrainingID);
|
||||||
foreach (TrainingAssignment assignment in openAssignments)
|
foreach (TrainingAssignment assignment in openAssignments)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (!userDMO.GetUserByID(assignment.UserID).OOO)
|
||||||
|
{
|
||||||
|
trainingSectionUserCount++;
|
||||||
|
|
||||||
DateTime? assignmentDate = assignment.DateAssigned;
|
DateTime? assignmentDate = assignment.DateAssigned;
|
||||||
|
|
||||||
string DateAssigned = assignmentDate.HasValue ? assignmentDate.Value.ToString("MM/dd/yyyy") : "<not available>";
|
string DateAssigned = assignmentDate.HasValue ? assignmentDate.Value.ToString("MM/dd/yyyy") : "<not available>";
|
||||||
|
|
||||||
emailBody += "<tr><td>" + assignment.FullName + "</td><td>" + DateAssigned + "</td>";
|
trainingSection += "<tr><td>" + assignment.FullName + "</td><td>" + DateAssigned + "</td>";
|
||||||
|
|
||||||
if (userDMO.GetUserByID(assignment.UserID).OOO)
|
|
||||||
emailBody += "<td style=\"text-align:center;\">X</td>";
|
|
||||||
else
|
|
||||||
emailBody += "<td></td>";
|
|
||||||
|
|
||||||
emailBody += "</tr>";
|
|
||||||
|
|
||||||
|
trainingSection += "</tr>";
|
||||||
}
|
}
|
||||||
emailBody += "</table>";
|
}
|
||||||
|
trainingSection += "</table>";
|
||||||
|
if (trainingSectionUserCount > 0) emailBody += trainingSection;
|
||||||
}
|
}
|
||||||
string recipientEmail = "";
|
string recipientEmail = "";
|
||||||
List<string> ccRecipients = emailList;
|
List<string> ccRecipients = emailList;
|
||||||
|
@ -426,6 +426,8 @@
|
|||||||
<Content Include="Models\FabApproval.edmx.diagram">
|
<Content Include="Models\FabApproval.edmx.diagram">
|
||||||
<DependentUpon>FabApproval.edmx</DependentUpon>
|
<DependentUpon>FabApproval.edmx</DependentUpon>
|
||||||
</Content>
|
</Content>
|
||||||
|
<None Include="Properties\PublishProfiles\ChaseDesktopDebug.pubxml" />
|
||||||
|
<None Include="Properties\PublishProfiles\ChaseDesktopRelease.pubxml" />
|
||||||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
|
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
|
||||||
<None Include="Properties\PublishProfiles\MesaDeploy.pubxml" />
|
<None Include="Properties\PublishProfiles\MesaDeploy.pubxml" />
|
||||||
<Content Include="Scripts\excel-bootstrap-table-filter-bundle.js.map" />
|
<Content Include="Scripts\excel-bootstrap-table-filter-bundle.js.map" />
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<DeleteExistingFiles>true</DeleteExistingFiles>
|
||||||
|
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||||
|
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||||
|
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
|
||||||
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
|
<PublishProvider>FileSystem</PublishProvider>
|
||||||
|
<PublishUrl>C:\Users\tuckerc\Desktop\FabApprovalDeployments-Debug</PublishUrl>
|
||||||
|
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||||
|
<_TargetId>Folder</_TargetId>
|
||||||
|
<SiteUrlToLaunchAfterPublish />
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<DeleteExistingFiles>true</DeleteExistingFiles>
|
||||||
|
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||||
|
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||||
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
|
<PublishProvider>FileSystem</PublishProvider>
|
||||||
|
<PublishUrl>C:\Users\tuckerc\Desktop\FabApprovalDeployments-Release</PublishUrl>
|
||||||
|
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||||
|
<_TargetId>Folder</_TargetId>
|
||||||
|
<SiteUrlToLaunchAfterPublish />
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
Loading…
x
Reference in New Issue
Block a user