Clent Add Employee Change to authorizedCanceled
This commit is contained in:
@@ -157,9 +157,10 @@ namespace ServiceHost.Areas.Client.Pages.Company.Employees
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetEmployeeDetailsWithNationalCode(string nationalCode,string birthDate)
|
||||
public async Task<IActionResult> OnGetEmployeeDetailsWithNationalCode(string nationalCode,string birthDate, bool authorizedCanceled)
|
||||
{
|
||||
var result = await _employeeApplication.ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(nationalCode, birthDate, _workshopId);
|
||||
|
||||
var result = await _employeeApplication.ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(nationalCode, birthDate, authorizedCanceled, _workshopId);
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="AuthorizedCanceled" class="col-12 p-2 disable">
|
||||
<div id="AuthorizedCanceled" class="col-12 p-2">
|
||||
<input id="authorizedCheckboxInput" type="checkbox"/>
|
||||
<label>ثبت مشخصات پرسنل بدون احراز هویت</label>
|
||||
|
||||
|
||||
@@ -777,9 +777,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetEmployeeDetailsWithNationalCode(string nationalCode, string birthDate)
|
||||
public async Task<IActionResult> OnGetEmployeeDetailsWithNationalCode(string nationalCode, string birthDate, bool? authorizedCanceled = null)
|
||||
{
|
||||
var result = await _employeeApplication.ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(nationalCode, birthDate, _workshopId);
|
||||
var result = await _employeeApplication.ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(nationalCode, birthDate,false, _workshopId);
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -546,11 +546,11 @@ namespace ServiceHost.Areas.Client.Pages
|
||||
return new JsonResult(jobViewModels);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetEmployeeDetailsWithNationalCode(string nationalCode, string birthDate)
|
||||
public async Task<IActionResult> OnGetEmployeeDetailsWithNationalCode(string nationalCode, string birthDate, bool? authorizedCanceled = null)
|
||||
{
|
||||
var workshopSlug = User.FindFirst("WorkshopSlug")?.Value;
|
||||
long workshopIDecrypt = _passwordHasher.SlugDecrypt(workshopSlug);
|
||||
var result = await _employeeApplication.ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(nationalCode, birthDate, workshopIDecrypt);
|
||||
var result = await _employeeApplication.ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(nationalCode, birthDate,false, workshopIDecrypt);
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,14 +69,14 @@ $(document).ready(function () {
|
||||
function checkInputs() {
|
||||
const genderSelected = $(".genderStatus:checked").length > 0;
|
||||
const maritalStatusSelected = $(".maritalStatus:checked").length > 0;
|
||||
|
||||
const nationality = $("#NationalitySelect").val();
|
||||
;
|
||||
const nationality = $('#NationalitySelect option:selected').length > 0;
|
||||
const fName = $("#firstName").val();
|
||||
const lName = $("#lastName").val();
|
||||
const startWork = $("#startWork").val().trim();
|
||||
const startWorkIsValidDate = /^\d{4}[-\/]\d{2}[-\/]\d{2}$/.test(startWork);
|
||||
const semat = $("#sematSelect").val();
|
||||
debugger;
|
||||
|
||||
let isEmpty = false;
|
||||
|
||||
if (!genderSelected || !maritalStatusSelected || !nationality || !fName || !lName || !startWork || !startWorkIsValidDate || semat === "0") {
|
||||
@@ -88,6 +88,11 @@ function checkInputs() {
|
||||
validateField(".validMariage", "لطفا وضعیت تاهل را مشخص کنید.");
|
||||
return false;
|
||||
}
|
||||
debugger;
|
||||
if (!nationality) {
|
||||
validateField("#NationalitySelect", "لطفا ملیت را مشخص نمایید.");
|
||||
return false;
|
||||
}
|
||||
if (!$("input[name='Command.Gender']:checked").val()) {
|
||||
validateField(".validGender", "لطفا جنسیت را مشخص کنید.");
|
||||
return false;
|
||||
|
||||
@@ -186,6 +186,14 @@ $(document).ready(function () {
|
||||
|
||||
next() {
|
||||
if (goToStep2) {
|
||||
if ($('#authorizedCheckboxInput').is(':checked')) {
|
||||
$('#nationalCodeS2Section').removeClass('disable');
|
||||
$('#birthDateS2Section').removeClass('disable');
|
||||
$('#nameS2Section').removeClass('disable');
|
||||
$('#fNameS2Section').removeClass('disable');
|
||||
$('.disablemightBeNullDB1').removeClass('disable');
|
||||
}
|
||||
|
||||
this.modal.setState(this.modal.step2);
|
||||
}
|
||||
}
|
||||
@@ -454,7 +462,17 @@ function saveFullData() {
|
||||
|
||||
formData.append("Command.CreateCustomizeEmployeeSettings.FridayWork", $('#Friday1').prop('checked') ? "Default" : "WorkInFriday");
|
||||
formData.append("Command.CreateCustomizeEmployeeSettings.HolidayWork", $('#HolidayWork1').prop('checked') ? "Default" : "WorkInHolidays");
|
||||
var authorizedCanceled = false;
|
||||
if ($('#authorizedCheckboxInput').is(':checked')) {
|
||||
//$('#nationalCodeS2Section').removeClass('disable');
|
||||
//$('#birthDateS2Section').removeClass('disable');
|
||||
//$('#nameS2Section').removeClass('disable');
|
||||
//$('#fNameS2Section').removeClass('disable');
|
||||
//$('.disablemightBeNullDB1').removeClass('disable');
|
||||
|
||||
formData.append("Command.CanceledAuthorize", true)
|
||||
|
||||
}
|
||||
let pic1 = $("#pic1").attr('src');
|
||||
let pic2 = $("#pic2").attr('src');
|
||||
if (pic1) formData.append("Command.RollCallUploadEmployeePicture.Picture1", pic1);
|
||||
|
||||
@@ -82,12 +82,24 @@ function checkNationalCode(nationalCode, birthDate) {
|
||||
checkNationalUrl = getEmployeeDataByNationalCodeUrl;
|
||||
}
|
||||
|
||||
var authorizedCanceled = false;
|
||||
if ($('#authorizedCheckboxInput').is(':checked')) {
|
||||
//$('#nationalCodeS2Section').removeClass('disable');
|
||||
//$('#birthDateS2Section').removeClass('disable');
|
||||
//$('#nameS2Section').removeClass('disable');
|
||||
//$('#fNameS2Section').removeClass('disable');
|
||||
//$('.disablemightBeNullDB1').removeClass('disable');
|
||||
|
||||
authorizedCanceled = true;
|
||||
|
||||
}
|
||||
|
||||
$("#IdentityLoading").show();
|
||||
$.ajax({
|
||||
async: false,
|
||||
url: checkNationalUrl,
|
||||
method: "GET",
|
||||
data: { nationalCode: nationalCode, birthDate: birthDate },
|
||||
data: { nationalCode: nationalCode, birthDate: birthDate, authorizedCanceled: authorizedCanceled },
|
||||
success: (response) => {
|
||||
if (response.isSuccedded) {
|
||||
if (response.data) {
|
||||
|
||||
Reference in New Issue
Block a user