You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

775 lines
30 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. $(document).ready(function () {
  2. $("#" + mId + "occupation").prop("disabled", true);
  3. $("#" + mId + "recReceiverAccountNo").hide();
  4. $("#" + mId + "agentBankBranchDiv").hide();
  5. PopulateCustomerData();
  6. PopulateBenifiairyData();
  7. $("#" + mId + "ExpireDate").click(function () {
  8. $("#" + mId + "ExpireDate").val("");
  9. });
  10. $("#" + mId + "zipCode").keyup(function () {
  11. var len = $(this).val().length;
  12. if (len == "7") {
  13. GetAddressByZipCode();
  14. }
  15. });
  16. $("#" + mId + "recDdlIdType").on("change", function () {
  17. $("#" + mId + "recTxtIdValue").val("");
  18. })
  19. $("#MainContent_recDdlPaymentMode,#MainContent_recDdlPayoutPatner").on("change", function () {
  20. debugger
  21. let pmode = $("#" + mId + "recDdlPaymentMode").val();
  22. if (pmode == "2") {
  23. $("#" + mId + "recReceiverAccountNo").show();
  24. $("#" + mId + "agentBankBranchDiv").show();
  25. } else {
  26. $("#" + mId + "recReceiverAccountNo").val();
  27. $("#" + mId + "agentBankBranchDiv").val();
  28. $("#" + mId + "recReceiverAccountNo").hide();
  29. $("#" + mId + "agentBankBranchDiv").hide();
  30. }
  31. });
  32. $("#" + mId + "ddlVisaStatus").change(function () {
  33. var gen_emp_arr = ["official", "professor", "artist", "religious activities", "journalist", "highly skilled professional", "business manager", "legal/accounting services"
  34. , "medical services", "researcher", "instructor", "engineer/specialist in humanities/international services", "intra-company transferee"
  35. , "nursing care", "entertainer", "skilled labor", "technical intern training", "permanent resident", "spouse or child of japanese national"
  36. , "spouse or child of permanent resident", "long-term resident", "japanese", "specified skilled worker", "designated activities"];
  37. var house_wife_husband_arr = ["dependent"];
  38. var student_arr = ["student"];
  39. var part_time_worker_arr = ["trainee", "cultural activities", "temporary visitor"];
  40. var other_arr = ["diplomat"];
  41. selectedText = $("#" + mId + "ddlVisaStatus option:selected").text().toLowerCase();
  42. $("#divOccupation").hide();
  43. if (jQuery.inArray(selectedText, gen_emp_arr) >= 0) {
  44. $("#" + mId + "occupationHidden").val(11379);
  45. $("#" + mId + "occupation").val(11379);
  46. }
  47. else if (jQuery.inArray(selectedText, house_wife_husband_arr) >= 0) {
  48. $("#" + mId + "occupationHidden").val(11382);
  49. $("#" + mId + "occupation").val(11382);
  50. }
  51. else if (jQuery.inArray(selectedText, student_arr) >= 0) {
  52. $("#" + mId + "occupationHidden").val(11380);
  53. $("#" + mId + "occupation").val(11380);
  54. }
  55. else if (jQuery.inArray(selectedText, part_time_worker_arr) >= 0) {
  56. $("#" + mId + "occupationHidden").val(11381);
  57. $("#" + mId + "occupation").val(11381);
  58. }
  59. else if (jQuery.inArray(selectedText, other_arr) >= 0) {
  60. $("#" + mId + "occupationHidden").val(11383);
  61. $("#" + mId + "occupation").val(11383);
  62. $("#divOccupation").show();
  63. }
  64. });
  65. $("#" + mId + "occupation").change(function () {
  66. $("#divOccupation").hide();
  67. if ($("#" + mId + "occupation>").val() === "11376") {
  68. $("#divOccupation").show();
  69. }
  70. });
  71. $("#" + mId + "ddlSearchBy").change(function () {
  72. $("#" + mId + "txtSearchData_aText").val("");
  73. $("#" + mId + "addEditPanel").hide();
  74. $("#" + mId + "ddlCustomerType").val("4700");
  75. $("#" + mId + "membershipDiv").hide();
  76. $("#" + mId + "customerType").hide();
  77. $("#" + mId + "txtMembershipId").val("");
  78. txtSearchData.InitFunction();
  79. });
  80. //$(document).on("change", "#ContentPlaceHolder1_txtSearchData_aSearch", function () {
  81. // searchValue = $(this).val();
  82. // if (searchValue === null || searchValue === "") {
  83. // $("#ContentPlaceHolder1_txtSearchData_aText").val("");
  84. // $("#ContentPlaceHolder1_addEditPanel").hide();
  85. // $("#" + mId + "ddlCustomerType").val("4700");
  86. // $("#" + mId + "membershipDiv").hide();
  87. // $("#" + mId + "customerType").hide();
  88. // $("#" + mId + "txtMembershipId").val("");
  89. // }
  90. //});
  91. //mobile country code added
  92. $("#" + mId + "mobile").intlTelInput({
  93. nationalMode: true,
  94. onlyCountries: ["jp"],
  95. utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/12.1.3/js/utils.js" // just for formatting/placeholders etc
  96. });
  97. $("#" + mId + "mobile").on("change", function () {
  98. debugger
  99. var input = $("#" + mId + "mobile");
  100. var countryCode = $(".customer .dial-code").text();
  101. var mobileNo = input.val();
  102. var maxLength = input.attr("maxLength");
  103. if (mobileNo.indexOf(countryCode) < 0) {
  104. mobileNo = countryCode + mobileNo;
  105. }
  106. if (mobileNo.length > maxLength) {
  107. alert("Mobile No. Can allow input maxmum " + maxLength + " digit only");
  108. return $(this).val("");
  109. }
  110. $(this).val(mobileNo);
  111. CheckForMobileNumber(this, "Mobile No.");
  112. });
  113. $("#" + mId + "countryList").on("change", function () {
  114. $("#" + mId + "mobile").val("");
  115. var country = $("#" + mId + "countryList option:selected").text();
  116. if (country.toLowerCase() == "japan") {
  117. $("#" + mId + "mobile").intlTelInput("setCountry", "jp");
  118. }
  119. });
  120. CalSenderDOB("#" + mId + "dob");
  121. CalIDIssueDate("#" + mId + "IssueDate");
  122. CalFromToday("#" + mId + "ExpireDate");
  123. $("#" + mId + "IssueDate").mask("0000-00-00");
  124. $("#" + mId + "ExpireDate").mask("0000-00-00");
  125. $("#" + mId + "IssueDate").mask("0000-00-00");
  126. $("#" + mId + "ExpireDate").mask("0000-00-00");
  127. $("#" + mId + "dob").mask("0000-00-00");
  128. $("#" + mId + "IssueDate").mask("0000-00-00");
  129. $("#" + mId + "ExpireDate").mask("0000-00-00");
  130. ChangeOrganisationType();
  131. IdTypeValidity();
  132. //, "#CustomerAgreement", "#BenificiaryAgreement", "#TransactionAgreement"
  133. $("#agreement,#MainContent_CustomerAgreement").click(function () {
  134. if ($("#agreement").is(":checked") && $("#MainContent_CustomerAgreement").is(":checked")) {
  135. $("#" + mId + "registerCustomerAndReceiver").removeAttr("disabled");
  136. } else {
  137. $("#" + mId + "registerCustomerAndReceiver").attr("disabled", "disabled");
  138. }
  139. });
  140. $("#btnIAgree").on("click", function () {
  141. $("input[name=agreement]").prop("checked", true);
  142. if ($("#agreement").is(":checked") && $("#MainContent_CustomerAgreement").is(":checked")) {
  143. $("#" + mId + "registerCustomerAndReceiver").removeAttr("disabled");
  144. }
  145. });
  146. CustomerSignature();
  147. });
  148. function IdTypeValidity() {
  149. var senIdType = $("#" + mId + "idType").val();
  150. if (senIdType == "") {
  151. $("#" + mId + "expiryDiv").removeClass("hidden");
  152. }
  153. else {
  154. var senIdTypeArr = senIdType.split("|");
  155. if (senIdTypeArr[2] == "E") {
  156. $("#" + mId + "expiryDiv").removeClass("hidden");
  157. $("#expireRequired").show();
  158. $("#" + mId + "ExpireDate").addClass("required");
  159. }
  160. else {
  161. $("#" + mId + "expiryDiv").addClass("hidden");
  162. $("#" + mId + "ExpireDate").removeClass("required");
  163. }
  164. }
  165. };
  166. function CheckForMobileNumber(nField, fieldName) {
  167. var numberPattern = /^[+]?[0-9]{6,16}$/;
  168. test = numberPattern.test(nField.value);
  169. if (!test) {
  170. alert(fieldName + " Is Not Valid !");
  171. nField.value = "";
  172. return false
  173. }
  174. return true;
  175. }
  176. function CheckForPhoneNumber(nField, fieldName) {
  177. var numberPattern = /^[+]?[0-9]{6,15}$/;
  178. test = numberPattern.test(nField.value);
  179. if (!test) {
  180. alert(fieldName + " Is Not Valid !");
  181. nField.value = "";
  182. return false
  183. }
  184. return true;
  185. }
  186. function ChangeOrganisationType() {
  187. var customerType = $("#" + mId + "ddlCustomerType").val();
  188. var clearInputFields = [];
  189. if (customerType === "4701") {
  190. $(".usedForOrganisation").show();
  191. $(".hideForOrganisation").hide();
  192. clearInputFields = [".clearOnOrganisation"];
  193. } else {
  194. $(".usedForOrganisation").hide();
  195. $(".hideForOrganisation").show();
  196. clearInputFields = [".clearOnIndividual"];
  197. }
  198. clearInputFields.forEach(function (item) {
  199. $(item).val("");
  200. });
  201. }
  202. function GetCustomerSearchType() {
  203. var searchBy = $("#" + mId + "ddlSearchBy").val()
  204. return searchBy;
  205. }
  206. function CallBackAutocomplete(id) {
  207. var d = [GetItem("' + mId + 'txtSearchData")[0], GetItem("' + mId + 'txtSearchData")[1].split("|")[0]];
  208. $("#" + mId + "hdnCustomerId").val(d[0]);
  209. LoadcustomerData();
  210. $("#" + mId + "addEditPanel").removeAttr("style");
  211. $("#" + mId + "registerCustomerAndReceiver").removeAttr("disabled");
  212. }
  213. function LoadcustomerData() {
  214. var eid = $("#" + mId + "hdnCustomerId").val();
  215. dataToSend = { MethodName: "GetCustomerDetails", Id: eid };
  216. $.post("/AgentNew/Administration/CustomerSetup/CustomerRegistration/Manage.aspx", dataToSend, function (response) {
  217. ParseCustomerData(response);
  218. //DisableFields();
  219. ChangeOrganisationType();
  220. }).fail(function () {
  221. alert("Oops!!! something went wrong, please try again.");
  222. });
  223. }
  224. function ParseCustomerData(response) {
  225. var dr = jQuery.parseJSON(response);
  226. if (dr != null) {
  227. $("#" + mId + "firstName").attr("readonly", "readonly");
  228. $("#" + mId + "middleName").attr("readonly", "readonly");
  229. $("#" + mId + "lastName").attr("readonly", "readonly");
  230. $("#" + mId + "dob").attr("readonly", "readonly");
  231. $("#" + mId + "dob").datepicker("disable");
  232. $("#" + mId + "hdnCustomerId").val(dr[0].customerId);
  233. $("#" + mId + "firstName").val(dr[0].firstName);
  234. $("#" + mId + "middleName").val(dr[0].middleName);
  235. $("#" + mId + "lastName").val(dr[0].lastName1);
  236. $("#" + mId + "txtCompanyName").val(dr[0].firstName);
  237. $("#" + mId + "genderList").val(dr[0].gender);
  238. $("#" + mId + "countryList").val(dr[0].country);
  239. $("#" + mId + "addressLine1").val(dr[0].address);
  240. $("#" + mId + "zipCode").val(dr[0].zipCode);
  241. $("#" + mId + "city").val(dr[0].city);
  242. $("#" + mId + "email").val(dr[0].email);
  243. $("#" + mId + "hddOldEmailValue").val(dr[0].email);
  244. $("#" + mId + "emailConfirm").val(dr[0].email);
  245. $("#" + mId + "phoneNumber").val(dr[0].telNo);
  246. $("#" + mId + "mobile").val(dr[0].mobile);
  247. $("#" + mId + "nativeCountry").val(dr[0].nativeCountry);
  248. $("#" + mId + "nativeCountry").val(dr[0].nativeCountryId);
  249. $("#" + mId + "dob").val(dr[0].dob);
  250. $("#" + mId + "occupation").val(dr[0].occupation);
  251. if (parseInt(dr[0].occupation) === 11383) {
  252. $('#divOccupation').show();
  253. $('#' + mId + 'occupationHidden').val(dr[0].occupation);
  254. $('#' + mId + 'occupationText').val(dr[0].occupationText);
  255. }
  256. $("#" + mId + "IssueDate").val(dr[0].idIssueDate);
  257. $("#" + mId + "ExpireDate").val(dr[0].idExpiryDate);
  258. $("#" + mId + "idType").val(dr[0].idType);
  259. $("#" + mId + "verificationTypeNo").val(dr[0].idNumber);
  260. $("#" + mId + "hddIdNumber").val(dr[0].homePhone);
  261. $("#" + mId + "txtMembershipId").val(dr[0].membershipId);
  262. $("#" + mId + "hdnMembershipNo").val(dr[0].membershipId);
  263. $("#" + mId + "txtMembershipId").attr("readonly", true);
  264. $("#" + mId + "txtRegistrationNo").val(dr[0].registerationNo);
  265. $("#" + mId + "txtDateOfIncorporation").val(dr[0].dateofIncorporation);
  266. $("#" + mId + "txtNameofAuthoPerson").val(dr[0].nameOfAuthorizedPerson);
  267. //$("#" + mId + "txtStreet").val(dr[0].street);
  268. $("#" + mId + "txtAdditionalAddress").val(dr[0].additionalAddress);
  269. $("#" + mId + "txtsenderCityjapan").val(dr[0].cityUnicode);
  270. $("#" + mId + "txtstreetJapanese").val(dr[0].streetUnicode);
  271. $("#" + mId + "txtNameofEmployeer").val(dr[0].nameOfEmployeer);
  272. $("#" + mId + "rbRemitanceAllowed input[value=" + (dr[0].remittanceAllowed == true ? "Enabled" : "Disabled") + "]").attr("checked", "checked");
  273. $("#" + mId + "rbOnlineLogin [value= " + (dr[0].onlineUser == "Y" ? "Enabled" : "Disabled") + "]").attr("checked", "checked");
  274. $("#" + mId + "txtRemarks").val(dr[0].remarks);
  275. $("#" + mId + "txtSSnNo").val(dr[0].SSNNO);
  276. $("#" + mId + "ddlSalary").val(dr[0].monthlyIncome);
  277. $("#" + mId + "ddlCustomerType").val(dr[0].customerType);
  278. $("#" + mId + "ddlEmployeeBusType").val(dr[0].employeeBusinessType);
  279. $("#" + mId + "ddlnatureOfCompany").val(dr[0].natureOfCompany);
  280. $("#" + mId + "ddlOrganizationType").val(dr[0].organizationType);
  281. $("#" + mId + "ddlPosition").val(dr[0].position);
  282. $("#" + mId + "ddlVisaStatus").val(dr[0].visaStatus);
  283. $("#" + mId + "ddSourceOfFound").val(dr[0].sourceOfFund);
  284. $("#" + mId + "ddlState").val(dr[0].state);
  285. $("#" + mId + "ddlStateHidden").val(dr[0].state);
  286. $("#" + mId + "cityHidden").val(dr[0].city);
  287. $("#" + mId + "email").Enabled = (dr[0].isTxnMade == "Y") ? false : true;
  288. $("#" + mId + "emailConfirm").Enabled = (dr[0].isTxnMade == "Y") ? false : true;
  289. $("#" + mId + "hddTxnsMade").val(dr[0].isTxnMade);
  290. $("#" + mId + "ddlDocType").val(dr[0].documentType);
  291. if (dr[0].isTxnMade == "Y") {
  292. $("#" + mId + "msgDiv").Visible = true;
  293. $("#" + mId + "msgLabel").val("Note: The customer has already made transactions in JME system, so the email can not be modified. For more info please contact HO.");
  294. }
  295. if (dr[0].idType.split("|")[0] == "8008") {
  296. $("#" + mId + "expiryDiv").addClass("hidden");
  297. }
  298. else {
  299. $("#" + mId + "expiryDiv").removeClass("hidden");
  300. }
  301. $("#" + mId + "membershipDiv").show();
  302. $("#" + mId + "customerType").show();
  303. GetAddressByRowID(dr[0].district, dr[0].zipCode);
  304. }
  305. }
  306. function CheckMasterFormValidation() {
  307. debugger
  308. var requiredFieldAllPresent = ValidateRequiredfields();
  309. if (requiredFieldAllPresent) {
  310. return CheckSignatureCustomerFromCustomerRegister();
  311. } else {
  312. return requiredFieldAllPresent;
  313. }
  314. }
  315. function ValidateRequiredfields() {
  316. if (CheckRequiredFields() == true && CheckCustomerValidation() == true && CheckReceiverValidation() == true && CheckDocumentFormat() == true) {
  317. //PrepareDataForAjaxCall();
  318. var a = $("#" + mId + "recDdlPaymentMode option:selected").val();
  319. var b = $("#" + mId + "recDdlPayoutPatner option:selected").val();
  320. var c = $("#" + mId + "recDDLBankBranch option:selected").val();
  321. $("#" + mId + "hddPaymentMode").val($("#" + mId + "recDdlPaymentMode option:selected").val());
  322. $("#" + mId + "hddBankId").val($("#" + mId + "recDdlPayoutPatner option:selected").val());
  323. $("#" + mId + "HddBankBranchId").val($("#" + mId + "recDDLBankBranch option:selected").val());
  324. return true;
  325. } else {
  326. return false;
  327. }
  328. }
  329. function CheckRequiredFields() {
  330. //customer required fields
  331. var reqField = "lastName,countryList,zipCode,ddlState,city,txtStreet,txtAdditionalAddress,genderList,nativeCountry,dob,ddlVisaStatus,occupation,ddSourceOfFound,idType,verificationTypeNo,IssueDate,ExpireDate,";
  332. var customerType = $("#" + mId + "ddlCustomerType").val();
  333. $(".required").each(function () {
  334. reqField += $(this).attr("id") + ",";
  335. });
  336. reqField = reqField.replace("MainContent_", "");
  337. if ($("#" + mId + "expiryDiv").hasClass("hidden")) {
  338. reqField = reqField.replace(",ExpireDate,", ",");
  339. }
  340. //receiver required fields
  341. reqField = reqField + "recDdlCountry,recTxtReceiverFName,recTxtReceiverLName,recDdlNativeCountry,recTxtReceiverAddress,recTxtRecMobileNo,recDdlPaymentMode,";
  342. //let pmode = $("#" + mId + "recDdlPaymentMode").val();
  343. //if (pmode == "2") {
  344. // reqField = reqField + "recDdlPayoutPatner,recTxtBenificaryAc,recDDLBankBranch,"
  345. //}
  346. idTypeVal = $("#" + mId + "ddlIdType").val();
  347. idTypeNumber = $("#" + mId + "txtIdValue").val();
  348. if ((idTypeVal !== null && idTypeVal !== "" && idTypeVal !== "0") || (idTypeNumber !== null && idTypeNumber !== "" && idTypeNumber !== "0")) {
  349. reqField += "" + mId + "ddlIdType," + mId + "txtIdValue,";
  350. }
  351. //document required
  352. reqField = reqField + "reg_front_id,reg_back_id,";
  353. if (ValidRequiredFieldWithDoc(reqField) === false) {
  354. return false;
  355. } else {
  356. return true;
  357. }
  358. }
  359. function CheckDocumentFormat() {
  360. debugger
  361. var frontImg = $('#MainContent_reg_front_id').val();
  362. var backImg = $('#MainContent_reg_back_id').val();
  363. $('#front').css('background-color', '#FFFFFF');
  364. $('#back').css('background-color', '#FFFFFF');
  365. var Isvalid = true;
  366. if ($('#MainContent_reg_front_id').val() == "") {
  367. $('#front').css('background-color', '#FFCCD2');
  368. Isvalid = false;
  369. }
  370. if ($('#MainContent_reg_back_id').val() == '') {
  371. $('#back').css('background-color', '#FFCCD2');
  372. Isvalid = false;
  373. }
  374. if (Isvalid === false) {
  375. //ShowAlertMessage('Required Field(s)\n _____________________________ \n The red fields are required!', 'info');
  376. swal('Required Field(s)\n _____________________________ \n The red fields are required!');
  377. //alert('Required Field(s)\n _____________________________ \n The red fields are required!', 'info');
  378. }
  379. return Isvalid;
  380. }
  381. function CheckCustomerValidation() {
  382. var val = $("#" + mId + "hdnCustomerId").val();
  383. var input = $("#" + mId + "mobile");
  384. var mobileNo = input.val();
  385. if (mobileNo != null && mobileNo != "") {
  386. var countryCode = $(".customer .dial-code").text();
  387. var maxLength = input.attr("maxLength");
  388. if (mobileNo.indexOf(countryCode) < 0) {
  389. mobileNo = countryCode + mobileNo;
  390. }
  391. if (mobileNo.length > maxLength) {
  392. alert("Mobile No. Can allow input maxmum " + maxLength + " digit only");
  393. return $(this).val("");
  394. }
  395. $("#" + mId + "mobile").val(mobileNo);
  396. }
  397. ChangeOrganisationType();
  398. if (!$("#" + mId + "expiryDiv").hasClass("hidden")) {
  399. var issueDate = $("#" + mId + "IssueDate").val();
  400. var exipreDate = $("#" + mId + "ExpireDate").val();
  401. if (issueDate != "" && exipreDate != "") {
  402. if (issueDate > exipreDate) {
  403. alert("Issue Date cannot be greater than Valid date");
  404. return false;
  405. }
  406. }
  407. }
  408. var isdisplayDignature = $("#" + mId + "isDisplaySignature").val();
  409. if (isdisplayDignature.toLowerCase() === "true") {
  410. return CheckSignatureCustomer();
  411. }
  412. return true;
  413. }
  414. function CheckReceiverValidation() {
  415. $("#" + mId + "recDdlIdType").removeAttr("style");
  416. $("#" + mId + "recTxtIdValue").removeAttr("style");
  417. var input = $("#" + mId + "recTxtRecMobileNo");
  418. var mobileNo = input.val();
  419. if (mobileNo != "") {
  420. var countryCode = $(".receiver .country.active .dial-code").text();
  421. var maxLength = input.attr("maxLength");
  422. if (mobileNo.indexOf(countryCode) < 0) {
  423. mobileNo = countryCode + mobileNo;
  424. }
  425. if (mobileNo.length > maxLength) {
  426. alert("Mobile No. Can allow input maxmum " + maxLength + " digit only");
  427. $("#" + mId + "recTxtRecMobileNo").val("");
  428. return false;
  429. }
  430. $("#" + mId + "recTxtRecMobileNo").val(mobileNo);
  431. var numberPattern = /^[+]?[0-9]{6,16}$/;
  432. test = numberPattern.test(mobileNo);
  433. if (!test) {
  434. alert("Mobile No Is Not Valid !");
  435. input.val("");
  436. return false
  437. }
  438. }
  439. paymentMode = $("#" + mId + "recDdlPaymentMode").val();
  440. return true;
  441. }
  442. function PrepareDataForAjaxCall() {
  443. debugger
  444. var firstName = $("#" + mId + "firstName");
  445. var lastName = $("#" + mId + "lastName ");
  446. var countryList = $("#" + mId + "countryList ");
  447. var zipCode = $("#" + mId + "zipCode");
  448. var ddlState = $("#" + mId + "ddlState ");
  449. var city = $("#" + mId + "city");
  450. var txtStreet = $("#" + mId + "txtStreet");
  451. var txtAdditionalAddress = $("#" + mId + "txtAdditionalAddress");
  452. var genderList = $("#" + mId + "genderList");
  453. var nativeCountry = $("#" + mId + "nativeCountry");
  454. var dob = $("#" + mId + "dob");
  455. var ddlVisaStatus = $("#" + mId + "ddlVisaStatus");
  456. var occupation = $("#" + mId + "occupation");
  457. var ddSourceOfFound = $("#" + mId + "ddSourceOfFound");
  458. var idType = $("#" + mId + "idType");
  459. var verificationTypeNo = $("#" + mId + "verificationTypeNo");
  460. var IssueDate = $("#" + mId + "IssueDate");
  461. var expireRequired = $("#" + mId + "expireRequired ");
  462. var paymentmode = $("#" + mId + "recDdlPaymentMode option:selected ").val();
  463. alert(paymentmode);
  464. var DataToSend = {
  465. MethodName: "SaveCustomerDetails"
  466. , firstName: firstName
  467. , lastName: lastName
  468. , countryList: countryList
  469. , zipCode: zipCode
  470. , ddlState: ddlState
  471. , city: city
  472. , txtStreet: txtStreet
  473. , txtAdditionalAddress: txtAdditionalAddress
  474. , genderList: genderList
  475. , nativeCountry: nativeCountry
  476. , dob: dob
  477. , ddlVisaStatus: ddlVisaStatus
  478. , occupation: occupation
  479. , ddSourceOfFound: ddSourceOfFound
  480. , idType: idType
  481. , verificationTypeNo: verificationTypeNo
  482. , IssueDate: IssueDate
  483. , expireRequired: expireRequired
  484. , paymentmode: paymentmode
  485. }
  486. var url = "";
  487. $.post(url, DataToSend, function (response) {
  488. alert(response);
  489. }).fail(function () {
  490. });
  491. }
  492. function loadImage(filePath, id) {
  493. $("#" + id).attr("src", path);
  494. }
  495. function readURL(input, id) {
  496. if (input.files && input.files[0]) {
  497. var reader = new FileReader();
  498. reader.onload = function (e) {
  499. $("#" + id).attr("src", e.target.result);
  500. }
  501. reader.readAsDataURL(input.files[0]);
  502. }
  503. }
  504. function showImage(param) {
  505. var imgSrc = $(param).attr("src");
  506. OpenInNewWindow(imgSrc);
  507. }
  508. function ManageDivs() {
  509. if ($("#" + mId + "idType").val() == "8008") {
  510. $("#" + mId + "ExpireDate").removeClass("required");
  511. $("#" + mId + "expiryDiv").addClass("hidden");
  512. }
  513. else {
  514. $("#" + mId + "expiryDiv").removeClass("hidden");
  515. $("#" + mId + "ExpireDate").addClass("required");
  516. }
  517. $("#" + mId + "ExpireDate").val("");
  518. IdTypeValidity();
  519. }
  520. function CheckCustomerId() {
  521. customerId = $("#" + mId + "hdnCustomerId").val();
  522. if (customerId !== null && customerId !== "") {
  523. return true;
  524. }
  525. return false;
  526. }
  527. function SetMessageBox(msg, id) {
  528. alert(msg);
  529. }
  530. function GetAddressByZipCode() {
  531. var zipCodeValue = $("#" + mId + "zipCode").val();
  532. $("#txtState").val("");
  533. $("#" + mId + "txtStreet").val("");
  534. $("#" + mId + "city").val("");
  535. $("#" + mId + "txtsenderCityjapan").val("");
  536. $("#" + mId + "txtstreetJapanese").val("");
  537. var zipCodePattern = /^\d{7}?$/;
  538. test = zipCodePattern.test(zipCodeValue);
  539. if (!test) {
  540. $("#" + mId + "zipCode").val("");
  541. $("#" + mId + "zipCode").focus();
  542. $("#" + mId + "zipCode").attr("style", "display:block; background:#FFCCD2");
  543. return alert("Please Enter Valid Zip Code(XXXXXXX)");
  544. }
  545. var dataToSend = { MethodName: "GetAddressDetailsByZipCode", zipCode: zipCodeValue };
  546. var url = "";
  547. $.post(url, dataToSend, function (erd) {
  548. if (erd !== null) {
  549. debugger
  550. var dr = jQuery.parseJSON(erd);
  551. if (erd == false) {
  552. $("#" + mId + "ddlState").val("");
  553. $("#" + mId + "txtStreet").val("");
  554. $("#" + mId + "city").val("");
  555. $("#" + mId + "zipCode").focus();
  556. $("#" + mId + "zipCode").attr("style", "display:block; background:#FFCCD2");
  557. return alert("Please Enter Valid Zip Code(XXXXXXX)");
  558. }
  559. //$("#tempAddress").html(erd);
  560. if (dr[0].errorCode == "0") {
  561. $("#" + mId + "ddlState").val(dr[0].STATE_ID);
  562. $("#" + mId + "ddlStateHidden").val(dr[0].STATE_ID);
  563. $("#" + mId + "cityHidden").val(dr[0].CITY_NAME);
  564. //$("#" + mId + "txtStreet").val(dr[0].STREET_NAME);
  565. $("#" + mId + "city").val(dr[0].CITY_NAME);
  566. PopulateAreaDDL(dr);
  567. }
  568. else {
  569. $("#" + mId + "ddlState").val("");
  570. $("#" + mId + "txtStreet").val("");
  571. $("#" + mId + "city").val("");
  572. $("#" + mId + "zipCode").focus();
  573. $("#" + mId + "zipCode").attr("style", "display:block; background:#FFCCD2");
  574. return alert("Please Enter Valid Zip Code(XXXXXXX)");
  575. }
  576. }
  577. }).fail(function (data) {
  578. $("#loadingDiv").LoadingOverlay("hide", true);
  579. swal(result.Msg, "Error Occured", "error");
  580. });
  581. }
  582. function ShowIdTypeInfo() {
  583. var idInfo = $("#" + mId + "idType").val();
  584. if (idInfo == "" || idInfo == null) {
  585. alert("Please select id type first!")
  586. }
  587. else {
  588. alert(idInfo.split("|")[1]);
  589. }
  590. }
  591. function GetAddressByRowID(rowId, zipCode) {
  592. var dataToSend = { MethodName: "GetAddressDetailsByZipCode", zipCode: zipCode, RowID: rowId };
  593. $.post("/AgentNew/Administration/CustomerSetup/CustomerRegistration/Manage.aspx", dataToSend, function (erd) {
  594. if (erd !== null) {
  595. var dr = jQuery.parseJSON(erd);
  596. if (erd == false) {
  597. $("#" + mId + "ddlState").val("");
  598. $("#" + mId + "txtStreet").val("");
  599. $("#" + mId + "city").val("");
  600. $("#" + mId + "zipCode").focus();
  601. $("#" + mId + "zipCode").attr("style", "display:block; background:#FFCCD2");
  602. return alert("Please Enter Valid Zip Code(XXXXXXX)");
  603. }
  604. //$("#tempAddress").html(erd);
  605. if (dr[0].errorCode == "0") {
  606. $("#" + mId + "ddlState").val(dr[0].STATE_ID);
  607. $("#" + mId + "ddlStateHidden").val(dr[0].STATE_ID);
  608. $("#" + mId + "cityHidden").val(dr[0].CITY_NAME);
  609. //$("#" + mId + "txtStreet").val(dr[0].STREET_NAME);
  610. $("#" + mId + "city").val(dr[0].CITY_NAME);
  611. PopulateAreaDDL(dr, rowId);
  612. }
  613. else {
  614. $("#" + mId + "ddlState").val("");
  615. $("#" + mId + "txtStreet").val("");
  616. $("#" + mId + "city").val("");
  617. $("#" + mId + "zipCode").focus();
  618. $("#" + mId + "zipCode").attr("style", "display:block; background:#FFCCD2");
  619. return alert("Please Enter Valid Zip Code(XXXXXXX)");
  620. }
  621. }
  622. }).fail(function () {
  623. alert("Oops!!! something went wrong, please try again.");
  624. });
  625. }
  626. function PopulateAreaDDL(data, selectedValue) {
  627. var ddl = document.getElementById(mId + "txtStreet");
  628. $(ddl).empty();
  629. var option, selValue = "";
  630. if (selectedValue) {
  631. selValue = selectedValue;
  632. }
  633. if (data.length > 1) {
  634. option = document.createElement("option");
  635. option.text = "Select Area";
  636. option.value = "";
  637. ddl.options.add(option);
  638. }
  639. for (var i = 0; i < data.length; i++) {
  640. option = document.createElement("option");
  641. option.text = data[i].STREET_NAME;
  642. option.value = data[i].ROW_ID;
  643. if (selValue.toString() === option.value) {
  644. option.selected = true;
  645. }
  646. try {
  647. ddl.options.add(option);
  648. }
  649. catch (e) {
  650. alert(e);
  651. }
  652. }
  653. }
  654. function PopulateCustomerData() {
  655. $("#" + mId + "firstName").val('firstname');
  656. $("#" + mId + "middleName").val('middlename');
  657. $("#" + mId + "lastName").val('lastname');
  658. $("#" + mId + "genderList").val('98');
  659. $("#" + mId + "phoneNumber").val('014219090');
  660. $("#" + mId + "nativeCountry").val('16');
  661. $("#" + mId + "dob").val('1995-02-03');
  662. $("#" + mId + "occupation").val('11261');
  663. $("#" + mId + "IssueDate").val('2020-01-01');
  664. $("#" + mId + "ExpireDate").val('2020-07-22');
  665. $("#" + mId + "idType").val('10997|Passport|E');
  666. $("#" + mId + "txtAdditionalAddress").val('additionaladdress');
  667. $("#" + mId + "txtNameofEmployeer").val('nameOfEmployeer');
  668. $("#" + mId + "txtRemarks").val('CustomerRemarks');
  669. $("#" + mId + "txtSSnNo").val('ssnno');
  670. $("#" + mId + "ddlSalary").val('JPY170,000 - JPY340,000');
  671. $("#" + mId + "ddlEmployeeBusType").val('11008');
  672. $("#" + mId + "ddlVisaStatus").val('11019');
  673. $("#" + mId + "ddSourceOfFound").val('11167');
  674. $("#" + mId + "ddlDocType").val('11054');
  675. }
  676. function PopulateBenifiairyData() {
  677. $("#" + mId + "recDdlPaymentMode option:selected").val();
  678. $("#" + mId + "recTxtEmail").val('recemail@gmail.com');
  679. $("#" + mId + "recTxtReceiverFName").val('firstnamerec');
  680. $("#" + mId + "recTxtReceiverMName").val('middlenamerec');
  681. $("#" + mId + "recTxtReceiverLName").val('lastnamerec');
  682. $("#" + mId + "recTxtReceiverAddress").val('addressrec');
  683. $("#" + mId + "recTxtReceiverCity").val('cityrec');
  684. $("#" + mId + "recTxtContactNo").val('44444444');
  685. $("#" + mId + "recDdlRelationship").val('10998');
  686. $("#" + mId + "recTxtPlaceOfIssue").val('kathmandu');
  687. $("#" + mId + "recDdlIdType").val('10997');
  688. $("#" + mId + "recTxtIdValue").val('1212121212');
  689. $("#" + mId + "recReceiverAccountNo").val('986566546');
  690. $("#" + mId + "recDdlPurposeOfRemitance").val('11141');
  691. $("#" + mId + "recTxtRemarksRec").val('remarksrec');
  692. $("#" + mId + "recDdlNativeCountry").val('16');
  693. }