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.
 
 
 
 
 

746 lines
29 KiB

$(document).ready(function () {
$("#" + mId + "occupation").prop("disabled", true);
PopulateCustomerData();
PopulateBenifiairyData();
$("#" + mId + "ExpireDate").click(function () {
$("#" + mId + "ExpireDate").val("");
});
$("#" + mId + "zipCode").keyup(function () {
var len = $(this).val().length;
if (len == "7") {
GetAddressByZipCode();
}
});
$("#" + mId + "ddlVisaStatus").change(function () {
var gen_emp_arr = ["official", "professor", "artist", "religious activities", "journalist", "highly skilled professional", "business manager", "legal/accounting services"
, "medical services", "researcher", "instructor", "engineer/specialist in humanities/international services", "intra-company transferee"
, "nursing care", "entertainer", "skilled labor", "technical intern training", "permanent resident", "spouse or child of japanese national"
, "spouse or child of permanent resident", "long-term resident", "japanese", "specified skilled worker", "designated activities"];
var house_wife_husband_arr = ["dependent"];
var student_arr = ["student"];
var part_time_worker_arr = ["trainee", "cultural activities", "temporary visitor"];
var other_arr = ["diplomat"];
selectedText = $("#" + mId + "ddlVisaStatus option:selected").text().toLowerCase();
$("#divOccupation").hide();
if (jQuery.inArray(selectedText, gen_emp_arr) >= 0) {
$("#" + mId + "occupationHidden").val(11379);
$("#" + mId + "occupation").val(11379);
}
else if (jQuery.inArray(selectedText, house_wife_husband_arr) >= 0) {
$("#" + mId + "occupationHidden").val(11382);
$("#" + mId + "occupation").val(11382);
}
else if (jQuery.inArray(selectedText, student_arr) >= 0) {
$("#" + mId + "occupationHidden").val(11380);
$("#" + mId + "occupation").val(11380);
}
else if (jQuery.inArray(selectedText, part_time_worker_arr) >= 0) {
$("#" + mId + "occupationHidden").val(11381);
$("#" + mId + "occupation").val(11381);
}
else if (jQuery.inArray(selectedText, other_arr) >= 0) {
$("#" + mId + "occupationHidden").val(11383);
$("#" + mId + "occupation").val(11383);
$("#divOccupation").show();
}
});
$("#" + mId + "occupation").change(function () {
$("#divOccupation").hide();
if ($("#" + mId + "occupation>").val() === "11376") {
$("#divOccupation").show();
}
});
$("#" + mId + "ddlSearchBy").change(function () {
$("#" + mId + "txtSearchData_aText").val("");
$("#" + mId + "addEditPanel").hide();
$("#" + mId + "ddlCustomerType").val("4700");
$("#" + mId + "membershipDiv").hide();
$("#" + mId + "customerType").hide();
$("#" + mId + "txtMembershipId").val("");
txtSearchData.InitFunction();
});
//$(document).on("change", "#ContentPlaceHolder1_txtSearchData_aSearch", function () {
// searchValue = $(this).val();
// if (searchValue === null || searchValue === "") {
// $("#ContentPlaceHolder1_txtSearchData_aText").val("");
// $("#ContentPlaceHolder1_addEditPanel").hide();
// $("#" + mId + "ddlCustomerType").val("4700");
// $("#" + mId + "membershipDiv").hide();
// $("#" + mId + "customerType").hide();
// $("#" + mId + "txtMembershipId").val("");
// }
//});
//mobile country code added
$("#" + mId + "mobile").intlTelInput({
nationalMode: true,
onlyCountries: ["jp"],
utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/12.1.3/js/utils.js" // just for formatting/placeholders etc
});
$("#" + mId + "mobile").on("change", function () {
debugger
var input = $("#" + mId + "mobile");
var countryCode = $(".customer .dial-code").text();
var mobileNo = input.val();
var maxLength = input.attr("maxLength");
if (mobileNo.indexOf(countryCode) < 0) {
mobileNo = countryCode + mobileNo;
}
if (mobileNo.length > maxLength) {
alert("Mobile No. Can allow input maxmum " + maxLength + " digit only");
return $(this).val("");
}
$(this).val(mobileNo);
CheckForMobileNumber(this, "Mobile No.");
});
$("#" + mId + "countryList").on("change", function () {
$("#" + mId + "mobile").val("");
var country = $("#" + mId + "countryList option:selected").text();
if (country.toLowerCase() == "japan") {
$("#" + mId + "mobile").intlTelInput("setCountry", "jp");
}
});
CalSenderDOB("#" + mId + "dob");
CalIDIssueDate("#" + mId + "IssueDate");
CalFromToday("#" + mId + "ExpireDate");
$("#" + mId + "IssueDate").mask("0000-00-00");
$("#" + mId + "ExpireDate").mask("0000-00-00");
$("#" + mId + "IssueDate").mask("0000-00-00");
$("#" + mId + "ExpireDate").mask("0000-00-00");
$("#" + mId + "dob").mask("0000-00-00");
$("#" + mId + "IssueDate").mask("0000-00-00");
$("#" + mId + "ExpireDate").mask("0000-00-00");
ChangeOrganisationType();
IdTypeValidity();
//, "#CustomerAgreement", "#BenificiaryAgreement", "#TransactionAgreement"
$("#agreement,#MainContent_CustomerAgreement").click(function () {
if ($("#agreement").is(":checked") && $("#MainContent_CustomerAgreement").is(":checked")) {
$("#" + mId + "registerCustomerAndReceiver").removeAttr("disabled");
} else {
$("#" + mId + "registerCustomerAndReceiver").attr("disabled", "disabled");
}
});
$("#btnIAgree").on("click", function () {
$("input[name=agreement]").prop("checked", true);
if ($("#agreement").is(":checked") && $("#MainContent_CustomerAgreement").is(":checked")) {
$("#" + mId + "registerCustomerAndReceiver").removeAttr("disabled");
}
});
CustomerSignature();
});
function IdTypeValidity() {
var senIdType = $("#" + mId + "idType").val();
if (senIdType == "") {
$("#" + mId + "expiryDiv").removeClass("hidden");
}
else {
var senIdTypeArr = senIdType.split("|");
if (senIdTypeArr[2] == "E") {
$("#" + mId + "expiryDiv").removeClass("hidden");
$("#expireRequired").show();
$("#" + mId + "ExpireDate").addClass("required");
}
else {
$("#" + mId + "expiryDiv").addClass("hidden");
$("#" + mId + "ExpireDate").removeClass("required");
}
}
};
function CheckForMobileNumber(nField, fieldName) {
var numberPattern = /^[+]?[0-9]{6,16}$/;
test = numberPattern.test(nField.value);
if (!test) {
alert(fieldName + " Is Not Valid !");
nField.value = "";
return false
}
return true;
}
function CheckForPhoneNumber(nField, fieldName) {
var numberPattern = /^[+]?[0-9]{6,15}$/;
test = numberPattern.test(nField.value);
if (!test) {
alert(fieldName + " Is Not Valid !");
nField.value = "";
return false
}
return true;
}
function ChangeOrganisationType() {
var customerType = $("#" + mId + "ddlCustomerType").val();
var clearInputFields = [];
if (customerType === "4701") {
$(".usedForOrganisation").show();
$(".hideForOrganisation").hide();
clearInputFields = [".clearOnOrganisation"];
} else {
$(".usedForOrganisation").hide();
$(".hideForOrganisation").show();
clearInputFields = [".clearOnIndividual"];
}
clearInputFields.forEach(function (item) {
$(item).val("");
});
}
function GetCustomerSearchType() {
var searchBy = $("#" + mId + "ddlSearchBy").val()
return searchBy;
}
function CallBackAutocomplete(id) {
var d = [GetItem("' + mId + 'txtSearchData")[0], GetItem("' + mId + 'txtSearchData")[1].split("|")[0]];
$("#" + mId + "hdnCustomerId").val(d[0]);
LoadcustomerData();
$("#" + mId + "addEditPanel").removeAttr("style");
$("#" + mId + "registerCustomerAndReceiver").removeAttr("disabled");
}
function LoadcustomerData() {
var eid = $("#" + mId + "hdnCustomerId").val();
dataToSend = { MethodName: "GetCustomerDetails", Id: eid };
$.post("/AgentNew/Administration/CustomerSetup/CustomerRegistration/Manage.aspx", dataToSend, function (response) {
ParseCustomerData(response);
//DisableFields();
ChangeOrganisationType();
}).fail(function () {
alert("Oops!!! something went wrong, please try again.");
});
}
function ParseCustomerData(response) {
var dr = jQuery.parseJSON(response);
if (dr != null) {
$("#" + mId + "firstName").attr("readonly", "readonly");
$("#" + mId + "middleName").attr("readonly", "readonly");
$("#" + mId + "lastName").attr("readonly", "readonly");
$("#" + mId + "dob").attr("readonly", "readonly");
$("#" + mId + "dob").datepicker("disable");
$("#" + mId + "hdnCustomerId").val(dr[0].customerId);
$("#" + mId + "firstName").val(dr[0].firstName);
$("#" + mId + "middleName").val(dr[0].middleName);
$("#" + mId + "lastName").val(dr[0].lastName1);
$("#" + mId + "txtCompanyName").val(dr[0].firstName);
$("#" + mId + "genderList").val(dr[0].gender);
$("#" + mId + "countryList").val(dr[0].country);
$("#" + mId + "addressLine1").val(dr[0].address);
$("#" + mId + "zipCode").val(dr[0].zipCode);
$("#" + mId + "city").val(dr[0].city);
$("#" + mId + "email").val(dr[0].email);
$("#" + mId + "hddOldEmailValue").val(dr[0].email);
$("#" + mId + "emailConfirm").val(dr[0].email);
$("#" + mId + "phoneNumber").val(dr[0].telNo);
$("#" + mId + "mobile").val(dr[0].mobile);
$("#" + mId + "nativeCountry").val(dr[0].nativeCountry);
$("#" + mId + "nativeCountry").val(dr[0].nativeCountryId);
$("#" + mId + "dob").val(dr[0].dob);
$("#" + mId + "occupation").val(dr[0].occupation);
$("#" + mId + "IssueDate").val(dr[0].idIssueDate);
$("#" + mId + "ExpireDate").val(dr[0].idExpiryDate);
$("#" + mId + "idType").val(dr[0].idType);
$("#" + mId + "verificationTypeNo").val(dr[0].idNumber);
$("#" + mId + "hddIdNumber").val(dr[0].homePhone);
$("#" + mId + "txtMembershipId").val(dr[0].membershipId);
$("#" + mId + "hdnMembershipNo").val(dr[0].membershipId);
$("#" + mId + "txtMembershipId").attr("readonly", true);
$("#" + mId + "txtRegistrationNo").val(dr[0].registerationNo);
$("#" + mId + "txtDateOfIncorporation").val(dr[0].dateofIncorporation);
$("#" + mId + "txtNameofAuthoPerson").val(dr[0].nameOfAuthorizedPerson);
//$("#" + mId + "txtStreet").val(dr[0].street);
$("#" + mId + "txtAdditionalAddress").val(dr[0].additionalAddress);
$("#" + mId + "txtsenderCityjapan").val(dr[0].cityUnicode);
$("#" + mId + "txtstreetJapanese").val(dr[0].streetUnicode);
$("#" + mId + "txtNameofEmployeer").val(dr[0].nameOfEmployeer);
$("#" + mId + "rbRemitanceAllowed input[value=" + (dr[0].remittanceAllowed == true ? "Enabled" : "Disabled") + "]").attr("checked", "checked");
$("#" + mId + "rbOnlineLogin [value= " + (dr[0].onlineUser == "Y" ? "Enabled" : "Disabled") + "]").attr("checked", "checked");
$("#" + mId + "txtRemarks").val(dr[0].remarks);
$("#" + mId + "txtSSnNo").val(dr[0].SSNNO);
$("#" + mId + "ddlSalary").val(dr[0].monthlyIncome);
$("#" + mId + "ddlCustomerType").val(dr[0].customerType);
$("#" + mId + "ddlEmployeeBusType").val(dr[0].employeeBusinessType);
$("#" + mId + "ddlnatureOfCompany").val(dr[0].natureOfCompany);
$("#" + mId + "ddlOrganizationType").val(dr[0].organizationType);
$("#" + mId + "ddlPosition").val(dr[0].position);
$("#" + mId + "ddlVisaStatus").val(dr[0].visaStatus);
$("#" + mId + "ddSourceOfFound").val(dr[0].sourceOfFund);
$("#" + mId + "ddlState").val(dr[0].state);
$("#" + mId + "ddlStateHidden").val(dr[0].state);
$("#" + mId + "cityHidden").val(dr[0].city);
$("#" + mId + "email").Enabled = (dr[0].isTxnMade == "Y") ? false : true;
$("#" + mId + "emailConfirm").Enabled = (dr[0].isTxnMade == "Y") ? false : true;
$("#" + mId + "hddTxnsMade").val(dr[0].isTxnMade);
$("#" + mId + "ddlDocType").val(dr[0].documentType);
if (dr[0].isTxnMade == "Y") {
$("#" + mId + "msgDiv").Visible = true;
$("#" + 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.");
}
if (dr[0].idType.split("|")[0] == "8008") {
$("#" + mId + "expiryDiv").addClass("hidden");
}
else {
$("#" + mId + "expiryDiv").removeClass("hidden");
}
$("#" + mId + "membershipDiv").show();
$("#" + mId + "customerType").show();
GetAddressByRowID(dr[0].district, dr[0].zipCode);
}
}
function CheckMasterFormValidation() {
debugger
var requiredFieldAllPresent = ValidateRequiredfields();
if (requiredFieldAllPresent) {
return CheckSignatureCustomerFromCustomerRegister();
} else {
return requiredFieldAllPresent;
}
}
function ValidateRequiredfields() {
if (CheckRequiredFields() == true && CheckCustomerValidation() == true && CheckReceiverValidation() == true && CheckDocumentFormat() == true) {
//PrepareDataForAjaxCall();
var a = $("#" + mId + "recDdlPaymentMode option:selected").val();
var b = $("#" + mId + "recDdlPayoutPatner option:selected").val();
var c = $("#" + mId + "recDDLBankBranch option:selected").val();
$("#" + mId + "hddPaymentMode").val($("#" + mId + "recDdlPaymentMode option:selected").val());
$("#" + mId + "hddBankId").val($("#" + mId + "recDdlPayoutPatner option:selected").val());
$("#" + mId + "HddBankBranchId").val($("#" + mId + "recDDLBankBranch option:selected").val());
return true;
} else {
return false;
}
}
function CheckRequiredFields() {
//customer required fields
var reqField = "lastName,countryList,zipCode,ddlState,city,txtStreet,txtAdditionalAddress,genderList,nativeCountry,dob,ddlVisaStatus,occupation,ddSourceOfFound,idType,verificationTypeNo,IssueDate,ExpireDate,";
var customerType = $("#" + mId + "ddlCustomerType").val();
$(".required").each(function () {
reqField += $(this).attr("id") + ",";
});
reqField = reqField.replace("MainContent_", "");
if ($("#" + mId + "expiryDiv").hasClass("hidden")) {
reqField = reqField.replace(",ExpireDate,", ",");
}
//receiver required fields
reqField = reqField + "recDdlCountry,recTxtReceiverFName,recTxtReceiverLName,recDdlNativeCountry,recTxtReceiverAddress,recTxtRecMobileNo,recDdlPaymentMode,";
idTypeVal = $("#" + mId + "ddlIdType").val();
idTypeNumber = $("#" + mId + "txtIdValue").val();
if ((idTypeVal !== null && idTypeVal !== "" && idTypeVal !== "0") || (idTypeNumber !== null && idTypeNumber !== "" && idTypeNumber !== "0")) {
reqField += "" + mId + "ddlIdType," + mId + "txtIdValue,";
}
//document required
reqField = reqField + "reg_front_id,reg_back_id,";
if (ValidRequiredFieldWithDoc(reqField) === false) {
return false;
} else {
return true;
}
}
function CheckDocumentFormat() {
debugger
var frontImg = $('#MainContent_reg_front_id').val();
var backImg = $('#MainContent_reg_back_id').val();
$('#front').css('background-color', '#FFFFFF');
$('#back').css('background-color', '#FFFFFF');
var Isvalid = true;
if ($('#MainContent_reg_front_id').val() == "") {
$('#front').css('background-color', '#FFCCD2');
Isvalid = false;
}
if ($('#MainContent_reg_back_id').val() == '') {
$('#back').css('background-color', '#FFCCD2');
Isvalid = false;
}
if (Isvalid === false) {
//ShowAlertMessage('Required Field(s)\n _____________________________ \n The red fields are required!', 'info');
swal('Required Field(s)\n _____________________________ \n The red fields are required!');
//alert('Required Field(s)\n _____________________________ \n The red fields are required!', 'info');
}
return Isvalid;
}
function CheckCustomerValidation() {
var val = $("#" + mId + "hdnCustomerId").val();
var input = $("#" + mId + "mobile");
var mobileNo = input.val();
if (mobileNo != null && mobileNo != "") {
var countryCode = $(".customer .dial-code").text();
var maxLength = input.attr("maxLength");
if (mobileNo.indexOf(countryCode) < 0) {
mobileNo = countryCode + mobileNo;
}
if (mobileNo.length > maxLength) {
alert("Mobile No. Can allow input maxmum " + maxLength + " digit only");
return $(this).val("");
}
$("#" + mId + "mobile").val(mobileNo);
}
ChangeOrganisationType();
if (!$("#" + mId + "expiryDiv").hasClass("hidden")) {
var issueDate = $("#" + mId + "IssueDate").val();
var exipreDate = $("#" + mId + "ExpireDate").val();
if (issueDate != "" && exipreDate != "") {
if (issueDate > exipreDate) {
alert("Issue Date cannot be greater than Valid date");
return false;
}
}
}
var isdisplayDignature = $("#" + mId + "isDisplaySignature").val();
if (isdisplayDignature.toLowerCase() === "true") {
return CheckSignatureCustomer();
}
return true;
}
function CheckReceiverValidation() {
$("#" + mId + "recDdlIdType").removeAttr("style");
$("#" + mId + "recTxtIdValue").removeAttr("style");
var input = $("#" + mId + "recTxtRecMobileNo");
var mobileNo = input.val();
if (mobileNo != "") {
var countryCode = $(".receiver .country.active .dial-code").text();
var maxLength = input.attr("maxLength");
if (mobileNo.indexOf(countryCode) < 0) {
mobileNo = countryCode + mobileNo;
}
if (mobileNo.length > maxLength) {
alert("Mobile No. Can allow input maxmum " + maxLength + " digit only");
$("#" + mId + "recTxtRecMobileNo").val("");
return false;
}
$("#" + mId + "recTxtRecMobileNo").val(mobileNo);
var numberPattern = /^[+]?[0-9]{6,16}$/;
test = numberPattern.test(mobileNo);
if (!test) {
alert("Mobile No Is Not Valid !");
input.val("");
return false
}
}
paymentMode = $("#" + mId + "recDdlPaymentMode").val();
return true;
}
function PrepareDataForAjaxCall() {
debugger
var firstName = $("#" + mId + "firstName");
var lastName = $("#" + mId + "lastName ");
var countryList = $("#" + mId + "countryList ");
var zipCode = $("#" + mId + "zipCode");
var ddlState = $("#" + mId + "ddlState ");
var city = $("#" + mId + "city");
var txtStreet = $("#" + mId + "txtStreet");
var txtAdditionalAddress = $("#" + mId + "txtAdditionalAddress");
var genderList = $("#" + mId + "genderList");
var nativeCountry = $("#" + mId + "nativeCountry");
var dob = $("#" + mId + "dob");
var ddlVisaStatus = $("#" + mId + "ddlVisaStatus");
var occupation = $("#" + mId + "occupation");
var ddSourceOfFound = $("#" + mId + "ddSourceOfFound");
var idType = $("#" + mId + "idType");
var verificationTypeNo = $("#" + mId + "verificationTypeNo");
var IssueDate = $("#" + mId + "IssueDate");
var expireRequired = $("#" + mId + "expireRequired ");
var paymentmode = $("#" + mId + "recDdlPaymentMode option:selected ").val();
alert(paymentmode);
var DataToSend = {
MethodName: "SaveCustomerDetails"
, firstName: firstName
, lastName: lastName
, countryList: countryList
, zipCode: zipCode
, ddlState: ddlState
, city: city
, txtStreet: txtStreet
, txtAdditionalAddress: txtAdditionalAddress
, genderList: genderList
, nativeCountry: nativeCountry
, dob: dob
, ddlVisaStatus: ddlVisaStatus
, occupation: occupation
, ddSourceOfFound: ddSourceOfFound
, idType: idType
, verificationTypeNo: verificationTypeNo
, IssueDate: IssueDate
, expireRequired: expireRequired
, paymentmode: paymentmode
}
var url = "";
$.post(url, DataToSend, function (response) {
alert(response);
}).fail(function () {
});
}
function loadImage(filePath, id) {
$("#" + id).attr("src", path);
}
function readURL(input, id) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$("#" + id).attr("src", e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
function showImage(param) {
var imgSrc = $(param).attr("src");
OpenInNewWindow(imgSrc);
}
function ManageDivs() {
if ($("#" + mId + "idType").val() == "8008") {
$("#" + mId + "ExpireDate").removeClass("required");
$("#" + mId + "expiryDiv").addClass("hidden");
}
else {
$("#" + mId + "expiryDiv").removeClass("hidden");
$("#" + mId + "ExpireDate").addClass("required");
}
$("#" + mId + "ExpireDate").val("");
IdTypeValidity();
}
function CheckCustomerId() {
customerId = $("#" + mId + "hdnCustomerId").val();
if (customerId !== null && customerId !== "") {
return true;
}
return false;
}
function SetMessageBox(msg, id) {
alert(msg);
}
function GetAddressByZipCode() {
var zipCodeValue = $("#" + mId + "zipCode").val();
$("#txtState").val("");
$("#" + mId + "txtStreet").val("");
$("#" + mId + "city").val("");
$("#" + mId + "txtsenderCityjapan").val("");
$("#" + mId + "txtstreetJapanese").val("");
var zipCodePattern = /^\d{7}?$/;
test = zipCodePattern.test(zipCodeValue);
if (!test) {
$("#" + mId + "zipCode").val("");
$("#" + mId + "zipCode").focus();
$("#" + mId + "zipCode").attr("style", "display:block; background:#FFCCD2");
return alert("Please Enter Valid Zip Code(XXXXXXX)");
}
var dataToSend = { MethodName: "GetAddressDetailsByZipCode", zipCode: zipCodeValue };
var url = "";
$.post(url, dataToSend, function (erd) {
if (erd !== null) {
debugger
var dr = jQuery.parseJSON(erd);
if (erd == false) {
$("#" + mId + "ddlState").val("");
$("#" + mId + "txtStreet").val("");
$("#" + mId + "city").val("");
$("#" + mId + "zipCode").focus();
$("#" + mId + "zipCode").attr("style", "display:block; background:#FFCCD2");
return alert("Please Enter Valid Zip Code(XXXXXXX)");
}
//$("#tempAddress").html(erd);
if (dr[0].errorCode == "0") {
$("#" + mId + "ddlState").val(dr[0].STATE_ID);
$("#" + mId + "ddlStateHidden").val(dr[0].STATE_ID);
$("#" + mId + "cityHidden").val(dr[0].CITY_NAME);
//$("#" + mId + "txtStreet").val(dr[0].STREET_NAME);
$("#" + mId + "city").val(dr[0].CITY_NAME);
PopulateAreaDDL(dr);
}
else {
$("#" + mId + "ddlState").val("");
$("#" + mId + "txtStreet").val("");
$("#" + mId + "city").val("");
$("#" + mId + "zipCode").focus();
$("#" + mId + "zipCode").attr("style", "display:block; background:#FFCCD2");
return alert("Please Enter Valid Zip Code(XXXXXXX)");
}
}
}).fail(function (data) {
$("#loadingDiv").LoadingOverlay("hide", true);
swal(result.Msg, "Error Occured", "error");
});
}
function ShowIdTypeInfo() {
var idInfo = $("#" + mId + "idType").val();
if (idInfo == "" || idInfo == null) {
alert("Please select id type first!")
}
else {
alert(idInfo.split("|")[1]);
}
}
function GetAddressByRowID(rowId, zipCode) {
var dataToSend = { MethodName: "GetAddressDetailsByZipCode", zipCode: zipCode, RowID: rowId };
$.post("/AgentNew/Administration/CustomerSetup/CustomerRegistration/Manage.aspx", dataToSend, function (erd) {
if (erd !== null) {
var dr = jQuery.parseJSON(erd);
if (erd == false) {
$("#" + mId + "ddlState").val("");
$("#" + mId + "txtStreet").val("");
$("#" + mId + "city").val("");
$("#" + mId + "zipCode").focus();
$("#" + mId + "zipCode").attr("style", "display:block; background:#FFCCD2");
return alert("Please Enter Valid Zip Code(XXXXXXX)");
}
//$("#tempAddress").html(erd);
if (dr[0].errorCode == "0") {
$("#" + mId + "ddlState").val(dr[0].STATE_ID);
$("#" + mId + "ddlStateHidden").val(dr[0].STATE_ID);
$("#" + mId + "cityHidden").val(dr[0].CITY_NAME);
//$("#" + mId + "txtStreet").val(dr[0].STREET_NAME);
$("#" + mId + "city").val(dr[0].CITY_NAME);
PopulateAreaDDL(dr, rowId);
}
else {
$("#" + mId + "ddlState").val("");
$("#" + mId + "txtStreet").val("");
$("#" + mId + "city").val("");
$("#" + mId + "zipCode").focus();
$("#" + mId + "zipCode").attr("style", "display:block; background:#FFCCD2");
return alert("Please Enter Valid Zip Code(XXXXXXX)");
}
}
}).fail(function () {
alert("Oops!!! something went wrong, please try again.");
});
}
function PopulateAreaDDL(data, selectedValue) {
var ddl = document.getElementById(mId + "txtStreet");
$(ddl).empty();
var option, selValue = "";
if (selectedValue) {
selValue = selectedValue;
}
if (data.length > 1) {
option = document.createElement("option");
option.text = "Select Area";
option.value = "";
ddl.options.add(option);
}
for (var i = 0; i < data.length; i++) {
option = document.createElement("option");
option.text = data[i].STREET_NAME;
option.value = data[i].ROW_ID;
if (selValue.toString() === option.value) {
option.selected = true;
}
try {
ddl.options.add(option);
}
catch (e) {
alert(e);
}
}
}
function PopulateCustomerData() {
$("#" + mId + "firstName").val('firstname');
$("#" + mId + "middleName").val('middlename');
$("#" + mId + "lastName").val('lastname');
$("#" + mId + "genderList").val('98');
$("#" + mId + "email").val('email@gmail.com');
$("#" + mId + "phoneNumber").val('014219090');
$("#" + mId + "nativeCountry").val('16');
//$("#" + mId + "dob").val('1995-02-03');
$("#" + mId + "occupation").val('11261');
//$("#" + mId + "IssueDate").val('2020-01-01');
//$("#" + mId + "ExpireDate").val('2020-07-22');
$("#" + mId + "idType").val('10997|Passport|E');
$("#" + mId + "verificationTypeNo").val('23165asdf564');
$("#" + mId + "txtAdditionalAddress").val('additionaladdress');
$("#" + mId + "txtNameofEmployeer").val('nameOfEmployeer');
$("#" + mId + "txtRemarks").val('CustomerRemarks');
$("#" + mId + "txtSSnNo").val('ssnno');
$("#" + mId + "ddlSalary").val('JPY170,000 - JPY340,000');
$("#" + mId + "ddlEmployeeBusType").val('11008');
$("#" + mId + "ddlVisaStatus").val('11019');
$("#" + mId + "ddSourceOfFound").val('11167');
$("#" + mId + "ddlDocType").val('11054');
}
function PopulateBenifiairyData() {
$("#" + mId + "recDdlPaymentMode option:selected").val();
$("#" + mId + "recTxtEmail").val('recemail@gmail.com');
$("#" + mId + "recTxtReceiverFName").val('firstnamerec');
$("#" + mId + "recTxtReceiverMName").val('middlenamerec');
$("#" + mId + "recTxtReceiverLName").val('lastnamerec');
$("#" + mId + "recTxtReceiverAddress").val('addressrec');
$("#" + mId + "recTxtReceiverCity").val('cityrec');
$("#" + mId + "recTxtContactNo").val('44444444');
$("#" + mId + "recDdlRelationship").val('10998');
$("#" + mId + "recTxtPlaceOfIssue").val('kathmandu');
$("#" + mId + "recDdlIdType").val('10997');
$("#" + mId + "recTxtIdValue").val('1212121212');
$("#" + mId + "recReceiverAccountNo").val('986566546');
$("#" + mId + "recDdlPurposeOfRemitance").val('11141');
$("#" + mId + "recTxtRemarksRec").val('remarksrec');
}