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.

141 lines
6.8 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. using Business.Configuration;
  2. using Business.Customer;
  3. using Common.Helper;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Web;
  10. using System.Web.UI;
  11. using System.Web.UI.WebControls;
  12. namespace JMEAgentSystem.WebPages.CustomerRegistration
  13. {
  14. public partial class PrintDetails : System.Web.UI.Page
  15. {
  16. private readonly ICustomerServices _customerServices = AutoFacContainer.Resolve<ICustomerServices>();
  17. protected void Page_Load(object sender, EventArgs e)
  18. {
  19. if (!IsPostBack)
  20. {
  21. GetStatic.PrintMessage(this.Page);
  22. LoadCustomerDetails();
  23. }
  24. }
  25. protected void approve_Click(object sender, EventArgs e)
  26. {
  27. }
  28. private void LoadCustomerDetails()
  29. {
  30. var membershipId = GetMembershipId();
  31. var receiverId = GetReceiverId();
  32. if (membershipId == "" || receiverId == "")
  33. {
  34. return;
  35. }
  36. var dataSet = _customerServices.GetCustomerInfoFromMembershiId(GetStatic.GetUser(), membershipId, receiverId,"");
  37. //set customer details
  38. SetCustomerDetails(dataSet.Tables[1].Rows[0]);
  39. //set receiver dettails
  40. SetReceiverDetails(dataSet.Tables[2].Rows[0]);
  41. //get signature
  42. docDiv.InnerHtml = GetSignatrueHtml(dataSet, "agent-upload", dataSet.Tables[1].Rows[0]["customerId"].ToString());
  43. }
  44. private string GetMembershipId()
  45. {
  46. return GetStatic.ReadQueryString("membershipId", "");
  47. }
  48. private string GetReceiverId()
  49. {
  50. return GetStatic.ReadQueryString("receiverId", "");
  51. }
  52. private void SetCustomerDetails(DataRow dr)
  53. {
  54. hdnCustomerId.Value = dr["customerId"].ToString();
  55. TxtMembershipId.InnerText = dr["membershipId"].ToString();
  56. txtCustomerType.InnerText = dr["customerType"].ToString();
  57. txtFullName.InnerText = dr["fullName"].ToString();
  58. hdnAccountName.Value = txtFullName.InnerText;
  59. txtGender.InnerText = dr["gender"].ToString();
  60. txtCountry.InnerText = dr["country"].ToString();
  61. txtAddress.InnerText = dr["address"].ToString();
  62. txtZipcCode.InnerText = dr["zipcode"].ToString();
  63. txtCity.InnerText = dr["city"].ToString();
  64. txtEmailId.InnerText = dr["email"].ToString();
  65. txtTelephoneNo.InnerText = dr["telNo"].ToString();
  66. txtMobileNo.InnerText = dr["mobile"].ToString();
  67. txtNativeCountry.InnerText = dr["nativeCountry"].ToString();
  68. txtDateOfBirth.InnerText = dr["dob"].ToString();
  69. txtOccupation.InnerText = dr["occupation"].ToString();
  70. txtOtherOccupation.InnerText = dr["occupationOther"].ToString();
  71. txtIssueDate.InnerText = dr["idIssueDate"].ToString();
  72. txtExpireDate.InnerText = dr["idExpiryDate"].ToString();
  73. txtIdType.InnerText = dr["idType"].ToString();
  74. txtIdNumber.InnerText = dr["idNumber"].ToString();
  75. txtVisaStatus.InnerText = dr["visaStatus"].ToString();
  76. txtEmployeeBusinessType.InnerText = dr["employeeBusinessType"].ToString();
  77. txtNameOfEmployer.InnerText = dr["nameOfEmployeer"].ToString();
  78. txtSSnNo.InnerText = dr["SSNNO"].ToString();
  79. txtMonthlyIncome.InnerText = dr["monthlyIncome"].ToString();
  80. txtRemittanceAllowed.InnerText = dr["remittanceAllowed"].ToString();
  81. txtOnlineLoginAllowed.InnerText = dr["onlineUser"].ToString();
  82. txtRemarks.InnerText = dr["remarks"].ToString();
  83. txtSourceOfFund.InnerText = dr["sourceOfFund"].ToString();
  84. }
  85. private void SetReceiverDetails(DataRow dr)
  86. {
  87. recCountry.InnerText = dr["country"].ToString();
  88. recBeneficiaryType.InnerText = dr["receiverType"].ToString();
  89. recFullName.InnerText = dr["customerName"].ToString();
  90. recNativeCountry.InnerText = dr["NativeCountry"].ToString();
  91. recAddress.InnerText = dr["address"].ToString();
  92. recCity.InnerText = dr["city"].ToString();
  93. recContactNo.InnerText = dr["homePhone"].ToString();
  94. recMobile.InnerText = dr["mobile"].ToString();
  95. recIdType.InnerText = dr["idType"].ToString();
  96. recIdNumber.InnerText = dr["idNumber"].ToString();
  97. recPlaceOfIssue.InnerText = dr["placeOfIssue"].ToString();
  98. recRelationship.InnerText = dr["relationship"].ToString();
  99. recOtherRelationDescription.InnerText = dr["otherRelationDesc"].ToString();
  100. recPurposeOfRemittance.InnerText = dr["purposeOfRemit"].ToString();
  101. otherPurpose.InnerText = dr["otherPurpose"].ToString();
  102. recPaymentMode.InnerText = dr["paymentMode"].ToString();
  103. pagent.InnerText = dr["payOutPartner"].ToString();
  104. recAccountNumber.InnerText = dr["receiverAccountNo"].ToString();
  105. pBranch.InnerText = dr["bankBranchName"].ToString();
  106. recRemarks.InnerText = dr["remarks"].ToString();
  107. }
  108. public string GetSignatrueHtml(DataSet dataSet,string fileDescription,string sessionId)
  109. {
  110. var dr = dataSet.Tables[1].Rows[0];
  111. var registerDate = dr["createdDate"].ToString();
  112. var membershipId = dr["membershipId"].ToString();
  113. var documentDetails = _customerServices.GetDocumentByCustomerId(dr["customerId"].ToString(), fileDescription, sessionId);
  114. StringBuilder imageHtml = new StringBuilder();
  115. if (documentDetails != null)
  116. {
  117. foreach (DataRow item in documentDetails.Rows)
  118. {
  119. var customerId = dr["customerId"].ToString();
  120. var fileName = item["fileName"].ToString();
  121. string imageUrl = "/WebPages/GetFileView.ashx?registerDate=" + Convert.ToDateTime(registerDate).ToString("yyyy-MM-dd") + "&customerId=" + customerId + "&membershipNo=" + membershipId + "&fileName=" + fileName;
  122. imageHtml.Append("<div class=\"col-md-12\"><div class=\"form-group\"><div class=\"col-md-12\">");
  123. imageHtml.Append("<label>" + item["documentName"].ToString() + "</label>");
  124. imageHtml.Append("<img src=\"" + imageUrl + "\" height=\"150\" width=\"200\" onclick=\'showImage(this);\'/>");
  125. imageHtml.Append("</div>");
  126. imageHtml.Append("</div>");
  127. imageHtml.Append("</div>");
  128. }
  129. }
  130. return imageHtml.ToString();
  131. }
  132. }
  133. }