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.

106 lines
4.1 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using Swift.web.Component.Grid;
  4. using Swift.web.Component.Grid.gridHelper;
  5. using Swift.web.Library;
  6. using Swift.DAL.SwiftDAL;
  7. using Swift.DAL.BL.Remit.Compliance;
  8. using System.Text;
  9. namespace Swift.web.Remit.RiskBaseAnalysis.RBACustomer
  10. {
  11. public partial class RBAExceptionRpt : System.Web.UI.Page
  12. {
  13. protected const string GridName = "gridRBACustomerRpt";
  14. private string ViewFunctionId = "20191500";
  15. private readonly SwiftGrid _grid = new SwiftGrid();
  16. private readonly SwiftLibrary _sl = new SwiftLibrary();
  17. private readonly RBACustomerDao obj = new RBACustomerDao();
  18. protected void Page_Load(object sender, EventArgs e)
  19. {
  20. if (!IsPostBack)
  21. {
  22. Authenticate();
  23. }
  24. }
  25. private void Authenticate()
  26. {
  27. _sl.CheckAuthentication(ViewFunctionId);
  28. }
  29. private void LoadGrid()
  30. {
  31. rpt_grid.InnerHtml = "";
  32. var dt = obj.LoadRBAExceptionRpt(GetStatic.GetUser(), fromDate.Text, toDate.Text, country.Value, agent.Value, branch.Value, reportType.SelectedValue);
  33. int cnt = 0;
  34. var sb = new StringBuilder("<table width=\"524\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" class=\"TBL\">");
  35. sb.AppendLine("<tr >");
  36. sb.AppendLine("<th class='frmTitle' nowrap='nowrap' rowspan='2'>RISK</th>");
  37. sb.AppendLine("<th class='frmTitle' nowrap='nowrap' rowspan='2'>TXN</th>");
  38. sb.AppendLine("<th class='frmTitle' nowrap='nowrap' colspan='3'>COMPLETED</th>");
  39. sb.AppendLine("<th class='frmTitle' nowrap='nowrap' colspan='3'>PENDING</th>");
  40. sb.AppendLine("</tr>");
  41. sb.AppendLine("<tr >");
  42. sb.AppendLine("<th class='frmTitle' nowrap='nowrap'>CDD</th>");
  43. sb.AppendLine("<th class='frmTitle' nowrap='nowrap'>EDD</th>");
  44. sb.AppendLine("<th class='frmTitle' nowrap='nowrap'>STR</th>");
  45. sb.AppendLine("<th class='frmTitle' nowrap='nowrap'>CDD</th>");
  46. sb.AppendLine("<th class='frmTitle' nowrap='nowrap'>EDD</th>");
  47. sb.AppendLine("<th class='frmTitle' nowrap='nowrap'>STR</th>");
  48. sb.AppendLine("</tr>");
  49. for (int i = 0; i < dt.Rows.Count; i++)
  50. {
  51. try
  52. {
  53. ++cnt;
  54. sb.AppendLine("<tr>");
  55. sb.AppendLine("<td>" + dt.Rows[i]["RISK"] + "</td>");
  56. sb.AppendLine("<td class=\"alignRight\">" + dt.Rows[i]["TXN"] + "</td>");
  57. sb.AppendLine("<td class=\"alignRight\">" + dt.Rows[i]["CDD"] + "</td>");
  58. sb.AppendLine("<td class=\"alignRight\">" + dt.Rows[i]["EDD"] + "</td>");
  59. sb.AppendLine("<td class=\"alignRight\">" + dt.Rows[i]["STR"] + "</td>");
  60. sb.AppendLine("<td class=\"alignRight\">" + dt.Rows[i]["P_CDD"] + "</td>");
  61. sb.AppendLine("<td class=\"alignRight\">" + dt.Rows[i]["P_EDD"] + "</td>");
  62. sb.AppendLine("<td class=\"alignRight\">" + dt.Rows[i]["P_STR"] + "</td>");
  63. sb.AppendLine("</tr>");
  64. }
  65. catch (Exception ex)
  66. {
  67. GetStatic.AlertMessage(this, "Error Occurred.\\n"+ex.Message);
  68. }
  69. }
  70. sb.AppendLine("</table>");
  71. rpt_grid.InnerHtml = sb.ToString();
  72. }
  73. protected void showReport_Click(object sender, EventArgs e)
  74. {
  75. if (fromDate.Text.Trim() == "" || toDate.Text.Trim() == "")
  76. {
  77. GetStatic.AlertMessage(this, "From and To date is required fields. Required field cannot be blank.");
  78. return;
  79. }
  80. if (reportType.SelectedValue == "")
  81. {
  82. GetStatic.AlertMessage(this, "Report type is required field. Required field cannot be blank.");
  83. return;
  84. }
  85. LoadGrid();
  86. }
  87. }
  88. }