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.

138 lines
5.5 KiB

  1. using System;
  2. using Swift.DAL.BL.Remit.Transaction;
  3. using Swift.web.Library;
  4. using System.Data;
  5. using System.Web.UI;
  6. using System.IO;
  7. using System.Text;
  8. namespace Swift.web.Remit.Transaction.ThirdPartyTXN.Pay
  9. {
  10. public partial class PayReceipt : System.Web.UI.Page
  11. {
  12. private readonly ReceiptDao obj = new ReceiptDao();
  13. private readonly SwiftLibrary sl = new SwiftLibrary();
  14. private const string FreeSimFunctionId = "40103000";
  15. protected void Page_Load(object sender, EventArgs e)
  16. {
  17. Authenticate();
  18. ShowDataLocal();
  19. ShowMultipleReceipt();
  20. }
  21. private void Authenticate()
  22. {
  23. sl.CheckSession();
  24. }
  25. private void ShowMultipleReceipt()
  26. {
  27. DataRow dr = obj.GetInvoiceMode(GetStatic.GetUser());
  28. if (dr == null)
  29. return;
  30. if (dr["mode"].ToString().Equals("Single"))
  31. return;
  32. var sb = new StringBuilder();
  33. Printreceiptdetail.RenderControl(new HtmlTextWriter(new StringWriter(sb)));
  34. multreceipt.InnerHtml = sb.ToString();
  35. }
  36. private string GetControlNo()
  37. {
  38. return GetStatic.ReadQueryString("controlNo", "");
  39. }
  40. private void ShowDataLocal()
  41. {
  42. lblControlNo.Text = GetStatic.GetTranNoName();
  43. DataSet ds = obj.GetPayIntlReceipt(GetControlNo(), GetStatic.GetUser(), "P");
  44. if (ds.Tables.Count >= 0)
  45. {
  46. //Load Sender Information
  47. if (ds.Tables[0].Rows.Count > 0)
  48. {
  49. DataRow sRow = ds.Tables[0].Rows[0];
  50. tranNo.Text = sRow["tranId"].ToString();
  51. sName.Text = sRow["senderName"].ToString();
  52. sAddress.Text = sRow["sAddress"].ToString();
  53. sCountry.Text = sRow["sCountryName"].ToString();
  54. sContactNo.Text = sRow["sContactNo"].ToString();
  55. if (sRow["sMemId"].ToString() == "")
  56. sDisMemId.Visible = false;
  57. else
  58. {
  59. sDisMemId.Visible = true;
  60. sMemId.Text = sRow["sMemId"].ToString();
  61. }
  62. rName.Text = sRow["receiverName"].ToString();
  63. rAddressCountry.Text = string.IsNullOrWhiteSpace(sRow["rAddress"].ToString())
  64. ? sRow["rCountryName"].ToString()
  65. : sRow["rAddress"].ToString() + "," + sRow["rCountryName"].ToString();
  66. rContactNo.Text = sRow["rContactNo"].ToString();
  67. rIdType.Text = sRow["rIdType"].ToString();
  68. rIdNo.Text = sRow["rIdNo"].ToString();
  69. if (sRow["rMemId"].ToString() == "")
  70. rDisMemId.Visible = false;
  71. else
  72. {
  73. rDisMemId.Visible = true;
  74. sMemId.Text = sRow["rMemId"].ToString();
  75. }
  76. agentName.Text = sRow["pAgentName"].ToString();
  77. branchName.Text = sRow["pBranchName"].ToString();
  78. agentLocation.Text = sRow["pAgentAddress"].ToString();
  79. agentCountry.Text = sRow["pAgentCountry"].ToString();
  80. if (sRow["relationship"].ToString() == "")
  81. sRel.Visible = false;
  82. else
  83. {
  84. sRel.Visible = true;
  85. sMemId.Text = sRow["relationship"].ToString();
  86. }
  87. relationship.Text = sRow["relationship"].ToString();
  88. agentContact.Text = sRow["pAgentPhone"].ToString();
  89. payoutCurr.Text = sRow["payoutCurr"].ToString();
  90. modeOfPayment.Text = sRow["paymentMethod"].ToString();
  91. if (modeOfPayment.Text.ToUpper() == "BANK DEPOSIT")
  92. {
  93. bankShowHide.Visible = true;
  94. pBankName.Text = sRow["pBankName"].ToString();
  95. pBankBranchName.Text = sRow["pBranchName"].ToString();
  96. accNum.Text = sRow["accountNo"].ToString();
  97. }
  98. payoutAmt.Text = GetStatic.ShowDecimal(sRow["pAmt"].ToString());
  99. lblDate.Text = sRow["paidDate"].ToString();
  100. payoutAmtFigure.Text = GetStatic.NumberToWord(sRow["pAmt"].ToString());
  101. }
  102. userFullName.Text = GetStatic.ReadSession("fullname", "");
  103. controlNo.Text = GetControlNo();
  104. //Load Message
  105. if (ds.Tables[1].Rows.Count > 0)
  106. {
  107. DataRow mRow = ds.Tables[1].Rows[0];
  108. userFullName.Text = mRow["pUserFullName"].ToString();
  109. headMsg.InnerHtml = "";
  110. commonMsg.InnerHtml = "";
  111. countrySpecificMsg.InnerHtml = "";
  112. headMsg.InnerHtml = mRow["headMsg"].ToString();
  113. commonMsg.InnerHtml = mRow["commonMsg"].ToString();
  114. countrySpecificMsg.InnerHtml = mRow["countrySpecificMsg"].ToString();
  115. }
  116. }
  117. }
  118. protected void btnFreeSim_Click(object sender, EventArgs e)
  119. {
  120. Response.Redirect("../../../Campaign/FreeNcellSim/Manage.aspx?controlNo=" + controlNo.Text + "&tranType=Paid");
  121. }
  122. }
  123. }