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.

73 lines
2.3 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.Threading.Tasks;
  9. using System.Web;
  10. using System.Web.UI;
  11. using System.Web.UI.WebControls;
  12. namespace Swift.web.Remit.Transaction.TxnVerify
  13. {
  14. public partial class Manage : System.Web.UI.Page
  15. {
  16. private const string ViewFunctionId = "20122800";
  17. private readonly StaticDataDdl _sdd = new StaticDataDdl();
  18. private readonly ApproveTransactionDao atd = new ApproveTransactionDao();
  19. protected void Page_Load(object sender, EventArgs e)
  20. {
  21. GetStatic.AttachConfirmMsg(ref btnApprove, "Are you sure to APPROVE this transaction?");
  22. if (!IsPostBack)
  23. {
  24. //Authenticate();
  25. }
  26. LoadTransaction();
  27. }
  28. private void Authenticate()
  29. {
  30. _sdd.CheckAuthentication(ViewFunctionId);
  31. }
  32. private void LoadTransaction()
  33. {
  34. string tranNo = GetTranNo();
  35. ucTran.SearchData(tranNo, "", "", "", "APPROVE", "ADMIN: VIEW TXN TO APPROVE");
  36. divTranDetails.Visible = ucTran.TranFound;
  37. if (!ucTran.TranFound)
  38. {
  39. divControlno.InnerHtml = "<h2>No Transaction Found</h2>";
  40. return;
  41. }
  42. }
  43. protected string GetTranNo()
  44. {
  45. return GetStatic.ReadQueryString("id", "");
  46. }
  47. protected void btnApprove_Click(object sender, EventArgs e)
  48. {
  49. DbResult dbResult = atd.VerifyTransaction(GetTranNo(), GetStatic.GetUser());
  50. GetStatic.PrintMessage(Page, dbResult);
  51. if (dbResult.ErrorCode.Equals("0"))
  52. {
  53. ClientScript.RegisterStartupScript(Page.GetType(), "scr", "window.opener.CallBack();", true);
  54. }
  55. }
  56. protected void btnReject_Click(object sender, EventArgs e)
  57. {
  58. DbResult dbResult = atd.RejectHoldedTXN(GetStatic.GetUser(), GetTranNo());
  59. GetStatic.PrintMessage(Page, dbResult);
  60. if (dbResult.ErrorCode.Equals("0"))
  61. {
  62. ClientScript.RegisterStartupScript(Page.GetType(), "scr", "window.opener.CallBack();", true);
  63. }
  64. }
  65. }
  66. }