|
|
@ -2,6 +2,7 @@ |
|
|
|
using Business.Customer; |
|
|
|
using Common.Helper; |
|
|
|
using Common.Model.BankModel; |
|
|
|
using Common.Utility; |
|
|
|
using JMEAgentSystem.Library; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using Repository.DAO; |
|
|
@ -12,12 +13,16 @@ using Swift.API.Common; |
|
|
|
using Swift.API.Common.ExRate; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.ComponentModel; |
|
|
|
using System.Data; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using System.Web; |
|
|
|
using System.Web.Script.Serialization; |
|
|
|
using System.Web.UI; |
|
|
|
using System.Xml.Linq; |
|
|
|
using System.Web.UI.WebControls; |
|
|
|
using Newtonsoft.Json.Linq; |
|
|
|
|
|
|
|
namespace JMEAgentSystem.WebPages.SendTxn |
|
|
|
{ |
|
|
@ -63,6 +68,21 @@ namespace JMEAgentSystem.WebPages.SendTxn |
|
|
|
case "PCurrPcountry": |
|
|
|
PCurrPcountry(); |
|
|
|
break; |
|
|
|
case "getAdditionalCDDI": |
|
|
|
GetAdditionalCDDI(); |
|
|
|
break; |
|
|
|
case "sendTransaction": |
|
|
|
SendTransactionJS(); |
|
|
|
break; |
|
|
|
case "ofacList": |
|
|
|
GetOfacList(); |
|
|
|
break; |
|
|
|
case "complainceList": |
|
|
|
GetComplainceList(); |
|
|
|
break; |
|
|
|
case "saveTransaction": |
|
|
|
SaveTransaction(); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
@ -73,6 +93,265 @@ namespace JMEAgentSystem.WebPages.SendTxn |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void SendTransactionJS() |
|
|
|
{ |
|
|
|
string json = ""; |
|
|
|
// var randObj = new Random();
|
|
|
|
// var agentRefId = randObj.Next(1000000000, 1999999999).ToString();
|
|
|
|
var receiverId = ddlBenedeciary.SelectedValue; |
|
|
|
var isExrateFromPartner = "N"; |
|
|
|
|
|
|
|
DataSet ds = new DataSet(); |
|
|
|
|
|
|
|
var idNumber = Request.Form["idNumber"]; |
|
|
|
var receiverFullNameValue = Request.Form["receiverFullNameValue"]; |
|
|
|
var receiveraddressValue = Request.Form["receiveraddressValue"]; |
|
|
|
var receiverMobileNumberValue = Request.Form["receiverMobileNumberValue"]; |
|
|
|
var pCountryId = Request.Form["pCountryId"]; |
|
|
|
var pmodeId = Request.Form["pmodeId"]; |
|
|
|
var pagentId = Request.Form["pagentId"]; |
|
|
|
var branchId = Request.Form["branchId"]; |
|
|
|
var accountnoValue = Request.Form["accountnoValue"]; |
|
|
|
var cAmt = Request.Form["cAmt"]; |
|
|
|
var tamt = Request.Form["tamt"]; |
|
|
|
var serviceCharge = Request.Form["serviceCharge"]; |
|
|
|
var purposeOfRemittanceId = Request.Form["purposeOfRemittanceId"]; |
|
|
|
var otherPurpose = Request.Form["otherPurpose"]; |
|
|
|
var relationShipId = Request.Form["relationShipId"]; |
|
|
|
var otherRelation = Request.Form["otherRelation"]; |
|
|
|
var referralNameValue = Request.Form["referralNameValue"]; |
|
|
|
var collectionMode = Request.Form["collectionMode"]; |
|
|
|
var deliveryMethod = Request.Form["deliveryMethod"]; |
|
|
|
var agentRefId = Request.Form["agentRefId"]; |
|
|
|
var isCDDI = Request.Form["isCDDI"]; |
|
|
|
var xmlDataForCDDI = Request.Form["xmlDataForCDDI"]; |
|
|
|
|
|
|
|
if (agentRefId == null) |
|
|
|
{ |
|
|
|
var randObj = new Random(); |
|
|
|
agentRefId = randObj.Next(1000000000, 1999999999).ToString(); |
|
|
|
} |
|
|
|
|
|
|
|
SendTransactionModel sendTxn = new SendTransactionModel() |
|
|
|
{ |
|
|
|
IdNumber = idNumber, |
|
|
|
ReceiverId = ddlBenedeciary.SelectedValue, |
|
|
|
ReceiverFullName = receiverFullNameValue, |
|
|
|
Receiveraddress = receiveraddressValue, |
|
|
|
ReceiverMobileNumber = receiverMobileNumberValue, |
|
|
|
PCountryId = pCountryId, |
|
|
|
PmodeId = pmodeId, |
|
|
|
PagentId = pagentId, |
|
|
|
BranchId = branchId, |
|
|
|
AccountNumber = accountnoValue, |
|
|
|
CAmt = cAmt, |
|
|
|
Tamt = tamt, |
|
|
|
ServiceCharge = serviceCharge, |
|
|
|
PurposeOfRemittance = purposeOfRemittanceId, |
|
|
|
OtherPurposeOfRemittance = otherPurpose, |
|
|
|
RelationShip = relationShipId, |
|
|
|
OtherRelationShip = otherRelation, |
|
|
|
ReferralName = referralNameValue, |
|
|
|
BranchManual = branch_manual.Text, |
|
|
|
bankName = hddPagentName.Value, |
|
|
|
branchName = hddPBranchName.Value, |
|
|
|
DeliveryMethod = deliveryMethod, |
|
|
|
collMode = collectionMode, |
|
|
|
AgentRefId = agentRefId, |
|
|
|
IsCDDI = isCDDI, |
|
|
|
CDDIXml = xmlDataForCDDI |
|
|
|
}; |
|
|
|
|
|
|
|
if (isExrateFromPartner == "true") |
|
|
|
{ |
|
|
|
//ds = st.ValidateTransactionTP(sendTxn);
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
ds = st.ValidateTransaction(sendTxn); |
|
|
|
} |
|
|
|
|
|
|
|
var dbResult = st.ParseDbResult(ds.Tables[0]); |
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(receiverId)) |
|
|
|
{ |
|
|
|
if (dbResult.ErrorCode == "0") |
|
|
|
{ |
|
|
|
hddReceiverId.Value = dbResult.Extra; |
|
|
|
} |
|
|
|
else if (dbResult.ErrorCode == "100") |
|
|
|
{ |
|
|
|
var dbResult1 = st.ParseDbResult(ds.Tables[2]); |
|
|
|
|
|
|
|
if (dbResult1.ErrorCode == "0") |
|
|
|
{ |
|
|
|
hddReceiverId.Value = dbResult1.Extra; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var dbResult2 = st.ParseDbResult(ds.Tables[4]); |
|
|
|
hddReceiverId.Value = dbResult2.Extra; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (dbResult.ErrorCode == "101" || dbResult.ErrorCode == "102" || dbResult.ErrorCode == "103") |
|
|
|
{ |
|
|
|
var dbResult1 = st.ParseDbResult(ds.Tables[2]); |
|
|
|
hddReceiverId.Value = dbResult1.Extra; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (dbResult.ErrorCode != "0") |
|
|
|
{ |
|
|
|
Response.ContentType = "text/plain"; |
|
|
|
json = GetStatic.DataSetToJSON(ds); |
|
|
|
Response.Write(json); |
|
|
|
Response.End(); |
|
|
|
} |
|
|
|
|
|
|
|
//else
|
|
|
|
//{
|
|
|
|
// var sendTxnResult = st.SaveSendRequest(GetStatic.GetUser(), sendTxn);
|
|
|
|
// if (sendTxnResult.ErrorCode == "0")
|
|
|
|
// {
|
|
|
|
// if (sendTxnResult.ErrorCode == "0" && !string.IsNullOrEmpty(hddImgURL.Value) && !string.IsNullOrWhiteSpace(hddImgURL.Value))
|
|
|
|
// {
|
|
|
|
// var res = _customerServices.GetCustomerDetailsForFileUpload(sendTxnResult.Extra.Split('|')[0]).Split('|');
|
|
|
|
// var customerId = res[0];
|
|
|
|
// var membershipId = res[1];
|
|
|
|
// var registerDate = res[2];
|
|
|
|
|
|
|
|
// string signatureName = GetStatic.UploadSignatureImage(hddImgURL.Value, registerDate, membershipId, customerId);
|
|
|
|
// if (signatureName != "1")
|
|
|
|
// {
|
|
|
|
// _customerServices.AddCustomerSignature(customerId, GetStatic.GetUser(), signatureName
|
|
|
|
// , "Staff Visit - Send Txn(Customer Signature)", sendTxnResult.Id);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// var url = ("PrintSendMoneyRequestDetails.aspx?customerId=" + sendTxnResult.Extra.Split('|')[1] + "&rowId=" + sendTxnResult.Id);
|
|
|
|
// Response.Redirect(url);
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
|
|
|
|
// pCountry.SelectedValue = "";
|
|
|
|
// GetStatic.AlertMessage(this.Page, sendTxnResult.Msg);
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
Response.ContentType = "text/plain"; |
|
|
|
json = GetStatic.DataSetToJSON(ds); |
|
|
|
Response.Write(json); |
|
|
|
Response.End(); |
|
|
|
} |
|
|
|
|
|
|
|
private void SaveTransaction() |
|
|
|
{ |
|
|
|
string json = ""; |
|
|
|
// var randObj = new Random();
|
|
|
|
// var agentRefId = randObj.Next(1000000000, 1999999999).ToString();
|
|
|
|
var receiverId = ddlBenedeciary.SelectedValue; |
|
|
|
var isExrateFromPartner = "N"; |
|
|
|
|
|
|
|
DataSet ds = new DataSet(); |
|
|
|
|
|
|
|
var idNumber = Request.Form["idNumber"]; |
|
|
|
var receiverFullNameValue = Request.Form["receiverFullNameValue"]; |
|
|
|
var receiveraddressValue = Request.Form["receiveraddressValue"]; |
|
|
|
var receiverMobileNumberValue = Request.Form["receiverMobileNumberValue"]; |
|
|
|
var pCountryId = Request.Form["pCountryId"]; |
|
|
|
var pmodeId = Request.Form["pmodeId"]; |
|
|
|
var pagentId = Request.Form["pagentId"]; |
|
|
|
var branchId = Request.Form["branchId"]; |
|
|
|
var accountnoValue = Request.Form["accountnoValue"]; |
|
|
|
var cAmt = Request.Form["cAmt"]; |
|
|
|
var tamt = Request.Form["tamt"]; |
|
|
|
var serviceCharge = Request.Form["serviceCharge"]; |
|
|
|
var purposeOfRemittanceId = Request.Form["purposeOfRemittanceId"]; |
|
|
|
var otherPurpose = Request.Form["otherPurpose"]; |
|
|
|
var relationShipId = Request.Form["relationShipId"]; |
|
|
|
var otherRelation = Request.Form["otherRelation"]; |
|
|
|
var referralNameValue = Request.Form["referralNameValue"]; |
|
|
|
var collectionMode = Request.Form["collectionMode"]; |
|
|
|
var deliveryMethod = Request.Form["deliveryMethod"]; |
|
|
|
var agentRefId = Request.Form["agentRefId"]; |
|
|
|
var isCDDI = Request.Form["isCDDI"]; |
|
|
|
var xmlDataForCDDI = Request.Form["xmlDataForCDDI"]; |
|
|
|
string xmlDataForCDDI2 = ConvertJsonToXml(xmlDataForCDDI); |
|
|
|
|
|
|
|
if (agentRefId == null) |
|
|
|
{ |
|
|
|
var randObj = new Random(); |
|
|
|
agentRefId = randObj.Next(1000000000, 1999999999).ToString(); |
|
|
|
} |
|
|
|
|
|
|
|
SendTransactionModel sendTxn = new SendTransactionModel() |
|
|
|
{ |
|
|
|
IdNumber = idNumber, |
|
|
|
ReceiverId = ddlBenedeciary.SelectedValue, |
|
|
|
ReceiverFullName = receiverFullNameValue, |
|
|
|
Receiveraddress = receiveraddressValue, |
|
|
|
ReceiverMobileNumber = receiverMobileNumberValue, |
|
|
|
PCountryId = pCountryId, |
|
|
|
PmodeId = pmodeId, |
|
|
|
PagentId = pagentId, |
|
|
|
BranchId = branchId, |
|
|
|
AccountNumber = accountnoValue, |
|
|
|
CAmt = cAmt, |
|
|
|
Tamt = tamt, |
|
|
|
ServiceCharge = serviceCharge, |
|
|
|
PurposeOfRemittance = purposeOfRemittanceId, |
|
|
|
OtherPurposeOfRemittance = otherPurpose, |
|
|
|
RelationShip = relationShipId, |
|
|
|
OtherRelationShip = otherRelation, |
|
|
|
ReferralName = referralNameValue, |
|
|
|
BranchManual = branch_manual.Text, |
|
|
|
bankName = hddPagentName.Value, |
|
|
|
branchName = hddPBranchName.Value, |
|
|
|
DeliveryMethod = deliveryMethod, |
|
|
|
collMode = collectionMode, |
|
|
|
AgentRefId = agentRefId, |
|
|
|
IsCDDI = isCDDI, |
|
|
|
CDDIXml = xmlDataForCDDI2 |
|
|
|
}; |
|
|
|
var sendTxnResult = st.SaveSendRequest(GetStatic.GetUser(), sendTxn); |
|
|
|
if (sendTxnResult.ErrorCode == "0") |
|
|
|
{ |
|
|
|
//if (sendTxnResult.ErrorCode == "0" && !string.IsNullOrEmpty(hddImgURL.Value) && !string.IsNullOrWhiteSpace(hddImgURL.Value))
|
|
|
|
//{
|
|
|
|
// var res = _customerServices.GetCustomerDetailsForFileUpload(sendTxnResult.Extra.Split('|')[0]).Split('|');
|
|
|
|
// var customerId = res[0];
|
|
|
|
// var membershipId = res[1];
|
|
|
|
// var registerDate = res[2];
|
|
|
|
|
|
|
|
// string signatureName = GetStatic.UploadSignatureImage(hddImgURL.Value, registerDate, membershipId, customerId);
|
|
|
|
// if (signatureName != "1")
|
|
|
|
// {
|
|
|
|
// _customerServices.AddCustomerSignature(customerId, GetStatic.GetUser(), signatureName
|
|
|
|
// , "Staff Visit - Send Txn(Customer Signature)", sendTxnResult.Id);
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
|
|
|
GetStatic.AlertMessage(this.Page, sendTxnResult.Msg); |
|
|
|
//var url = ("PrintSendMoneyRequestDetails.aspx?customerId=" + sendTxnResult.Extra.Split('|')[1] + "&rowId=" + sendTxnResult.Id);
|
|
|
|
//Response.Redirect(url);
|
|
|
|
json = JsonConvert.SerializeObject(sendTxnResult); |
|
|
|
Response.Write(json); |
|
|
|
Response.End(); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
pCountry.SelectedValue = ""; |
|
|
|
GetStatic.AlertMessage(this.Page, sendTxnResult.Msg); |
|
|
|
} |
|
|
|
|
|
|
|
Response.ContentType = "text/plain"; |
|
|
|
json = JsonConvert.SerializeObject(sendTxnResult); |
|
|
|
// json = GetStatic.DataTableToJson(sendTxnResult);
|
|
|
|
Response.Write(json); |
|
|
|
Response.End(); |
|
|
|
} |
|
|
|
|
|
|
|
private void GetBenefeciaryDetails() |
|
|
|
{ |
|
|
|
string benefeciaryId = Request.Form["BenefeciaryId"]; |
|
|
@ -170,26 +449,7 @@ namespace JMEAgentSystem.WebPages.SendTxn |
|
|
|
Response.Write(json); |
|
|
|
Response.End(); |
|
|
|
} |
|
|
|
public static string DataTableToJson(DataTable table) |
|
|
|
{ |
|
|
|
if (table == null) |
|
|
|
return ""; |
|
|
|
var list = new List<Dictionary<string, object>>(); |
|
|
|
|
|
|
|
foreach (DataRow row in table.Rows) |
|
|
|
{ |
|
|
|
var dict = new Dictionary<string, object>(); |
|
|
|
|
|
|
|
foreach (DataColumn col in table.Columns) |
|
|
|
{ |
|
|
|
dict[col.ColumnName] = string.IsNullOrEmpty(row[col].ToString()) ? "" : row[col]; |
|
|
|
} |
|
|
|
list.Add(dict); |
|
|
|
} |
|
|
|
var serializer = new JavaScriptSerializer(); |
|
|
|
string json = serializer.Serialize(list); |
|
|
|
return json; |
|
|
|
} |
|
|
|
public string GetAPIPartnerId() |
|
|
|
{ |
|
|
|
string partnerIds = GetStatic.ReadWebConfig("transfast", "") + "," + GetStatic.ReadWebConfig("jmeNepal", "") + "," + GetStatic.ReadWebConfig("donga", ""); |
|
|
@ -320,90 +580,340 @@ namespace JMEAgentSystem.WebPages.SendTxn |
|
|
|
Response.End(); |
|
|
|
} |
|
|
|
|
|
|
|
protected void Save_Click(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
var idNumber = senderIdNumber.Text; |
|
|
|
var receiverFullNameValue = receiverFullName.Text; |
|
|
|
var receiveraddressValue = receiveraddress.Text; |
|
|
|
var receiverMobileNumberValue = receiverMobileNumber.Text; |
|
|
|
var pCountryId = pCountry.SelectedValue; |
|
|
|
var pmodeId = hddPmode.Value; |
|
|
|
var pagentId = hddPagent.Value; |
|
|
|
var branchId = hddpBranch.Value; |
|
|
|
var accountnoValue = accountNo.Text; |
|
|
|
var cAmt = txtCollAmt.Text; |
|
|
|
var tamt = hddTamt.Value; |
|
|
|
var serviceCharge = hddServiceCharge.Value; |
|
|
|
var purposeOfRemittanceId = purpose.SelectedValue; |
|
|
|
var otherPurpose = purposeOther.Text; |
|
|
|
var relationShipId = relationship.SelectedValue; |
|
|
|
var otherRelation = otherRelationshipTextBox.Text; |
|
|
|
var referralNameValue = referralName.Text; |
|
|
|
var collectionMode = ddlCollMode.SelectedValue; |
|
|
|
private void PCurrPcountry() |
|
|
|
{ |
|
|
|
string pCountry = Request.Form["pCountry"]; |
|
|
|
string pMode = Request.Form["pMode"]; |
|
|
|
string pAgent = Request.Form["pAgent"]; |
|
|
|
|
|
|
|
SendTransactionModel sendTxn = new SendTransactionModel() |
|
|
|
DataTable Dt = st.LoadPayCurr(pCountry, pMode, pAgent); |
|
|
|
Response.ContentType = "text/plain"; |
|
|
|
string json = DataTableToJson(Dt); |
|
|
|
Response.Write(json); |
|
|
|
Response.End(); |
|
|
|
} |
|
|
|
|
|
|
|
protected void btnProceed_Click(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
IdNumber = idNumber, |
|
|
|
ReceiverFullName = receiverFullNameValue, |
|
|
|
Receiveraddress = receiveraddressValue, |
|
|
|
ReceiverMobileNumber = receiverMobileNumberValue, |
|
|
|
PCountryId = pCountryId, |
|
|
|
PmodeId = pmodeId, |
|
|
|
PagentId = pagentId, |
|
|
|
BranchId = branchId, |
|
|
|
AccountNumber = accountnoValue, |
|
|
|
CAmt = cAmt, |
|
|
|
Tamt = tamt, |
|
|
|
ServiceCharge = serviceCharge, |
|
|
|
PurposeOfRemittance = purposeOfRemittanceId, |
|
|
|
OtherPurposeOfRemittance = otherPurpose, |
|
|
|
RelationShip = relationShipId, |
|
|
|
OtherRelationShip = otherRelation, |
|
|
|
ReferralName = referralNameValue, |
|
|
|
BranchManual = branch_manual.Text, |
|
|
|
bankName = hddPagentName.Value, |
|
|
|
branchName = hddPBranchName.Value, |
|
|
|
collMode = collectionMode |
|
|
|
}; |
|
|
|
//Proceed();
|
|
|
|
} |
|
|
|
|
|
|
|
var result = st.SaveSendRequest(GetStatic.GetUser(), sendTxn); |
|
|
|
if (result.ErrorCode == "0") |
|
|
|
#region Questionnaire
|
|
|
|
private void GetOfacList() |
|
|
|
{ |
|
|
|
if (result.ErrorCode == "0" && !string.IsNullOrEmpty(hddImgURL.Value) && !string.IsNullOrWhiteSpace(hddImgURL.Value)) |
|
|
|
var dbResult = Request.Form["dbResult"]; |
|
|
|
var ofacTable = Request.Form["ofacTable"]; |
|
|
|
var receiverFullName = Request.Form["receiverFullName"]; |
|
|
|
|
|
|
|
List<DbResult1> DbResult1 = JsonConvert.DeserializeObject<List<DbResult1>>(dbResult); |
|
|
|
var dbResult1 = DbResult1.ToDataTable(); |
|
|
|
|
|
|
|
List<OfacTable> OfacTableList = JsonConvert.DeserializeObject<List<OfacTable>>(ofacTable); |
|
|
|
var dt = OfacTableList.ToDataTable(); |
|
|
|
|
|
|
|
var confirmText = "Confirmation:\n_____________________________________"; |
|
|
|
confirmText += "\n\nYou are confirming to send this OFAC/DJ suspicious transaction!!!"; |
|
|
|
confirmText += "\n\nPlease note if this customer is found to be valid person from OFAC/DJ List then Teller will be charged fine from management"; |
|
|
|
confirmText += "\n\n\nPlease make sure you have proper evidence that show this customer is not from OFAC/DJ List"; |
|
|
|
// btnProceedCc.ConfirmText = confirmText;
|
|
|
|
int cols = dt.Columns.Count; |
|
|
|
var db = st.ParseDbResult(dbResult1); |
|
|
|
spnWarningMsg.InnerHtml = db.Msg; |
|
|
|
var str = new StringBuilder("<div class='table-responsive'><table class='TBLData table table-striped table-bordered' border=\"1\" cellspacing=0 cellpadding=\"3\">"); |
|
|
|
str.Append("<tr>"); |
|
|
|
for (int i = 0; i < cols; i++) |
|
|
|
{ |
|
|
|
str.Append("<th><div align=\"left\">" + dt.Columns[i].ColumnName + "</div></th>"); |
|
|
|
} |
|
|
|
str.Append("</tr>"); |
|
|
|
foreach (DataRow dr in dt.Rows) |
|
|
|
{ |
|
|
|
var res = _customerServices.GetCustomerDetailsForFileUpload(result.Extra.Split('|')[0]).Split('|'); |
|
|
|
var customerId = res[0]; |
|
|
|
var membershipId = res[1]; |
|
|
|
var registerDate = res[2]; |
|
|
|
str.Append("<tr>"); |
|
|
|
str.Append("<td align=\"left\">" + dr[0] + "</td>"); |
|
|
|
|
|
|
|
string signatureName = GetStatic.UploadSignatureImage(hddImgURL.Value, registerDate, membershipId, customerId); |
|
|
|
if (signatureName != "1") |
|
|
|
string[] strArr; |
|
|
|
if (receiverFullName.Split(' ').Length > 2) |
|
|
|
{ |
|
|
|
_customerServices.AddCustomerSignature(customerId, GetStatic.GetUser(), signatureName |
|
|
|
, "Staff Visit - Send Txn(Customer Signature)", result.Id); |
|
|
|
strArr = new string[] { receiverFullName.Split(' ')[0].ToUpper(), receiverFullName.Split(' ')[1].ToUpper(), receiverFullName.Split(' ')[2].ToUpper() }; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
strArr = new string[] { receiverFullName.Split(' ')[0].ToUpper(), receiverFullName.Split(' ')[1].ToUpper() }; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//string[] strArr = {
|
|
|
|
// receiverFullName.Text.Split(' ')[0].ToUpper() , receiverFullName.Text.Split(' ')[1].ToUpper() , receiverFullName.Text.Split(' ')[2].ToUpper()
|
|
|
|
// };
|
|
|
|
var arrlen = strArr.Length; |
|
|
|
string value = dr[1].ToString(); |
|
|
|
for (int j = 0; j < arrlen; j++) |
|
|
|
{ |
|
|
|
if (!string.IsNullOrWhiteSpace(strArr[j])) |
|
|
|
{ |
|
|
|
//if (j == 0 && !string.IsNullOrWhiteSpace(strArr[j]))
|
|
|
|
if (strArr[j].Length > 2) |
|
|
|
{ |
|
|
|
value = value.ToUpper().Replace(strArr[j], |
|
|
|
GetStatic.PutRedBackGround(strArr[j])); |
|
|
|
} |
|
|
|
} |
|
|
|
var url = ("PrintSendMoneyRequestDetails.aspx?customerId=" + result.Extra.Split('|')[1] + "&rowId=" + result.Id); |
|
|
|
Response.Redirect(url); |
|
|
|
} |
|
|
|
str.Append("<td align=\"left\">" + value + "</td>"); |
|
|
|
str.Append("</tr>"); |
|
|
|
} |
|
|
|
str.Append("<tr>"); |
|
|
|
str.Append("<td colspan=\"2\">OFAC Listed Customer are BLACK Listed customer or Suspicious for terrorist or Money Loundery Customer" + |
|
|
|
", please ask for valid documentation from customer</td>"); |
|
|
|
str.Append("</tr>"); |
|
|
|
str.Append("</table></div>"); |
|
|
|
divOfac.InnerHtml = str.ToString(); |
|
|
|
} |
|
|
|
|
|
|
|
private void GetComplainceList() |
|
|
|
{ |
|
|
|
var json = ""; |
|
|
|
DataTable dt = new DataTable(); |
|
|
|
List<ComplianceTable> ComplainceTableList = new List<ComplianceTable>(); |
|
|
|
List<OfacTable> OfacTableList = new List<OfacTable>(); |
|
|
|
|
|
|
|
|
|
|
|
var dbResult = Request.Form["dbResult"]; |
|
|
|
var complianceTable = Request.Form["complianceTable"]; |
|
|
|
var complianceType = Request.Form["complianceType"]; |
|
|
|
|
|
|
|
var randObj = new Random(); |
|
|
|
var agentRefId = randObj.Next(1000000000, 1999999999).ToString(); |
|
|
|
|
|
|
|
List<DbResult2> DbResult2 = JsonConvert.DeserializeObject<List<DbResult2>>(dbResult); |
|
|
|
var dbResult2 = DbResult2.ToDataTable(); |
|
|
|
|
|
|
|
if (complianceType == "tran") |
|
|
|
{ |
|
|
|
ComplainceTableList = JsonConvert.DeserializeObject<List<ComplianceTable>>(complianceTable); |
|
|
|
dt = ComplainceTableList.ToDataTable(); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
pCountry.SelectedValue = ""; |
|
|
|
GetStatic.AlertMessage(this.Page, result.Msg); |
|
|
|
OfacTableList = JsonConvert.DeserializeObject<List<OfacTable>>(complianceTable); |
|
|
|
dt = OfacTableList.ToDataTable(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var db = st.ParseDbResult(dbResult2); |
|
|
|
|
|
|
|
string _isCDDI = hddIsAdditionalCDDI.Value; |
|
|
|
string isVisastatusRequireQuestionnaire = db.Id.ToUpper(); |
|
|
|
if (db.ErrorCode == "101") |
|
|
|
{ |
|
|
|
btnProceed.Enabled = false; |
|
|
|
btnProceed.Visible = false; |
|
|
|
|
|
|
|
LoadComplianceListNew(db, dt); |
|
|
|
} |
|
|
|
private void PCurrPcountry() |
|
|
|
|
|
|
|
if (db.ErrorCode == "102") |
|
|
|
{ |
|
|
|
string pCountry = Request.Form["pCountry"]; |
|
|
|
string pMode = Request.Form["pMode"]; |
|
|
|
string pAgent = Request.Form["pAgent"]; |
|
|
|
btnProceed.Enabled = true; |
|
|
|
btnProceed.Visible = true; |
|
|
|
|
|
|
|
if (db.Extra2 == "Y") |
|
|
|
{ |
|
|
|
additionalDocumentDiv.Visible = true; |
|
|
|
} |
|
|
|
|
|
|
|
if (_isCDDI == "Y" || (_isCDDI == "N" && isVisastatusRequireQuestionnaire == "N")) |
|
|
|
{ |
|
|
|
LoadComplianceListNew(db, dt); |
|
|
|
} |
|
|
|
|
|
|
|
if (isVisastatusRequireQuestionnaire == "Y") |
|
|
|
{ |
|
|
|
var msgCompliance = GetStatic.ParseResultJsPrint(db); |
|
|
|
//// GetStatic.CallBackJs1(Page, "Print Message", "ManageMessage('" + msgCompliance + "-:::-" + dbResult.Extra2 + "-:::-" + agentRefId + "-:::-" + dbResult.Id + "');");
|
|
|
|
//ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "ManageMessage('" + msgCompliance + "-:::-" + db.Extra2 + "-:::-" + agentRefId + "-:::-" + db.Id + "');", true);
|
|
|
|
|
|
|
|
DataTable Dt = st.LoadPayCurr(pCountry, pMode, pAgent); |
|
|
|
Response.ContentType = "text/plain"; |
|
|
|
string json = DataTableToJson(Dt); |
|
|
|
db.ErrorCode = db.ErrorCode + "|" + agentRefId; |
|
|
|
json = JsonConvert.SerializeObject(db); |
|
|
|
Response.Write(json); |
|
|
|
Response.End(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (db.ErrorCode == "103") |
|
|
|
{ |
|
|
|
btnProceed.Enabled = true; |
|
|
|
btnProceed.Visible = true; |
|
|
|
if (_isCDDI == "Y") |
|
|
|
{ |
|
|
|
LoadComplianceListNew(db, dt); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var msgCompliance = GetStatic.ParseResultJsPrint(db); |
|
|
|
GetStatic.CallBackJs1(Page, "Print Message", "ManageMessage('" + msgCompliance + "-:::-" + db.Extra2 + "-:::-" + agentRefId + "-:::-" + db.Id + "');"); |
|
|
|
} |
|
|
|
} |
|
|
|
var mes = GetStatic.ParseResultJsPrint(db); |
|
|
|
// GetStatic.CallBackJs1(Page, "Print Message", "ManageMessage('" + mes + "');");
|
|
|
|
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "ManageMessage('" + mes + "');", true); |
|
|
|
} |
|
|
|
|
|
|
|
private void LoadComplianceListNew(DbResult dbResult, DataTable dt) |
|
|
|
{ |
|
|
|
int cols = dt.Columns.Count; |
|
|
|
var str = |
|
|
|
new StringBuilder("<div class='table-responsive'><table class='table table-responsive table-striped table-bordered'>"); |
|
|
|
str.Append("<tr>"); |
|
|
|
for (int i = 2; i < cols; i++) |
|
|
|
{ |
|
|
|
str.Append("<th><div align=\"left\">" + dt.Columns[i].ColumnName + "</div></th>"); |
|
|
|
} |
|
|
|
str.Append("</tr>"); |
|
|
|
foreach (DataRow dr in dt.Rows) |
|
|
|
{ |
|
|
|
str.Append("<tr>"); |
|
|
|
str.Append("<td>" + dr["S.N."].ToString() + "</td>"); |
|
|
|
str.Append("<td align=\"left\"><a href=\"#\" onclick=\"OpenInNewWindow('/Remit/OFACManagement/ComplianceDetail.aspx?id=" + |
|
|
|
dr["Id"].ToString() + "&type=compNew')\">" + dr["Remarks"].ToString() + "</a></td>"); |
|
|
|
str.Append("<td align='center' class='bg-danger'></strong>" + dr["Action"].ToString() + "</strong></td>"); |
|
|
|
str.Append("</tr>"); |
|
|
|
} |
|
|
|
str.Append("</table></div>"); |
|
|
|
divCompliance.InnerHtml = str.ToString(); |
|
|
|
} |
|
|
|
|
|
|
|
protected void GetAdditionalCDDI() |
|
|
|
{ |
|
|
|
string customerId = Request.Form["customerId"]; |
|
|
|
string isOnlyVisaStatusQuestionnaire = Request.Form["IsOnlyVisaStatusQuestionnaire"]; |
|
|
|
//var dt = st.LoadCustomerData(searchType, searchValue, "s", GetStatic.GetCountryId(), GetStatic.GetSettlingAgent());
|
|
|
|
var dt = st.GetAdditionalCDDIInfo(GetStatic.GetUser(), customerId, isOnlyVisaStatusQuestionnaire); |
|
|
|
if (dt == null) |
|
|
|
{ |
|
|
|
Response.Write(""); |
|
|
|
Response.End(); |
|
|
|
return; |
|
|
|
} |
|
|
|
Response.ContentType = "text/plain"; |
|
|
|
string json = GetStatic.DataTableToJson(dt); |
|
|
|
Response.Write(json); |
|
|
|
Response.End(); |
|
|
|
} |
|
|
|
|
|
|
|
#endregion Questionnaire
|
|
|
|
|
|
|
|
#region Models
|
|
|
|
|
|
|
|
public class DbResult1 |
|
|
|
{ |
|
|
|
public int ErrorCode { get; set; } |
|
|
|
public string Msg { get; set; } |
|
|
|
public string Id { get; set; } |
|
|
|
public string CompApproveRemark { get; set; } |
|
|
|
public string VType { get; set; } |
|
|
|
public string IsDocumentRequired { get; set; } |
|
|
|
} |
|
|
|
public class DbResult2 |
|
|
|
{ |
|
|
|
public int ErrorCode { get; set; } |
|
|
|
public string Msg { get; set; } |
|
|
|
public string Id { get; set; } |
|
|
|
public string Extra { get; set; } |
|
|
|
} |
|
|
|
public class OfacTable |
|
|
|
{ |
|
|
|
public int Id { get; set; } |
|
|
|
public string CsDetailRecId { get; set; } |
|
|
|
public string SN { get; set; } |
|
|
|
public string Remarks { get; set; } |
|
|
|
public string Action { get; set; } |
|
|
|
} |
|
|
|
public class ComplianceTable |
|
|
|
{ |
|
|
|
public int ControlNo { get; set; } |
|
|
|
public string TranId { get; set; } |
|
|
|
public string SenderName { get; set; } |
|
|
|
public string SIdType { get; set; } |
|
|
|
public string SIdNo { get; set; } |
|
|
|
public string CAmt { get; set; } |
|
|
|
public string Pcountry { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
#endregion Models
|
|
|
|
|
|
|
|
#region Helper
|
|
|
|
|
|
|
|
public static string DataTableToJson(DataTable table) |
|
|
|
{ |
|
|
|
if (table == null) |
|
|
|
return ""; |
|
|
|
var list = new List<Dictionary<string, object>>(); |
|
|
|
|
|
|
|
foreach (DataRow row in table.Rows) |
|
|
|
{ |
|
|
|
var dict = new Dictionary<string, object>(); |
|
|
|
|
|
|
|
foreach (DataColumn col in table.Columns) |
|
|
|
{ |
|
|
|
dict[col.ColumnName] = string.IsNullOrEmpty(row[col].ToString()) ? "" : row[col]; |
|
|
|
} |
|
|
|
list.Add(dict); |
|
|
|
} |
|
|
|
var serializer = new JavaScriptSerializer(); |
|
|
|
string json = serializer.Serialize(list); |
|
|
|
return json; |
|
|
|
} |
|
|
|
|
|
|
|
public string ConvertJsonToXml(string jsonString) |
|
|
|
{ |
|
|
|
dynamic jsonObject = JsonConvert.DeserializeObject(jsonString); |
|
|
|
XDocument xmlDocument = new XDocument(); |
|
|
|
XElement rootElement = new XElement("root"); |
|
|
|
if (jsonObject is JArray) |
|
|
|
{ |
|
|
|
foreach (var item in jsonObject) |
|
|
|
{ |
|
|
|
XElement itemElement = new XElement("row"); |
|
|
|
AddJsonToXmlElement(item, itemElement); |
|
|
|
rootElement.Add(itemElement); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (jsonObject is JObject) |
|
|
|
{ |
|
|
|
AddJsonToXmlElement(jsonObject, rootElement); |
|
|
|
} |
|
|
|
xmlDocument.Add(rootElement); |
|
|
|
return xmlDocument.ToString(); |
|
|
|
} |
|
|
|
|
|
|
|
private void AddJsonToXmlElement(dynamic jsonObject, XElement xmlElement) |
|
|
|
{ |
|
|
|
foreach (var property in jsonObject) |
|
|
|
{ |
|
|
|
if (property.Value is JArray) |
|
|
|
{ |
|
|
|
foreach (var row in property.Value) |
|
|
|
{ |
|
|
|
XElement newElement = new XElement(property.Name.ToString()); |
|
|
|
xmlElement.Add(newElement); |
|
|
|
AddJsonToXmlElement(row, newElement); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (property.Value is JObject) |
|
|
|
{ |
|
|
|
XElement newElement = new XElement(property.Name.ToString()); |
|
|
|
xmlElement.Add(newElement); |
|
|
|
AddJsonToXmlElement(property.Value, newElement); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
xmlElement.Add(new XAttribute(property.Name.ToString(), property.Value.ToString())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endregion Helper
|
|
|
|
|
|
|
|
} |
|
|
|
} |