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.

59 lines
1.7 KiB

  1. using Swift.DAL.BL.Remit.Transaction;
  2. using Swift.DAL.SwiftDAL;
  3. using Swift.web.Library;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Linq;
  8. using System.Web;
  9. using System.Web.UI;
  10. using System.Web.UI.WebControls;
  11. namespace Swift.web.Remit.Transaction.BankRateSetup
  12. {
  13. public partial class BankSetup : System.Web.UI.Page
  14. {
  15. private const string ViewFunctionId = "20173000";
  16. private const string EditFunctionId = "20173010";
  17. ExRateDao _exrateDao = new ExRateDao();
  18. private readonly StaticDataDdl _sdd = new StaticDataDdl();
  19. protected void Page_Load(object sender, EventArgs e)
  20. {
  21. Authenticate();
  22. if (!IsPostBack)
  23. {
  24. Misc.MakeNumericTextbox(ref sc);
  25. Misc.MakeNumericTextbox(ref custRate);
  26. PopulateData();
  27. }
  28. }
  29. private void Authenticate()
  30. {
  31. _sdd.CheckAuthentication(ViewFunctionId);
  32. changePass.Enabled = _sdd.CheckAuthentication(EditFunctionId);
  33. }
  34. private void PopulateData()
  35. {
  36. DataRow dr = _exrateDao.GetBankExrateData();
  37. if (dr == null)
  38. {
  39. return;
  40. }
  41. custRate.Text = dr["customerRate"].ToString();
  42. sc.Text = GetStatic.ShowDecimal(dr["serviceCharge"].ToString());
  43. }
  44. protected void changePass_Click(object sender, EventArgs e)
  45. {
  46. DbResult _res = _exrateDao.UpdateRate(custRate.Text, sc.Text, GetStatic.GetUser());
  47. if (_res.ErrorCode == "0")
  48. {
  49. PopulateData();
  50. }
  51. GetStatic.AlertMessage(this, _res.Msg);
  52. }
  53. }
  54. }