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.

119 lines
4.6 KiB

  1. using System;
  2. using System.Web.UI.WebControls;
  3. using Swift.web.Library;
  4. namespace Swift.web.Remit.RiskBaseAnalysis
  5. {
  6. public partial class RBAReport : System.Web.UI.Page
  7. {
  8. private readonly StaticDataDdl sdd = new StaticDataDdl();
  9. private readonly SwiftLibrary sl = new SwiftLibrary();
  10. private const string ViewFunctionId = "20163400";
  11. protected void Page_Load(object sender, EventArgs e)
  12. {
  13. sl.CheckSession();
  14. if (!IsPostBack)
  15. {
  16. Authenticate();
  17. PopulateDdl();
  18. fromDate.Text = DateTime.Now.ToString("MM/dd/yyyy");
  19. toDate.Text = DateTime.Now.ToString("MM/dd/yyyy");
  20. }
  21. GetStatic.ResizeFrame(Page);
  22. }
  23. private void PopulateDdl()
  24. {
  25. sdd.SetDDL(ref sCountry, "EXEC proc_countryMaster 'scl'", "countryId", "countryName", "", "Select");
  26. sdd.SetDDL2(ref rCountry, "EXEC proc_countryMaster 'rcl'", "countryName", "", "All");
  27. sdd.SetDDL2(ref sNativeCountry, "EXEC proc_countryMaster 'l'", "countryName", "", "All");
  28. sCountry.Text = "133";
  29. }
  30. private void Authenticate()
  31. {
  32. sl.CheckAuthentication(ViewFunctionId);
  33. }
  34. protected void sCountry_SelectedIndexChanged(object sender, EventArgs e)
  35. {
  36. if (sCountry.Text != "")
  37. sdd.SetDDL(ref sAgent, "EXEC proc_agentMaster @flag='alc',@agentCountryId='" + sCountry.Text + "'", "agentId", "agentName", "", "All");
  38. else
  39. sAgent.Items.Clear();
  40. sCountry.Focus();
  41. }
  42. protected void sAgent_SelectedIndexChanged(object sender, EventArgs e)
  43. {
  44. if (sAgent.Text != "")
  45. sdd.SetDDL(ref sBranch, "EXEC proc_agentMaster @flag='bl',@parentId='" + sAgent.Text + "'", "agentId", "agentName", "", "All");
  46. else
  47. sBranch.Items.Clear();
  48. sAgent.Focus();
  49. }
  50. protected void reportFor_SelectedIndexChanged(object sender, EventArgs e)
  51. {
  52. switch (reportFor.Text.ToUpper())
  53. {
  54. case "TXN RBA":
  55. trSendingAgent.Visible = true;
  56. trSendingBranch.Visible = true;
  57. trTxnCount.Visible = false;
  58. trBenCountryCount.Visible = false;
  59. trBenCount.Visible = false;
  60. trOutletCount.Visible = false;
  61. trReceiverCountry.Visible = true;
  62. rptType.Items.Add(new ListItem("Summary Report-Agent", "Summary Report-Agent"));
  63. rptType.Items.Add(new ListItem("Summary Report-Branch", "Summary Report-Branch"));
  64. break;
  65. case "TXN AVERAGE RBA":
  66. trSendingAgent.Visible = false;
  67. trSendingBranch.Visible = false;
  68. trTxnCount.Visible = true;
  69. trBenCountryCount.Visible = true;
  70. trBenCount.Visible = true;
  71. trOutletCount.Visible = true;
  72. trReceiverCountry.Visible = false;
  73. rptType.Items.Remove(new ListItem("Summary Report-Agent", "Summary Report-Agent"));
  74. rptType.Items.Remove(new ListItem("Summary Report-Branch", "Summary Report-Branch"));
  75. break;
  76. case "PERIODIC RBA":
  77. trSendingAgent.Visible = false;
  78. trSendingBranch.Visible = false;
  79. trTxnCount.Visible = true;
  80. trBenCountryCount.Visible = true;
  81. trBenCount.Visible = true;
  82. trOutletCount.Visible = true;
  83. trReceiverCountry.Visible = false;
  84. rptType.Items.Remove(new ListItem("Summary Report-Agent", "Summary Report-Agent"));
  85. rptType.Items.Remove(new ListItem("Summary Report-Branch", "Summary Report-Branch"));
  86. break;
  87. case "FINAL RBA":
  88. trSendingAgent.Visible = false;
  89. trSendingBranch.Visible = false;
  90. trTxnCount.Visible = true;
  91. trBenCountryCount.Visible = true;
  92. trBenCount.Visible = true;
  93. trOutletCount.Visible = true;
  94. trReceiverCountry.Visible = false;
  95. rptType.Items.Remove(new ListItem("Summary Report-Agent", "Summary Report-Agent"));
  96. rptType.Items.Remove(new ListItem("Summary Report-Branch", "Summary Report-Branch"));
  97. break;
  98. }
  99. }
  100. }
  101. }