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.

181 lines
9.0 KiB

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