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.

102 lines
3.8 KiB

  1. using System;
  2. using Swift.web.Library;
  3. namespace Swift.web.Responsive.Reports.TxnDetail
  4. {
  5. public partial class Manage : System.Web.UI.Page
  6. {
  7. private readonly StaticDataDdl sdd = new StaticDataDdl();
  8. private readonly RemittanceLibrary sl = new RemittanceLibrary();
  9. private const string ViewFunctionId = "40121600";
  10. protected string GetBranch()
  11. {
  12. return GetStatic.GetBranch();
  13. }
  14. protected void Page_Load(object sender, EventArgs e)
  15. {
  16. if (!IsPostBack)
  17. {
  18. Authenticate();
  19. PopulateBenificiary();
  20. PopulatePaymentType();
  21. sl.SetPayStatusDdl(ref status, "", "All");
  22. PopulateTranStatus();
  23. frmDate.Text = DateTime.Now.ToString("MM/dd/yyyy");
  24. toDate.Text = DateTime.Now.ToString("MM/dd/yyyy");
  25. }
  26. }
  27. private void Authenticate()
  28. {
  29. sl.CheckAuthentication(ViewFunctionId);
  30. }
  31. private void PopulateBenificiary()
  32. {
  33. var sql = "EXEC proc_sendPageLoadData @flag='pCountry',@countryId='" + GetStatic.GetCountryId() +
  34. "',@agentid='" + GetStatic.GetAgentId() + "'";
  35. sl.SetDDL(ref pCountry, sql, "countryId", "countryName", "", "");
  36. //sl.SetDDL(ref Sbranch, "EXEC proc_dropDownLists @flag ='rh-branch',@branchId=" +
  37. // GetStatic.GetBranch() + ",@userType=" + GetStatic.GetUserType(), "agentId", "agentName", "", "");
  38. if (GetStatic.GetUserType() == "AB")
  39. sdd.SetDDL3(ref Sbranch, "EXEC proc_dropDownLists @flag ='rh-branch',@branchId=" +
  40. sdd.FilterString(GetStatic.GetBranch()) + ",@userType=" + sdd.FilterString(GetStatic.GetUserType()), "agentId", "agentName", "", "");
  41. else if (GetStatic.GetUserType() == "AH")
  42. sdd.SetDDL3(ref Sbranch, "EXEC proc_dropDownLists @flag ='rh-branch',@branchId=" +
  43. sdd.FilterString(GetStatic.GetBranch()) + ",@userType=" + sdd.FilterString(GetStatic.GetUserType()), "agentId", "agentName", "", "All");
  44. else
  45. sdd.SetDDL3(ref Sbranch, "EXEC proc_dropDownLists @flag ='rh-branch',@branchId=" +
  46. sdd.FilterString(GetStatic.GetBranch()) + ",@userType=" + sdd.FilterString(GetStatic.GetUserType()), "agentId", "agentName", "", "");
  47. }
  48. private void PopulateTranStatus()
  49. {
  50. var label = "";
  51. if (status.Text.ToLower().Equals("unpaid") || string.IsNullOrWhiteSpace(status.Text))
  52. {
  53. label = "All";
  54. }
  55. sl.SetTranStatusDdl(ref tranType, status.Text, "", label);
  56. }
  57. private void PopulateAgent()
  58. {
  59. var sql = "EXEC proc_dropDownLists @flag='agent', @country =" + pCountry.SelectedValue;
  60. sl.SetDDL(ref pAgent, sql, "agentId", "agentName", "", "All");
  61. }
  62. private void PopulatePaymentType()
  63. {
  64. var sql = "EXEC proc_sendPageLoadData @flag='recModeByCountry-txnReport',@countryId = " + GetStatic.GetCountryId() + ", @agentId =" + GetStatic.GetAgent() + ",@pCountryId =" + sl.FilterString(pCountry.Text);
  65. sl.SetDDL(ref paymentType, sql, "serviceTypeId", "typeTitle", "", "All");
  66. }
  67. protected void status_SelectedIndexChanged(object sender, EventArgs e)
  68. {
  69. PopulateTranStatus();
  70. }
  71. protected void pCountry_SelectedIndexChanged(object sender, EventArgs e)
  72. {
  73. if (string.IsNullOrWhiteSpace(pCountry.Text))
  74. {
  75. pAgent.Items.Clear();
  76. }
  77. else
  78. {
  79. PopulateAgent();
  80. }
  81. PopulatePaymentType();
  82. }
  83. }
  84. }