mesa-fab-approval/Fab2ApprovalSystem/Views/Training/ViewTrainingPartial.cshtml
Jonathan Ouellette 580e90f6a2 initial add
2022-09-27 14:10:30 -07:00

104 lines
2.8 KiB
Plaintext

@model IEnumerable<Fab2ApprovalSystem.Models.TrainingAssignment>
<input type="hidden" value="@ViewBag.ECNNumber" id="ECNNumber"/>
<table class="table">
<tr>
<th>
Name
</th>
<th>
Date Assigned
</th>
<th>
Date Completed
</th>
<th>
Status
</th>
<th></th>
</tr>
@foreach (var item in Model) {
if (item.UserID.ToString() == Session[GlobalVars.SESSION_USERID].ToString() || Session[GlobalVars.IS_ADMIN] != null)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.FullName)
</td>
<td>
@Html.DisplayFor(modelItem => item.DateAssigned)
</td>
<td>
@Html.DisplayFor(modelItem => item.DateCompleted)
</td>
@if (item.status == true)
{
<td>Acknowledged</td>
}
else
{
<td>Not Acknowledged</td>
}
<td>
<button type="button" class="btn btn-default" id="CompleteTraining" onclick="CompleteTraining(@item.ID)">Complete Training</button>
</td>
</tr>
}
}
</table>
@foreach (var item in Model)
{
<div class="modal fade" id="DocumentWin" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel">Review Affected Documents - </h4>
</div>
<div class="modal-body" id="docsDisplay">
@{Html.RenderAction("ViewTrainingDocsPartial", "Training", new { trainingAssignmentId = item.ID});}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
}
<script type="text/javascript">
function CompleteTraining(AssignmentID) {
$("#DocumentWin").modal('show');
}
$('#CompleteTraining').on('click', function () {
$("#DocumentWin").modal('show');
//GetDocuments();
return false;
})
function GetDocuments() {
var ecnNumber = document.getElementById('ECNNumber').value;
var sendInfo = {
ecnNumber: ecnNumber
};
$.ajax({
type: "POST",
url: "/ECN/Attachment_Read",
contentType: "application/json; charset=utf-8",
data: JSON.stringify(sendInfo),
dataType: "json",
success: function (r) {
//var json = $.parseJSON(r);
alert('Success');
RefreshData();
},
error: function (req, status, error) {
alert(error);
}
});
}
</script>