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.
 
 
 
 
 

296 lines
14 KiB

using Swift.DAL.OnlineAgent;
using Swift.DAL.SwiftDAL;
using Swift.web.Library;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Swift.web.AgentNew.Transaction.ApproveCustomer
{
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 = "20314000";
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;
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();
idType.Text = dr["idType"].ToString();
verificationTypeNo.Text = dr["idNumber"].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);
StringBuilder imageHtml = new StringBuilder();
if (dataSet.Tables.Count > 0)
{
divMatchedCustomer.Visible = true;
imageHtml.Append("<table class='table table-responsive table-striped table-bordered'>");
imageHtml.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>");
imageHtml.Append("<tr>");
imageHtml.Append("<th>S.N.</th>");
imageHtml.Append("<th> Name</th>");
imageHtml.Append("<th>DOB</th>");
imageHtml.Append("<th>Id Number</th>");
imageHtml.Append("</tr>");
if (dataSet.Tables.Count > 1 && dataSet.Tables[2] != null)
{
foreach (DataRow dataRow in dataSet.Tables[2].Rows)
{
imageHtml.Append("<tr style=\"background-color: #F9CCCC;\">");
imageHtml.Append("<td>" + dataRow["SN"] + "</td>");
imageHtml.Append("<td>" + dataRow["Name"] + "</td>");
imageHtml.Append("<td>" + dataRow["dob"] + "</td>");
imageHtml.Append("<td>" + dataRow["idNumber"] + "</td>");
imageHtml.Append("</tr>");
}
imageHtml.Append("</table>");
}
}
divMatchedCustomer.InnerHtml = imageHtml.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();
}
}
protected void approve_Click(object sender, EventArgs e)
{
if (m == "ap")
{
var ds = _cd.ApprovePending(id, GetStatic.GetUser(), lblBankAcName.Text);
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("/AgentNew/Transaction/Letters/LetterForCustomerFromMobile.aspx?createdFrom=core&customerId=" + id + "&membershipId=" + ds.Tables[1].Rows[0]["account"].ToString() + "");
}
else
{
Response.Redirect("ApprovedList.aspx");
}
//Response.Redirect("ApprovedList.aspx");
//if (ds.Tables[1].Rows[0]["createdFrom"].ToString() == "M")
//{
//}
//else
//{
//}
}
}
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);
}
}
}