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.

182 lines
9.0 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  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 SendIntlReceipt : System.Web.UI.Page
  11. {
  12. private readonly ReceiptDao obj = new ReceiptDao();
  13. private readonly SwiftLibrary sl = new SwiftLibrary();
  14. private RemittanceLibrary rl = new RemittanceLibrary();
  15. protected void Page_Load(object sender, EventArgs e)
  16. {
  17. sl.CheckSession();
  18. GetStatic.AlertMessage(this.Page);
  19. ShowData();
  20. ShowMultipleReceipt();
  21. if (!IsPostBack)
  22. {
  23. officeCenterDiv.Visible = false;
  24. }
  25. if (hide.Value == "office")
  26. {
  27. officeDiv.Visible = false;
  28. customerDiv.Visible = true;
  29. officeCenterDiv.Visible = false;
  30. Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "Print()", true);
  31. }
  32. else if (hide.Value == "customer")
  33. {
  34. customerDiv.Visible = false;
  35. officeDiv.Visible = true;
  36. officeDiv.Attributes["style"] = "margin-top:120px;";
  37. officeCenterDiv.Visible = true;
  38. Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "Print()", true);
  39. }
  40. else if (hide.Value == "both")
  41. {
  42. officeDiv.Visible = true;
  43. customerDiv.Visible = true;
  44. officeCenterDiv.Visible = false;
  45. Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "Print()", true);
  46. }
  47. }
  48. private void ShowMultipleReceipt()
  49. {
  50. if (GetInvoicePrintMode() != "")
  51. {
  52. if (GetInvoicePrintMode() == "s")
  53. {
  54. divInvoiceSecond.Attributes.Add("style", "margin: 15px 0; display: none;");
  55. divInvoiceSecond1.Attributes.Add("style", "display: none;");
  56. }
  57. }
  58. }
  59. private string GetControlNo()
  60. {
  61. return GetStatic.ReadQueryString("controlNo", "");
  62. }
  63. private string GetInvoicePrintMode()
  64. {
  65. return GetStatic.ReadQueryString("invoicePrint", "");
  66. }
  67. protected void ShowData()
  68. {
  69. //lblControlNo.Text = GetStatic.GetTranNoName();
  70. DataSet ds = obj.GetSendIntlReceipt(GetControlNo(), GetStatic.GetUser(), "S");
  71. if (ds.Tables.Count >= 1)
  72. {
  73. if (ds.Tables[0].Rows.Count > 0)
  74. {
  75. //Load Sender Information
  76. DataRow sRow = ds.Tables[0].Rows[0];
  77. tranStatus.Text = sRow["tranStatus"].ToString();
  78. senderName.Text = sRow["senderName"].ToString();
  79. sMemId.Text = sRow["sMemId"].ToString();
  80. sAddress.Text = sRow["sAddress"].ToString();
  81. sNativeCountry.Text = sRow["sNativeCountry"].ToString();
  82. purpose.Text = sRow["purpose"].ToString();
  83. sDob.Text = sRow["sDob"].ToString();
  84. sContactNo.Text = sRow["sContactNo"].ToString();
  85. visaStatus.Text = sRow["visaStatus"].ToString();
  86. serial1.Text = sRow["tranId"].ToString();
  87. serial2.Text = sRow["tranId"].ToString();
  88. //Load Receiver Information
  89. receiverName.Text = sRow["receiverName"].ToString();
  90. pAgentCountry.Text = sRow["pAgentCountry"].ToString();
  91. paymentMode.Text = sRow["paymentMode"].ToString();
  92. rContactNo.Text = sRow["rContactNo"].ToString();
  93. pAgent.Text = sRow["pAgent"].ToString();
  94. rAddress.Text = sRow["rAddress"].ToString();
  95. pBankName.Text = sRow["pBankName"].ToString();
  96. relationShip.Text = sRow["relwithSender"].ToString();
  97. pBranchName.Text = sRow["BranchName"].ToString();
  98. accountNo.Text = sRow["accountNo"].ToString();
  99. rAmtWords.Text = GetStatic.NumberToWord(sRow["pAmt"].ToString());
  100. controlNo.Text = sRow["controlNo"].ToString();
  101. createdBy.Text = sRow["createdBy"].ToString();
  102. approvedDate.Text = DateTime.Parse(sRow["createdDate"].ToString()).ToString("yyyy-MM-dd hh:mm:ss tt");
  103. cAmt.Text = GetStatic.ShowDecimal(sRow["cAmt"].ToString()) + "&nbsp" + sRow["collCurr"].ToString();
  104. serviceCharge.Text = GetStatic.ShowTwoDecimal(sRow["serviceCharge"].ToString()) + "&nbsp" + sRow["collCurr"].ToString();
  105. tAmt.Text = GetStatic.ShowDecimal(sRow["tAmt"].ToString()) + "&nbsp" + sRow["collCurr"].ToString();
  106. exRate.Text = sRow["exRate"].ToString() + "&nbsp" + sRow["payoutCurr"].ToString();
  107. pAmt.Text = GetStatic.ShowDecimal(sRow["pAmt"].ToString()) + "&nbsp" + sRow["payoutCurr"].ToString();
  108. depositType.Text = (sRow["collMode"].ToString()) == "Bank Deposit" ? "JP Post" : sRow["collMode"].ToString();
  109. senderDepositType1.Text = senderDepositType.Text= sRow["depositType"].ToString();
  110. //operator1.Text = sRow["createdBy"].ToString();
  111. //for second from
  112. //Load Sender Information
  113. senderName1.Text = sRow["senderName"].ToString();
  114. sMemId1.Text = sRow["sMemId"].ToString();
  115. sAddress1.Text = sRow["sAddress"].ToString();
  116. sNativeCountry1.Text = sRow["sNativeCountry"].ToString();
  117. purpose1.Text = sRow["purpose"].ToString();
  118. sDob1.Text = sRow["sDob"].ToString();
  119. sContactNo1.Text = sRow["sContactNo"].ToString();
  120. //visaStatus1.Text = sRow["visaStatus"].ToString();
  121. lblOccupation.Text = sRow["occupation"].ToString();
  122. lblOccupation1.Text = sRow["occupation"].ToString();
  123. //Load Receiver Information
  124. receiverName1.Text = sRow["receiverName"].ToString();
  125. pAgentCountry1.Text = sRow["pAgentCountry"].ToString();
  126. paymentMode1.Text = sRow["paymentMode"].ToString();
  127. rContactNo1.Text = sRow["rContactNo"].ToString();
  128. pAgent1.Text = sRow["pAgent"].ToString();
  129. //rAddress1.Text = sRow["rAddress"].ToString();
  130. pBankName1.Text = sRow["pBankName"].ToString();
  131. relationship1.Text = sRow["relwithSender"].ToString();
  132. pBranchName1.Text = sRow["BranchName"].ToString();
  133. accountNo1.Text = sRow["accountNo"].ToString();
  134. rAmtWords1.Text = GetStatic.NumberToWord(sRow["pAmt"].ToString());
  135. controlNo1.Text = sRow["controlNo"].ToString();
  136. createdBy1.Text = sRow["createdBy"].ToString();
  137. approvedDate1.Text = DateTime.Parse(sRow["createdDate"].ToString()).ToString("yyyy-MM-dd hh:mm:ss tt");
  138. cAmt1.Text = GetStatic.ShowWithoutDecimal(sRow["cAmt"].ToString()) + "&nbsp" + sRow["collCurr"].ToString();
  139. serviceCharge1.Text = GetStatic.ShowWithoutDecimal(sRow["serviceCharge"].ToString()) + "&nbsp" + sRow["collCurr"].ToString();
  140. tAmt1.Text = GetStatic.ShowWithoutDecimal(sRow["tAmt"].ToString()) + "&nbsp" + sRow["collCurr"].ToString();
  141. exRate1.Text = sRow["exRate"].ToString() + "&nbsp" + sRow["payoutCurr"].ToString();
  142. pAmt1.Text = GetStatic.ShowDecimal(sRow["pAmt"].ToString()) + "&nbsp" + sRow["payoutCurr"].ToString();
  143. // depositType1.Text = (sRow["collMode"].ToString()) == "Bank Deposit" ? "JP Post" : sRow["collMode"].ToString();
  144. operator2.Text = sRow["createdBy"].ToString();
  145. if (sRow["paymentMethod"].ToString().ToUpper().Equals("CASH PAYMENT"))
  146. {
  147. bank3.Attributes.Add("style", "display: none;");
  148. bank4.Attributes.Add("style", "display: none;");
  149. bank7.Attributes.Add("style", "display: none;");
  150. bank8.Attributes.Add("style", "display: none;");
  151. bankAccNo.Attributes.Add("style", "display: none;");
  152. bankAccNo1.Attributes.Add("style", "display: none;");
  153. bankLabel.InnerHtml = "Cash Location";
  154. bankLabel1.InnerHtml = "Cash Location";
  155. }
  156. }
  157. else
  158. {
  159. rl.ManageInvalidControlNoAttempt(Page, GetStatic.GetUser(), "N");
  160. return;
  161. }
  162. }
  163. }
  164. }
  165. }