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.

72 lines
2.0 KiB

  1. using Swift.DAL.OnlineAgent;
  2. using Swift.DAL.SwiftDAL;
  3. using Swift.web.Library;
  4. using System;
  5. namespace Swift.web.OnlineRemit.WalletManager
  6. {
  7. public partial class Manage : System.Web.UI.Page
  8. {
  9. private const string ViewFunctionId = "20131000";
  10. private const string ApproveRejectFunctionId = "20131030";
  11. private readonly RemittanceLibrary swiftLibrary = new RemittanceLibrary();
  12. OnlineCustomerDao onlineCustomerDao = new OnlineCustomerDao();
  13. protected void Page_Load(object sender, EventArgs e)
  14. {
  15. if (!IsPostBack)
  16. {
  17. Authenticate();
  18. string customerId = GetStatic.ReadQueryString("customerId", "");
  19. string walletTxnId = GetStatic.ReadQueryString("id", "");
  20. string opType = GetStatic.ReadQueryString("opType", "");
  21. if (opType == "approve")
  22. {
  23. btnApprove.Visible = true;
  24. btnApprove.Enabled = true;
  25. btnReject.Enabled = false;
  26. }
  27. else
  28. {
  29. btnReject.Visible = true;
  30. btnReject.Enabled = true;
  31. btnApprove.Enabled = false;
  32. }
  33. LoadCustomerWalletInfo(customerId, walletTxnId);
  34. }
  35. }
  36. private void Authenticate()
  37. {
  38. swiftLibrary.CheckAuthentication(ViewFunctionId + "," + ApproveRejectFunctionId);
  39. }
  40. private void LoadCustomerWalletInfo(string customerId, string walletTxnId)
  41. {
  42. var dt = onlineCustomerDao.LoadCustomerWalletInfo(customerId, walletTxnId);
  43. if (dt != null && dt.Rows.Count > 0)
  44. {
  45. customer.Text = dt.Rows[0]["firstName"].ToString();
  46. remarks.Text = dt.Rows[0]["remarks"].ToString();
  47. amount.Text = dt.Rows[0]["amount"].ToString();
  48. }
  49. }
  50. protected void btnApprove_Click(object sender, EventArgs e)
  51. {
  52. ApproveReject();
  53. }
  54. protected void btnReject_Click(object sender, EventArgs e)
  55. {
  56. ApproveReject();
  57. }
  58. private DbResult ApproveReject()
  59. {
  60. string customerId = GetStatic.ReadQueryString("customerId", "");
  61. string walletTxnId = GetStatic.ReadQueryString("id", "");
  62. string opType = GetStatic.ReadQueryString("opType", "");
  63. var res = onlineCustomerDao.ApproveRejectWallet(customerId, walletTxnId, opType);
  64. return res;
  65. }
  66. }
  67. }