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.
 
 
 
 
 

404 lines
19 KiB

using Swift.DAL.OnlineAgent;
using Swift.DAL.SwiftDAL;
using Swift.web.Library;
using System;
using System.Data;
using System.Text;
using System.Threading.Tasks;
namespace Swift.web.Remit.Administration.OnlineCustomer
{
public partial class Detail : System.Web.UI.Page
{
private readonly RemittanceLibrary _sl = new RemittanceLibrary();
private readonly OnlineCustomerDao _cd = new OnlineCustomerDao();
private string GMEWalletApiBaseUrl = GetStatic.ReadWebConfig("KJURL", "");
private string secretKey = GetStatic.ReadWebConfig("KJsecretKey", "");
private const string ViewFunctionId = "20130000";
private const string PartnerServiceKey = "1234";
private const string kycVerificationCode = "0";
private string m = GetStatic.ReadQueryString("m", "");
private string id = GetStatic.ReadQueryString("customerId", "");
protected void Page_Load(object sender, EventArgs e)
{
Authenticate();
approve.Visible = false;
pnlOFAC.Visible = false;
if (!IsPostBack)
{
if (id != "")
{
if (m != "")
{
approve.Visible = true;
}
PopulateCustomerDetails(id);
}
}
}
private void Authenticate()
{
_sl.CheckAuthentication(ViewFunctionId);
}
private void PopulateCustomerDetails(string id)
{
var dataSet = _cd.GetVerifyCustomerDetailsNew(id, GetStatic.GetUser());
var dr = dataSet.Tables[1].Rows[0];
var registerDate = dr["createdDate"].ToString();
hdnCustomerId.Value = dr["customerId"].ToString();
txtMembershipNo.Text = dr["membershipId"].ToString();
txtCustomerType.Text = dr["customerType"].ToString();
fullName.Text = dr["fullName"].ToString();
hdnAccountName.Value = fullName.Text;
genderList.Text = dr["gender"].ToString();
countryList.Text = dr["country"].ToString();
addressLine1.Text = dr["address"].ToString();
postalCode.Text = dr["postalCode"].ToString();
city.Text = dr["city"].ToString();
email.Text = dr["email"].ToString();
phoneNumber.Text = dr["telNo"].ToString();
mobile.Text = dr["mobile"].ToString();
nativeCountry.Text = dr["nativeCountry"].ToString();
dob.Text = dr["dob"].ToString();
occupation.Text = dr["occupation"].ToString();
IssueDate.Text = dr["idIssueDate"].ToString();
ExpireDate.Text = dr["idExpiryDate"].ToString();
verificationTypeNo.Text = dr["idNumber"].ToString();
idType.Text = dr["idType"].ToString();
bankName.Text = dr["bankName"].ToString();
accountNumber.Text = dr["bankAccountNo"].ToString();
postalCode.Text = dr["zipcode"].ToString();
hdnAccountNumber.Value = accountNumber.Text;
docType.Text = dr["DocumentType"].ToString();
hdnIdTypeCode.Value = dr["idTypeCode"].ToString();
hdnGenderCode.Value = dr["genderCode"].ToString();
hdnNativeCountryCode.Value = dr["nativeCountryCode"].ToString();
hdnDobYmd.Value = dr["dobYMD"].ToString();
visaStatus.Text = dr["VisaStaTus"].ToString();
employeeBusinessType.Text = dr["EmployeeBusinessType"].ToString();
nameOfEmployeer.Text = dr["NameOfEmployeer"].ToString();
ssnNo.Text = dr["SSNNo"].ToString();
sourceOfFund.Text = dr["SourceOfFund"].ToString();
remarks.Text = dr["Remarks"].ToString();
monthlyIncome.Text = dr["MonthlyIncome"].ToString();
remittanceAllowed.Text = dr["RemittanceAllowed"].ToString();
onlineLoginAllowed.Text = dr["OnlineUser"].ToString();
mobileLoginAllowed.Text = dr["MobileUser"].ToString();
var documentDetails = _cd.GetDocumentByCustomerId(id);
// var duplicateDetails = _cd.GetMactcheData(id);
StringBuilder matchHtml = new StringBuilder();
StringBuilder imageHtml = new StringBuilder();
if (dataSet.Tables.Count > 0)
{
divMatchedCustomer.Visible = true;
matchHtml.Append("<table class='table table-responsive table-striped table-bordered'>");
matchHtml.Append("<td colspan=\"6\" style=\"color: red; font-weight: bold; font-family: verdana;\">Possible Duplicate: This customer is possible duplicate of the following customers: </td>");
matchHtml.Append("<tr>");
matchHtml.Append("<th>S.N.</th>");
matchHtml.Append("<th> Name</th>");
matchHtml.Append("<th>DOB</th>");
matchHtml.Append("<th>Id Number</th>");
matchHtml.Append("</tr>");
if (dataSet.Tables.Count > 1 && dataSet.Tables[2] != null)
{
foreach (DataRow dataRow in dataSet.Tables[2].Rows)
{
matchHtml.Append("<tr style=\"background-color: #F9CCCC;\">");
matchHtml.Append("<td>" + dataRow["SN"] + "</td>");
matchHtml.Append("<td>" + dataRow["Name"] + "</td>");
matchHtml.Append("<td>" + dataRow["dob"] + "</td>");
matchHtml.Append("<td>" + dataRow["idNumber"] + "</td>");
matchHtml.Append("</tr>");
}
matchHtml.Append("</table>");
}
}
divMatchedCustomer.InnerHtml = matchHtml.ToString();
if (documentDetails != null)
{
foreach (DataRow item in documentDetails.Rows)
{
showDocDiv.Visible = true;
string imageUrl = "";
string docName = item["documentName"].ToString();
var customerId = hdnCustomerId.Value;
var membershipId = txtMembershipNo.Text;
var fileName = item["fileName"];
imageUrl = "/Handler/CustomerSignature.ashx?registerDate=" + Convert.ToDateTime(registerDate).ToString("yyyy-MM-dd") + "&customerId=" + customerId + "&membershipNo=" + membershipId + "&fileName=" + fileName;
imageHtml.Append("<div class=\"col-md-3\"><div class=\"form-group\"><div class=\"col-md-12\">");
imageHtml.Append("<label>" + docName + "</label>");
imageHtml.Append("</div>");
imageHtml.Append("<div class=\"col-md-12\">");
if (item["fileType"].ToString() == "application/pdf" || item["fileType"].ToString() == "receiver")
{
imageHtml.Append("<img src='/images/pdf-img.png' height=\"150\" width=\"200\" onclick=\"showDocument('" + item["cdId"].ToString() + "', '" + item["fileType"].ToString() + "')\" />");
}
else
{
imageHtml.Append("<img src=\"" + imageUrl + "\" height=\"150\" width=\"200\" onclick=\'showImage(this);\'/>");
}
imageHtml.Append("</div>");
imageHtml.Append("</div>");
imageHtml.Append("</div>");
}
docDiv.InnerHtml = imageHtml.ToString();
}
// var ofacData = dataSet.Tables[4].Rows[0];
if (dataSet.Tables.Count > 4)
{
pnlOFAC.Visible = true;
var dbResult = _cd.ParseDbResult(dataSet.Tables[4]);
if (dbResult.ErrorCode == "100")
{
// if (ofacData.ErrorCode == "100") //100 means ofac
// {
var result = dbResult.Id.Split('|');
hdnOfacRes.Value = result[0];
hdnOfacReason.Value = result[1];
hdnTrackBy.Value = dbResult.Extra;
if (dataSet.Tables[5].Rows.Count > 0)
{
displayOFAC.Visible = RejectCustomer.Visible= true;
LoadOfacList(dbResult, dataSet.Tables[5]);
}
else
displayOFAC.Visible = RejectCustomer.Visible = false;
// return true;
// }
}
else
{
var mes = GetStatic.ParseResultJsPrint(dbResult);
GetStatic.CallBackJs1(Page, "Print Message", "ManageMessage('" + mes + "');");
// return false;
}
}
}
private void LoadOfacList(DbResult dbResult, DataTable dt)
{
string _fullName = fullName.Text;
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;
// spnWarningMsg.InnerHtml = dbResult.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)
{
str.Append("<tr>");
str.Append("<td align=\"left\">" + dr[0] + "</td>");
string[] strArr = _fullName.Split(new char[0]);
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]));
}
}
}
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>");
displayOFAC.InnerHtml = str.ToString();
}
protected void approve_Click(object sender, EventArgs e)
{
var ofaceRemarks = Request.Form["remarksOFAC"];
//if(hdnOfacRes.Value != null && ofaceRemarks == null)
//{
// GetStatic.AlertMessage(this, "Please insert Ofac Remarks.");
// return;
//}
if (m == "ap")
{
var ds = _cd.ApprovePending(id, GetStatic.GetUser(), lblBankAcName.Text, ofaceRemarks);
DbResult dbRes = _cd.ParseDbResult(ds.Tables[0]);
if (dbRes.ErrorCode == "1")
{
msg.InnerText = dbRes.Msg;
msg.Visible = true;
}
else
{
msg.Visible = false;
if (dbRes.ErrorCode.Equals("0"))
{
string username = ds.Tables[1].Rows[0]["username"].ToString();
string pwd = ds.Tables[1].Rows[0]["password"].ToString();
string fullName = ds.Tables[1].Rows[0]["fullName"].ToString();
string msgBody = GetApprovedCustomerMsgBody(username, pwd);
string msgSubject = "Customer Approved Notification";
var idNumber = ds.Tables[1].Rows[0]["idNumber"].ToString().Replace("-", "");
GetStatic.SetMessage(dbRes.ErrorCode, dbRes.Msg);
//Task.Factory.StartNew(() => { SendEmail(msgSubject, msgBody, username); });
if (ds.Tables[1].Rows[0]["printLetter"].ToString() == "Y")
{
Response.Redirect("/Remit/Administration/OnlineCustomer/LetterForCustomer.aspx?createdFrom=core&customerId=" + id + "&membershipId=" + ds.Tables[1].Rows[0]["account"].ToString() + "");
}
else
{
Response.Redirect("ApprovedList.aspx");
}
//if (ds.Tables[1].Rows[0]["createdFrom"].ToString() == "M")
//{
// Response.Redirect("/Remit/Administration/OnlineCustomer/LetterForCustomerFromMobile.aspx?customerId=" + id + "&membershipId="+ ds.Tables[1].Rows[0]["account"].ToString()+"");
//}
//else
//{
// Response.Redirect("/Remit/Administration/OnlineCustomer/LetterForCustomerFromOthers.aspx?customerId=" + id + "&membershipId=" + ds.Tables[1].Rows[0]["account"].ToString() + "");
//}
}
}
GetStatic.AlertMessage(Page, "Approval Failed, Account Registration Fail error.");
}
else if (m == "vp")
{
var dbResult = _cd.VerifyPending(id, GetStatic.GetUser());
if (dbResult.ErrorCode.Equals("0"))
{
GetStatic.SetMessage(dbResult);
Response.Redirect("List.aspx");
}
GetStatic.AlertMessage(Page, dbResult.Msg);
}
}
private void SendEmail(string msgSubject, string msgBody, string toEmailId)
{
SmtpMailSetting mail = new SmtpMailSetting
{
MsgBody = msgBody,
MsgSubject = msgSubject,
ToEmails = toEmailId
};
mail.SendSmtpMail(mail/*GetStatic.GetAppRoot()+"/SampleFile/GME-TermsAndConditions.pdf"*/);
}
public string GetApprovedCustomerMsgBody(string username, string pwd)
{
var mailBody = "Dear Mr./Ms./Mrs. " + fullName.Text + ",";
mailBody +=
"<br><br>Thank you for registering with JME Online Remittance. Please find your username below:";
mailBody += "<br><br>Username: " + username;
mailBody += "<br>Password: " + pwd;
mailBody +=
"<br><br>Your login with JMERemit is checked and validated. You can now start sending remittance to your desired country.";
mailBody +=
"<br><br><br>PROCESS TO TRANSFER FUNDS:";
//mailBody += "<br>• Your unique account number with JME is " + account + ", it is displayed in your login window all the time";
mailBody += "<br>• Please make your desired transfer in your JME account through your nearest ATM or ebanking";
mailBody += "<br>• Login to <a href=\"https://japanremit.com\"> www.japanremit.com </a> and click send money. Please enter your beneficiary details to transfer funds";
mailBody += "<br>• For cash transfers, you will receive a PIN Code after successfully submitting your details. For account transfers to your desired country, JME will process the transactions to be deposited within 24 hours (deposit time may vary where beneficiary banks are not easily accessible)";
mailBody += "<br>• All cash transfers has to be verified by JME and are ready to collect at your location within an hour";
mailBody += "<br><br>Note: *All Receipts generated after successful transfers are also sent to your registered email.";
mailBody += "<br><br><br>*Money transfer limit per transaction is USD 3,000 and USD 20,000 for 1 year.";
mailBody +=
"<br><br>If you need further assistance kindly reply this email or call us at <br/>";
//mailBody += @"Tel. 1588 6864 (Multi-language Support) <br/>
// 010 2959 6864 (Nepal) <br/>
// 010 2930 6864 (Vietnam)<br/>
// 010 2971 6864 (Cambodia)<br/>
// 010 2970 6864 (Philippines)<br/>
// 010 2837 6864 (Sri lanka)<br/>
// 010 2760 6864 (Pakistan/India)<br/>
// 010 2967 6864 (Bangladesh)<br/>
// 010 3015 6864 (Uzbekistan)<br/>";
mailBody += "or visit our website <a href=\"https://japanremit.com\"> www.japanremit.com </a>";
mailBody +=
"<br><br><br>We look forward to provide you excellent service.";
mailBody +=
"<br><br>Thank You.";
mailBody +=
"<br><br><br>Regards,";
mailBody +=
"<br>JME Online Team";
mailBody +=
"<br>Head Office";
mailBody +=
"<br>Post Code: 169-0073 Omori Building 4F(AB), Hyakunincho 1-10-7, Shinjuku-ku, Tokyo, Japan ";
mailBody +=
"<br>Phone number 08034104278 ";
return mailBody;
}
protected void btnAudit_Click(object sender, EventArgs e)
{
var dbResult = _cd.AuditDocument(id, GetStatic.GetUser());
GetStatic.AlertMessage(this, dbResult.Msg);
}
protected void reject_Click(object sender, EventArgs e)
{
string id = GetStatic.ReadQueryString("customerId", "");
var user = GetStatic.GetUser();
var ofacRemarks = Request.Form["remarksOFAC"];
DbResult dbResult = _cd.DeleteCustomerM(id, user, ofacRemarks);
if (id == "")
{
GetStatic.AlertMessage(this, "You are not authorized to delete this Customer!");
return;
}
else
{
GetStatic.AlertMessage(this, "Customer Deleted successfully!");
Response.Redirect("List.aspx");
return;
}
}
}
}