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.

110 lines
4.7 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
  1. using Business.Configuration;
  2. using Business.Customer;
  3. using Common.Helper;
  4. using JMEAgentSystem.WebPages.CustomerRegistration;
  5. using System;
  6. using System.Data;
  7. using System.IO;
  8. using System.Text;
  9. using System.Web.UI;
  10. namespace JMEAgentSystem.WebPages.SendTxn
  11. {
  12. public partial class PrintSendMoneyRequestDetails : Page
  13. {
  14. private readonly ICustomerServices _customerServices = AutoFacContainer.Resolve<ICustomerServices>();
  15. protected void Page_Load(object sender, EventArgs e)
  16. {
  17. if (!IsPostBack)
  18. {
  19. GetStatic.PrintMessage(this.Page);
  20. LoadCustomerDetails();
  21. todaysDate.InnerText = DateTime.Now.ToString("dd-MM-yyyy");
  22. SavePDF();
  23. }
  24. }
  25. private void SavePDF()
  26. {
  27. var result = _customerServices.GetCustomerDetailsForPDFSave(GetMembershipId(), GetRowId(), "txn").Split('|');
  28. if (result[0] != "0")
  29. {
  30. return;
  31. }
  32. var customerId = result[1];
  33. var membershipId = result[2];
  34. var registerDate = result[3];
  35. var fileNameSignature = result[4];
  36. string path = GetStatic.GetCustomerFilePath() + "CustomerDocument\\" + registerDate.Replace("-", "\\") + "\\" + membershipId + "\\";
  37. var sb = new StringBuilder();
  38. downloadDivPDF.RenderControl(new HtmlTextWriter(new StringWriter(sb)));
  39. string s = sb.ToString();
  40. string replaceText = "/WebPages/GetFileView.ashx?registerDate=" + Convert.ToDateTime(registerDate).ToString("yyyy-MM-dd") + "&customerId=" + customerId + "&membershipNo=" + membershipId + "&fileName=" + fileNameSignature;
  41. s = s.Replace(replaceText, path + fileNameSignature);
  42. string fileName = GetStatic.HTMLToPDF(s, GetStatic.GetUser(), path, "txn-req-form");
  43. _customerServices.AddCustomerPDFUpload(customerId, GetStatic.GetUser(), fileName, "txn", GetRowId());
  44. }
  45. protected void approve_Click(object sender, EventArgs e)
  46. {
  47. }
  48. private void LoadCustomerDetails()
  49. {
  50. var membershipId = GetMembershipId();
  51. var rowId = GetRowId();
  52. if (rowId == "" || membershipId == "")
  53. {
  54. return;
  55. }
  56. var dataSet = _customerServices.GetCustomerInfoFromMembershiId(GetStatic.GetUser(), membershipId, "", rowId);
  57. SetCustomerDetails(dataSet.Tables[1].Rows[0]);
  58. //set receiver dettails
  59. SetTransactionDetails(dataSet.Tables[3].Rows[0]);
  60. PrintDetails pd = new PrintDetails();
  61. docDiv.InnerHtml = pd.GetSignatrueHtml(dataSet, "Staff Visit - Send Txn(Customer Signature)", rowId);
  62. }
  63. private string GetMembershipId()
  64. {
  65. return GetStatic.ReadQueryString("customerId", "");
  66. }
  67. private string GetRowId()
  68. {
  69. return GetStatic.ReadQueryString("rowId", "");
  70. }
  71. private void SetTransactionDetails(DataRow dr)
  72. {
  73. idNumber.InnerText = dr["idNumber"].ToString();
  74. custFullName.InnerText = dr["custFullName"].ToString();
  75. recFullName.InnerText = dr["receiverFullName"].ToString();
  76. recAddress.InnerText = dr["receiverAddress"].ToString();
  77. recMobile.InnerText = dr["ReceiverMobileNumber"].ToString();
  78. pCountry.InnerText = dr["pcountry"].ToString();
  79. pmode.InnerText = dr["pMode"].ToString();
  80. pAgent.InnerText = dr["BANK_NAME"].ToString();
  81. pBranch.InnerText = dr["BRANCH_NAME"].ToString();
  82. accountNo.InnerText = dr["accountNumber"].ToString();
  83. cAmt.InnerText = dr["cAmt"].ToString();
  84. tAmt.InnerText = dr["tAmt"].ToString();
  85. serviceCharge.InnerText = dr["serviceCharge"].ToString();
  86. purpose.InnerText = dr["purposeOfRemit"].ToString();
  87. relationship.InnerText = dr["relationship"].ToString();
  88. otherRelation.InnerText = dr["otherRelation"].ToString();
  89. otherPurpose.InnerText = dr["otherPurpose"].ToString();
  90. collMode.InnerText = dr["collMode"].ToString();
  91. }
  92. private void SetCustomerDetails(DataRow dr)
  93. {
  94. customerName.InnerText = dr["fullName"].ToString();
  95. membershiId.InnerText = dr["membershipId"].ToString();
  96. custAddress.InnerText = dr["address"].ToString();
  97. custDob.InnerText = dr["dob"].ToString();
  98. custOccupation.InnerText = dr["occupation"].ToString();
  99. }
  100. }
  101. }