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.

155 lines
6.5 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 SendReceipt : 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. ShowData();
  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. //Printreceiptdetail.ID = "receiptdt";
  30. multreceipt.InnerHtml = sb.ToString();
  31. }
  32. private string GetControlNo()
  33. {
  34. return GetStatic.ReadQueryString("controlNo", "");
  35. }
  36. protected void ShowData()
  37. {
  38. lblControlNo.Text = GetStatic.GetTranNoName();
  39. DataSet ds = obj.GetSendReceipt(GetControlNo(), GetStatic.GetUser(), "S");
  40. if (ds.Tables.Count >=1)
  41. {
  42. if (ds.Tables[0].Rows.Count > 0)
  43. {
  44. //Load Sender Information
  45. DataRow sRow = ds.Tables[0].Rows[0];
  46. tranNo.Text = sRow["tranId"].ToString();
  47. sName.Text = sRow["senderName"].ToString();
  48. sAddress.Text = sRow["sAddress"].ToString();
  49. sCountry.Text = sRow["sCountryName"].ToString();
  50. sContactNo.Text = sRow["sContactNo"].ToString();
  51. sIdType.Text = sRow["sIdType"].ToString();
  52. sIdNo.Text = sRow["sIdNo"].ToString();
  53. if (string.IsNullOrEmpty(sRow["sMemId"].ToString()))
  54. sDisMemId.Visible = false;
  55. else
  56. {
  57. sDisMemId.Visible = true;
  58. sMemId.Text = sRow["sMemId"].ToString();
  59. }
  60. if (string.IsNullOrEmpty(sRow["pendingBonus"].ToString()))
  61. {
  62. trBonus.Visible = false;
  63. trBonus1.Visible = false;
  64. }
  65. else
  66. {
  67. trBonus.Visible = true;
  68. trBonus1.Visible = true;
  69. pBonus.Text = sRow["pendingBonus"].ToString();
  70. eBonus.Text = sRow["earnedBonus"].ToString();
  71. }
  72. //Load Receiver Information
  73. rName.Text = sRow["receiverName"].ToString();
  74. rAddress.Text = sRow["rAddress"].ToString();
  75. rCountry.Text = sRow["rCountryName"].ToString();
  76. rContactNo.Text = sRow["rContactNo"].ToString();
  77. rIdType.Text = sRow["rIdType"].ToString();
  78. rIdNo.Text = sRow["rIdNo"].ToString();
  79. relationship.Text = sRow["relWithSender"].ToString();
  80. if (sRow["rMemId"].ToString() == "")
  81. rDisMemId.Visible = false;
  82. else
  83. {
  84. rDisMemId.Visible = true;
  85. rMemId.Text = sRow["rMemId"].ToString();
  86. }
  87. //Load Sending Agent Detail
  88. sAgentName.Text = sRow["sAgentName"].ToString();
  89. sBranchName.Text = sRow["sBranchName"].ToString();
  90. sAgentCountry.Text = sRow["sAgentCountry"].ToString();
  91. sAgentLocation.Text = sRow["sAgentLocation"].ToString();
  92. sContact.Text = sRow["agentPhone1"].ToString();
  93. //send remarks
  94. if (sRow["payoutMsg"].ToString() != "")
  95. lblRemarks.Text = "Remarks: " + sRow["payoutMsg"].ToString();
  96. //Load Payout location detail
  97. pAgentCountry.Text = sRow["pAgentCountry"].ToString();
  98. pAgentDistrict.Text = sRow["pAgentDistrict"].ToString();
  99. pAgentLocation.Text = sRow["pAgentLocation"].ToString();
  100. //Load Txn Amount detail
  101. modeOfPayment.Text = sRow["paymentMethod"].ToString();
  102. transferAmount.Text = GetStatic.ShowDecimal(sRow["tAmt"].ToString());
  103. serviceCharge.Text = GetStatic.ShowDecimal(sRow["serviceCharge"].ToString());
  104. total.Text = GetStatic.ShowDecimal(sRow["cAmt"].ToString());
  105. payoutAmt.Text = GetStatic.ShowDecimal(sRow["pAmt"].ToString());
  106. lblDate.Text = sRow["createdDate"].ToString();
  107. payoutAmtFigure.Text = GetStatic.NumberToWord(sRow["pAmt"].ToString());
  108. collCurr.Text = sRow["collCurr"].ToString();
  109. scCurr.Text = sRow["collCurr"].ToString();
  110. transCurr.Text = sRow["collCurr"].ToString();
  111. PCurr.Text = sRow["payoutCurr"].ToString();
  112. if (sRow["paymentMethod"].ToString() == "Bank Deposit")
  113. {
  114. bankShowHide.Visible = true;
  115. accNum.Text = sRow["accountNo"].ToString();
  116. bankName.Text = sRow["BankName"].ToString();
  117. BranchName.Text = sRow["BranchName"].ToString();
  118. }
  119. }
  120. userFullName.Text = GetStatic.ReadSession("fullname", "");
  121. controlNo.Text = GetControlNo();
  122. //Load Message
  123. if (ds.Tables[1].Rows.Count > 0)
  124. {
  125. DataRow mRow = ds.Tables[1].Rows[0];
  126. userFullName.Text = mRow["sUserFullName"].ToString();
  127. headMsg.InnerHtml = "";
  128. commonMsg.InnerHtml = "";
  129. countrySpecificMsg.InnerHtml = "";
  130. headMsg.InnerHtml = mRow["headMsg"].ToString();
  131. commonMsg.InnerHtml = mRow["commonMsg"].ToString();
  132. countrySpecificMsg.InnerHtml = mRow["countrySpecificMsg"].ToString();
  133. }
  134. }
  135. }
  136. }
  137. }