Files
Backend-Api/ServiceHost/Areas/Client/Pages/Company/Employees/PaidLeaveList.cshtml
2024-08-24 19:13:34 +03:30

92 lines
3.7 KiB
Plaintext

@model List<CompanyManagment.App.Contracts.Leave.LeaveViewModel>
@{
int i = 1;
}
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th style="font-size: 12px !important;text-align: center">#</th>
<th style="font-size: 12px !important; text-align: center"> تاریخ شروع</th>
<th style="font-size: 12px !important; text-align: center"> تاریخ پایان </th>
<th style="font-size: 12px !important; text-align: center"> نوع مدت مرخصی </th>
<th style="font-size: 12px !important; text-align: center"> مدت زمان<span>(ساعت)</span> </th>
<th style="font-size: 12px !important; width: 20%; text-align: center">عملیات</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td style="font-size: 12px !important; text-align: center">@i </td>
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center">@item.StartLeave </td>
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center">
@item.EndLeave
</td>
<td style="font-size: 12px !important; text-align: center">
@item.PaidLeaveType
</td>
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center">
@item.LeaveHourses
</td>
@{
i++;
}
<td>
<a class="btn btn-warning pull-right m-rl-5 rad"
href="#showmodal=@Url.Page("/Company/Employees/Index", "EditPaidLeave", new { Id = item.Id })">
<i class="fa faSize fa-edit"></i>
</a>
<a href="#" class="btn btn-danger pull-right m-rl-5 fff rad RemoveLeftWork"><i class="fa faSize fa-trash"></i></a>
<div style="display: none">
<input type="hidden" name="LeftworkId" value="@item.Id" />
</div>
</td>
</tr>
}
</tbody>
</table>
<script>
$('.RemoveLeftWork').on("click",
function () {
var id = $(this).closest("div").find("input[name='LeftworkId']").val();
$('#LeftId').val(id);
swal({
title: "آیا حذف این سابقه مرخصی اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: true,
closeOnCancel: true
}, function (isConfirm) {
if (isConfirm) {
$('#RemoveForm').submit();
}
});
});
$('#RemoveForm').submit(function(e){
e.preventDefault();
e.stopImmediatePropagation();
$.ajax({
type: "POST",
url: $(this).attr( 'action' ),
data: $(this).serialize(),
success: function (response) {
if (response.isSuccedded == true) {
$.Notification.autoHideNotify('success', 'top right', response.message);
reloadSickLeaveList();
}
else{
$.Notification.autoHideNotify('error', 'top right', response.message);
}
}
});
return false;
});
</script>