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.

62 lines
2.8 KiB

  1. using System;
  2. using System.Text;
  3. using Swift.web.Library;
  4. namespace Swift.web.Responsive.AdminPanel.TxnSummary
  5. {
  6. public partial class TxnSummaryManage : System.Web.UI.Page
  7. {
  8. private readonly StaticDataDdl sdd = new StaticDataDdl();
  9. private readonly RemittanceLibrary sl = new RemittanceLibrary();
  10. private const string ViewFunctionId = "40121700";
  11. protected void Page_Load(object sender, EventArgs e)
  12. {
  13. if (!IsPostBack)
  14. {
  15. LoadReceiverCountry();
  16. Authenticate();
  17. PopulateDdl();
  18. from.Text = DateTime.Now.ToString("MM/dd/yyyy");
  19. to.Text = DateTime.Now.ToString("MM/dd/yyyy");
  20. from.ReadOnly = true;
  21. to.ReadOnly = true;
  22. }
  23. }
  24. private void Authenticate()
  25. {
  26. sl.CheckAuthentication(ViewFunctionId);
  27. }
  28. private void PopulateDdl()
  29. {
  30. if (GetStatic.GetUserType() == "AB")
  31. sdd.SetDDL3(ref branch, "EXEC proc_dropDownLists @flag ='rh-branch',@branchId=" +
  32. sdd.FilterString(GetStatic.GetBranch()) + ",@userType=" + sdd.FilterString(GetStatic.GetUserType()), "agentId", "agentName", "", "");
  33. else if (GetStatic.GetUserType() == "AH")
  34. sdd.SetDDL3(ref branch, "EXEC proc_dropDownLists @flag ='rh-branch',@branchId=" +
  35. sdd.FilterString(GetStatic.GetBranch()) + ",@userType=" + sdd.FilterString(GetStatic.GetUserType()), "agentId", "agentName", "", "All");
  36. else
  37. sdd.SetDDL3(ref branch, "EXEC proc_dropDownLists @flag ='rh-branch',@branchId=" +
  38. sdd.FilterString(GetStatic.GetBranch()) + ",@userType=" + sdd.FilterString(GetStatic.GetUserType()), "agentId", "agentName", "", "");
  39. //sl.SetDDL(ref branch, "EXEC proc_dropDownLists @flag ='rh-branch',@branchId="+GetStatic.GetBranch()+",@userType=" + GetStatic.GetUserType(), "agentId", "agentName", "", "");
  40. }
  41. private void LoadReceiverCountry()
  42. {
  43. var sql = "EXEC proc_sendPageLoadData @flag='pCountry',@countryId='" + GetStatic.GetCountryId() + "',@agentid='" + GetStatic.GetAgentId() + "'";
  44. sdd.SetDDL(ref beneficiary, sql, "countryId", "countryName", "", "");
  45. }
  46. protected void beneficiary_SelectedIndexChanged(object sender, EventArgs e)
  47. {
  48. if (string.IsNullOrWhiteSpace(beneficiary.Text))
  49. {
  50. agentName.Items.Clear();
  51. }
  52. else
  53. {
  54. var sql = "EXEC proc_dropDownLists @flag='agent', @country =" + beneficiary.SelectedValue;
  55. sl.SetDDL(ref agentName, sql, "agentId", "agentName", "", "All");
  56. }
  57. }
  58. }
  59. }