From ecfaf669713b6e838b5dafe0dbc151059a2846a8 Mon Sep 17 00:00:00 2001 From: arjun Date: Tue, 18 Aug 2020 12:19:38 +0000 Subject: [PATCH] --- Database/Sp/proc_sendRequest.sql | 2 +- .../Scripts/SendTxnJs/SendMoneyRequest.js | 81 ++++++++--- .../WebPages/SendTxn/SendTxnRequest.aspx | 130 ++++++++++-------- .../SendTxn/SendTxnRequest.aspx.designer.cs | 18 +-- 4 files changed, 141 insertions(+), 90 deletions(-) diff --git a/Database/Sp/proc_sendRequest.sql b/Database/Sp/proc_sendRequest.sql index f830525..bb1cf09 100644 --- a/Database/Sp/proc_sendRequest.sql +++ b/Database/Sp/proc_sendRequest.sql @@ -70,7 +70,7 @@ BEGIN RETURN END - SELECT FULLNAME, RECEIVERID, errorCode = 0 + SELECT FULLNAME = firstName + ISNULL(' '+middleName, '') + ISNULL(' '+lastName1, '') , RECEIVERID, errorCode = 0 FROM RECEIVERINFORMATION (NOLOCK) WHERE CUSTOMERID = @CUSTOMERID END diff --git a/JMEAgentSystem/Scripts/SendTxnJs/SendMoneyRequest.js b/JMEAgentSystem/Scripts/SendTxnJs/SendMoneyRequest.js index ab139a0..06cc515 100644 --- a/JMEAgentSystem/Scripts/SendTxnJs/SendMoneyRequest.js +++ b/JMEAgentSystem/Scripts/SendTxnJs/SendMoneyRequest.js @@ -2,7 +2,16 @@ $(document).ready(function () { $("#branchRequired").hide(); + $(document).on("change", "#" + mId + "receiverMobileNumber", function () { + var isValid = CheckForMobileNumber(this, "Mobile No."); + if (isValid === false) { + $(this).val(''); + $(this).focus(); + } + }); + $("#searchCustomer").click(function () { + ClearAllData(); $('#step2SendRemittance').hide(); $('#step2SendRemittanceAgreement').hide(); $('#signatureDiv').hide(); @@ -34,7 +43,7 @@ $(document).ready(function () { $('#step2SendRemittanceSaveButton').show(); CustomerSignature(); - ParseDDlDynamic(response, 'ddlBenedeciary', 'FULLNAME', 'RECEIVERID', 'Select Beneficiary') + ParseDDlDynamic(response, 'ddlBenedeciary', 'FULLNAME', 'RECEIVERID', 'Select Beneficiary'); } else { alert(response[0].Msg); @@ -59,6 +68,7 @@ $(document).ready(function () { } }); $("#" + mId + "ddlBenedeciary").on("change", function () { + ClearAllData(); var benefeciaryId = $("#" + mId + "ddlBenedeciary").val(); if (benefeciaryId === null || benefeciaryId === '' || benefeciaryId === undefined) { return false; @@ -78,6 +88,7 @@ $(document).ready(function () { $("#" + mId + "receiverMobileNumber").val(response[0].mobile); $("#" + mId + "purpose").val(response[0].address); $("#" + mId + "relationship").val(response[0].address); + $("#" + mId + "accountNo").val(response[0].receiverAccountNo); if (response[0].relationship === '11339') { $("#" + mId + "otherRelationshipTextBox").val(response[0].relationOther); @@ -119,6 +130,7 @@ $(document).ready(function () { } } } + ShowHideAccountNo(); } else { alert(response[0].Msg); @@ -129,7 +141,7 @@ $(document).ready(function () { }); $("#" + mId + "purpose").on("change", function () { let purposeValue = $("#" + mId + "purpose option:selected").val(); - if (purposeValue == '11347') { + if (purposeValue === '11347') { $("#purposeOtherDiv").show(); } else { $("#purposeOtherDiv").hide(); @@ -137,10 +149,10 @@ $(document).ready(function () { }); $("#" + mId + "relationship").on("change", function () { let relationValue = $("#" + mId + "relationship option:selected").val(); - if (relationValue == '11339') { - $("#" + mId + "otherRelationDiv").show(); + if (relationValue === '11339') { + $("#otherRelationDiv").show(); } else { - $("#" + mId + "otherRelationDiv").hide(); + $("#otherRelationDiv").hide(); } }); @@ -218,16 +230,20 @@ $(document).ready(function () { }); $("#" + mId + "pMode").on('change', function () { - var pmode = $("#" + mId + "pMode").val(); - if (pmode == "2") { - $("#accountDiv").show(); - } else { - $("#accountDiv").hide(); - } + ShowHideAccountNo(); }); }); +function ShowHideAccountNo() { + var pmode = $("#" + mId + "pMode").val(); + if (pmode === "2") { + $("#accountDiv").show(); + } else { + $("#accountDiv").hide(); + } +} + function ResetAmountFields() { //Reset Fields $("#" + mId + "txtPayAmt").val(''); @@ -619,14 +635,8 @@ function CommaFormatted(amount, amountMain) { else return amount; } -function ClearCalculatedAmount() { - $("#" + mId + "txtCollAmt").val(''); - $("#" + mId + "lblSendAmt").val(0); - $("#" + mId + "lblServiceChargeAmt").val(0); - $("#" + mId + "lblExRate").val(0); - $("#" + mId + "txtPayAmt").val(''); - $("#" + mId + "customerRateFields").hide(); -} + + function checkdata(amt, obj) { if (amt > 0) CalculateTxn(amt, obj); @@ -719,7 +729,7 @@ function CalculateTxn(amt, obj, isManualSc) { if (pCountry === "203" && payCurr === "USD") { if ((pMode === "1" && pAgent !== 2091) || (pMode !== "12" && pAgent !== 2091)) { alert('USD receiving is only allow for Door to Door'); - ClearAmountFields(); + ClearCalculatedAmount(); return false; } } @@ -760,7 +770,7 @@ function ParseCalculateData(response, amtType) { var data = response; if (data[0].ErrCode === '1') { alert(data[0].Msg); - ClearAmountFields(); + ClearCalculatedAmount(); return; } @@ -886,4 +896,33 @@ function SetDDLValueSelected(ddl, selectText) { }); } +function ClearAllData() { + $("#" + mId + "receiverFullName").val(''); + $("#" + mId + "receiveraddress").val(''); + $("#" + mId + "receiverMobileNumber").val(''); + $("#" + mId + "purpose").val(''); + $("#" + mId + "relationship").val(''); + $("#" + mId + "purposeOther").val(''); + $("#" + mId + "otherRelationshipTextBox").val(''); + $('#otherRelationDiv').hide(); + $('#purposeOtherDiv').hide(); + $("#" + mId + "purpose").val(''); + $("#" + mId + "relationship").val(''); + $("#" + mId + "pCountry").val(''); + $("#" + mId + "pAgent").empty(); + $("#" + mId + "branch").empty(); + + SetDDLTextSelected(mId + "pCountry", ''); + ClearCalculatedAmount(); +} +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; +} \ No newline at end of file diff --git a/JMEAgentSystem/WebPages/SendTxn/SendTxnRequest.aspx b/JMEAgentSystem/WebPages/SendTxn/SendTxnRequest.aspx index 3928a54..cced130 100644 --- a/JMEAgentSystem/WebPages/SendTxn/SendTxnRequest.aspx +++ b/JMEAgentSystem/WebPages/SendTxn/SendTxnRequest.aspx @@ -31,7 +31,7 @@ - -