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.

84 lines
3.1 KiB

  1. using Swift.web.Component.Grid;
  2. using Swift.web.Component.Grid.gridHelper;
  3. using Swift.web.Library;
  4. using System;
  5. using System.Collections.Generic;
  6. namespace Swift.web.Remit.InternationalOperation.BalanceTopUp
  7. {
  8. public partial class History : System.Web.UI.Page
  9. {
  10. private const string GridName = "gridBalTopUpHistory";
  11. private const string ViewFunctionId = "30011100";
  12. private readonly SwiftGrid grid = new SwiftGrid();
  13. private readonly RemittanceLibrary swiftLibrary = new RemittanceLibrary();
  14. protected void Page_Load(object sender, EventArgs e)
  15. {
  16. Authenticate();
  17. if (!IsPostBack)
  18. {
  19. GetStatic.PrintMessage(Page);
  20. }
  21. LoadGrid();
  22. }
  23. #region method
  24. protected string GetAgentName()
  25. {
  26. return "Agent Name : " + swiftLibrary.GetAgentName(GetAgentId().ToString());
  27. }
  28. protected long GetAgentId()
  29. {
  30. return GetStatic.ReadNumericDataFromQueryString("agentId");
  31. }
  32. private void LoadGrid()
  33. {
  34. grid.FilterList = new List<GridFilter>
  35. {
  36. new GridFilter("createdBy", "Created By", "LT"),
  37. new GridFilter("approvedBy", "Approved By", "LT"),
  38. new GridFilter("approvedFromDate", "Approved Date From", "z"),
  39. new GridFilter("approvedToDate", "To", "z")
  40. };
  41. grid.ColumnList = new List<GridColumn>
  42. {
  43. new GridColumn("amount", "Amount", "", "M"),
  44. new GridColumn("btStatus", "Status", "", "T"),
  45. new GridColumn("createdBy", "Created By", "", "T"),
  46. new GridColumn("createdDate", "Created Date", "", "T"),
  47. new GridColumn("approvedBy", "Approved By", "", "T"),
  48. new GridColumn("approvedDate", "Approved Date", "", "T")
  49. };
  50. grid.GridType = 1;
  51. grid.GridDataSource = SwiftGrid.GridDS.RemittanceDB;
  52. grid.GridName = GridName;
  53. grid.ShowFilterForm = true;
  54. grid.AlwaysShowFilterForm = true;
  55. grid.EnableFilterCookie = false;
  56. grid.LoadGridOnFilterOnly = false;
  57. grid.ShowPagingBar = true;
  58. grid.SortBy = "approvedDate";
  59. grid.SortOrder = "DESC";
  60. grid.RowIdField = "sn";
  61. grid.InputPerRow = 4;
  62. grid.GridWidth = 650;
  63. string sql = "[proc_balanceTopUpInt] @flag = 'history',@agentId='" + GetAgentId() + "'";
  64. grid.SetComma();
  65. rpt_grid.InnerHtml = grid.CreateGrid(sql);
  66. }
  67. private void Authenticate()
  68. {
  69. swiftLibrary.CheckAuthentication(ViewFunctionId);
  70. }
  71. #endregion
  72. }
  73. }