diff --git a/CompanyManagment.App.Contracts/Employee/EmployeeByNationalCodeInWorkshopViewModel.cs b/CompanyManagment.App.Contracts/Employee/EmployeeByNationalCodeInWorkshopViewModel.cs index 3e4c10e6..4f6dce73 100644 --- a/CompanyManagment.App.Contracts/Employee/EmployeeByNationalCodeInWorkshopViewModel.cs +++ b/CompanyManagment.App.Contracts/Employee/EmployeeByNationalCodeInWorkshopViewModel.cs @@ -17,6 +17,7 @@ public record EmployeeByNationalCodeInWorkshopViewModel public long PersonnelCode { get; set; } public List EmployeeBankInfos { get; set; } public EmployeeByNationalCodeEmployeeDocumentViewModel EmployeeDocument { get; set; } + public bool AuthorizedCanceled { get; set; } } diff --git a/CompanyManagment.Application/EmployeeAplication.cs b/CompanyManagment.Application/EmployeeAplication.cs index 7201bbac..8d1f9e59 100644 --- a/CompanyManagment.Application/EmployeeAplication.cs +++ b/CompanyManagment.Application/EmployeeAplication.cs @@ -1241,6 +1241,11 @@ public class EmployeeAplication : RepositoryBase, IEmployeeAppli if (employee == null) { var personalInfo = await _uidService.GetPersonalInfo(nationalCode, birthDate); + + if (personalInfo.ResponseContext.Status.Code == 14) + { + return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید",new EmployeeByNationalCodeInWorkshopViewModel(){AuthorizedCanceled = true}); + } if (personalInfo.ResponseContext.Status.Code != 0) { return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند"); diff --git a/ServiceHost/Areas/Client/Pages/Company/Employees/_Partials/CreateEmployeeForm.cshtml b/ServiceHost/Areas/Client/Pages/Company/Employees/_Partials/CreateEmployeeForm.cshtml index 2d64b133..cb9a486e 100644 --- a/ServiceHost/Areas/Client/Pages/Company/Employees/_Partials/CreateEmployeeForm.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/Employees/_Partials/CreateEmployeeForm.cshtml @@ -34,7 +34,7 @@
-
+
@@ -45,7 +45,7 @@
-
+
@@ -70,7 +70,7 @@
-
+
@@ -89,7 +89,7 @@
-
+
@@ -111,28 +111,28 @@
-
+
نام پرسنل
-
+
نام خانوادگی پرسنل
-
+
تاریخ شروع بکار
-
+
انتخاب سمت
diff --git a/ServiceHost/Areas/Client/Pages/Company/Employees/_Partials/IdentityInformationForm.cshtml b/ServiceHost/Areas/Client/Pages/Company/Employees/_Partials/IdentityInformationForm.cshtml index 062c0253..ccdc3239 100644 --- a/ServiceHost/Areas/Client/Pages/Company/Employees/_Partials/IdentityInformationForm.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/Employees/_Partials/IdentityInformationForm.cshtml @@ -38,13 +38,19 @@
-
- - -
-
- تاریخ تولد را وارد کنید -
+
+ + +
+
+ تاریخ تولد را وارد کنید +
+
+ +
+ + +
diff --git a/ServiceHost/wwwroot/AssetsClient/pages/Employees/js/IdentityInformationModal.js b/ServiceHost/wwwroot/AssetsClient/pages/Employees/js/IdentityInformationModal.js index 6efa24cd..a59c131b 100644 --- a/ServiceHost/wwwroot/AssetsClient/pages/Employees/js/IdentityInformationModal.js +++ b/ServiceHost/wwwroot/AssetsClient/pages/Employees/js/IdentityInformationModal.js @@ -44,6 +44,8 @@ $(document).ready(function () { lastNationalCode = ""; } }); + + }); function checkNationalCodeAndBirthday() { @@ -82,7 +84,7 @@ function checkNationalCode(nationalCode, birthDate) { $("#IdentityLoading").show(); $.ajax({ - async: false, + //async: false, url: checkNationalUrl, method: "GET", data: { nationalCode: nationalCode, birthDate: birthDate }, @@ -180,7 +182,21 @@ function checkNationalCode(nationalCode, birthDate) { $("#IdentityLoading").hide(); } - } else { + } + else if (response.data.authorizedCanceled) { + $(".checkByHistoryCode2").removeClass("disable"); + $("#AuthorizedCanceled").removeClass("disable"); + $('.alert-msg').show(); + $('.alert-msg p').text(response.message); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(response.message); + }, 3500); + $("#IdentityLoading").hide(); + goToStep2 = true; + + } + else { //$(".saveData").prop("disabled", true); $(".checkByNationalCode").each(function () { $(this).addClass("disable"); @@ -213,4 +229,20 @@ function checkNationalCode(nationalCode, birthDate) { goToStep2 = false; } }); -} \ No newline at end of file + $('#authorizedCheckboxInput').change(function () { + if ($(this).is(':checked')) { + console.log("tik"); + $("#nationalCodeS2Section").removeClass("disable"); + $("#birthDateS2Section").removeClass("disable"); + $("#genderS2Section").removeClass("disable"); + $("#marriageS2Section").removeClass("disable"); + $("#nameS2Section").removeClass("disable"); + $("#fNameS2Section").removeClass("disable"); + $("#startworkS2Section").removeClass("disable"); + $("#jobS2Section").removeClass("disable"); + goToStep2 = true; + $("#nextStep1").click(); + } + }); +} +