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.

109 lines
4.4 KiB

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