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.

58 lines
1.9 KiB

  1. using System;
  2. using Swift.web.Library;
  3. namespace Swift.web.Responsive.AdminPanel.SOADomestic
  4. {
  5. public partial class SOAManage : System.Web.UI.Page
  6. {
  7. protected string AgentMapCode = "";
  8. protected string AgentId = "";
  9. private readonly RemittanceLibrary _rl = new RemittanceLibrary();
  10. private const string ViewFunctionId = "40121000";
  11. protected void Page_Load(object sender, EventArgs e)
  12. {
  13. _rl.CheckSession();
  14. if (!IsPostBack)
  15. {
  16. Authenticate();
  17. fromDate.Text = DateTime.Now.ToString("d");
  18. toDate.Text = DateTime.Now.ToString("d");
  19. PopulateData();
  20. }
  21. }
  22. private void Authenticate()
  23. {
  24. _rl.CheckAuthentication(ViewFunctionId);
  25. }
  26. private void PopulateData()
  27. {
  28. var isActAsBranch = GetStatic.GetIsActAsBranch();
  29. var agentType = GetStatic.GetAgentType();
  30. var agentMapCode = GetStatic.GetMapCodeInt();
  31. var agentName = GetStatic.GetAgentName();
  32. var parentMapCode = GetStatic.GetParentMapCodeInt();
  33. var agentId = GetStatic.GetAgentId();
  34. AgentId = GetStatic.GetAgent();
  35. var settlingAgent = GetStatic.GetSettlingAgent();
  36. var isSettlingAgent = "N";
  37. if (agentId == settlingAgent)
  38. isSettlingAgent = "Y";
  39. if (isActAsBranch == "Y" && agentType == "2903") // Private Agents
  40. {
  41. AgentMapCode = agentMapCode;
  42. }
  43. else if (agentType == "2904") // Bank & Finance
  44. {
  45. if (isSettlingAgent == "N")
  46. AgentMapCode = parentMapCode;
  47. if (isSettlingAgent == "Y")
  48. AgentMapCode = agentMapCode;
  49. }
  50. lblAgent.Text = agentName + "- " + AgentMapCode;
  51. }
  52. }
  53. }