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.

69 lines
2.5 KiB

  1. using System;
  2. using System.Data;
  3. using System.Web.UI;
  4. using Swift.DAL.BL.Remit.Transaction;
  5. using Swift.web.Library;
  6. namespace Swift.web.Remit.Transaction.Agent.ExRate
  7. {
  8. public partial class ViewExRate : Page
  9. {
  10. private const string ViewFunctionId = "40131000";
  11. private SwiftLibrary swiftLibrary = new SwiftLibrary();
  12. private readonly StaticDataDdl sdd = new StaticDataDdl();
  13. private readonly ExRateDao _dao = new ExRateDao();
  14. protected void Page_Load(object sender, EventArgs e)
  15. {
  16. if (!IsPostBack)
  17. {
  18. Authenticate();
  19. result.Visible = false;
  20. PopulateDdl();
  21. }
  22. }
  23. private void Authenticate()
  24. {
  25. swiftLibrary.CheckAuthentication(ViewFunctionId);
  26. }
  27. private void PopulateDdl()
  28. {
  29. sdd.SetDDL(ref collCurrency, "EXEC proc_remitCalculator @flag='a',@agentId='" + GetStatic.GetAgentId() + "',@user='" + GetStatic.GetUser() + "'", "currencyId", "currencyCode", "", "Select");
  30. sdd.SetDDL(ref payCountry, "EXEC proc_rsList1 @flag = 'pcl', @agentId = '" + GetStatic.GetAgentId() + "'", "countryId", "countryName", "", "Select");
  31. sdd.SetDDL(ref txnType, "EXEC proc_serviceTypeMaster 'l2'", "serviceTypeId", "typeTitle", "", "Select");
  32. }
  33. protected void btnSave_Click(object sender, EventArgs e)
  34. {
  35. ShowDetail();
  36. }
  37. private void ShowDetail()
  38. {
  39. DataRow dr = _dao.View(GetStatic.GetUser(), GetStatic.GetAgentId(), collCurrency.SelectedItem.Text,
  40. payCountry.Text, payCurrency.SelectedItem.Text, txnType.Text);
  41. if (dr == null)
  42. return;
  43. result.Visible = true;
  44. cCurrency.Text = dr["cCurrency"].ToString();
  45. pCountry.Text = dr["pCountry"].ToString();
  46. pCurrency.Text = dr["pCurrency"].ToString();
  47. tranType.Text = dr["tranType"].ToString();
  48. customerRate.Text = dr["customerCrossRate"].ToString();
  49. }
  50. protected void sendCurrency_SelectedIndexChanged(object sender, EventArgs e)
  51. {
  52. //if(collCurrency.Text!="")
  53. }
  54. protected void payCountry_SelectedIndexChanged(object sender, EventArgs e)
  55. {
  56. if (payCountry.Text != "")
  57. sdd.SetDDL(ref payCurrency, "EXEC proc_countryCurrency @flag = 'lByName', @countryName = '" + payCountry.SelectedItem.Text + "'", "currencyId", "currencyCode", "", "Select");
  58. }
  59. }
  60. }