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.

77 lines
2.8 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.OnlineRemit.WalletManager
  7. {
  8. public partial class List : System.Web.UI.Page
  9. {
  10. private const string GridName = "grid_wallet";
  11. private const string ViewFunctionId = "20131000";
  12. private const string ApproveRejectFunctionId = "20131030";
  13. private readonly SwiftGrid _grid = new SwiftGrid();
  14. private readonly RemittanceLibrary swiftLibrary = new RemittanceLibrary();
  15. protected void Page_Load(object sender, EventArgs e)
  16. {
  17. if (!IsPostBack)
  18. {
  19. Authenticate();
  20. }
  21. LoadGrid();
  22. }
  23. private void Authenticate()
  24. {
  25. swiftLibrary.CheckAuthentication(ViewFunctionId);
  26. }
  27. private void LoadGrid()
  28. {
  29. _grid.FilterList = new List<GridFilter>
  30. {
  31. new GridFilter("fromDate", "From", "d"),
  32. new GridFilter("toDate", "To", "d")
  33. };
  34. _grid.ColumnList = new List<GridColumn>
  35. {
  36. new GridColumn("SN", "SNO", "", "T"),
  37. new GridColumn("Date", "Date", "", "D"),
  38. new GridColumn("Particular", "Particulars", "", "T"),
  39. new GridColumn("Debit", "Withdraw", "", "T"),
  40. new GridColumn("Credit", "Deposit", "", "T"),
  41. new GridColumn("Balance", "Balance", "", "T")
  42. };
  43. _grid.GridType = 1;
  44. _grid.GridDataSource = SwiftGrid.GridDS.RemittanceDB;
  45. _grid.GridName = GridName;
  46. _grid.ShowPagingBar = true;
  47. _grid.AllowEdit = false;
  48. _grid.AllowDelete = false;
  49. _grid.AlwaysShowFilterForm = true;
  50. _grid.ShowFilterForm = true;
  51. _grid.SortOrder = "ASC";
  52. _grid.RowIdField = "id";
  53. _grid.ThisPage = "List.aspx"; ;
  54. _grid.InputPerRow = 4;
  55. _grid.AllowCustomLink = true;
  56. _grid.CustomLinkVariables = "customerId,id";
  57. _grid.GridMinWidth = 700;
  58. _grid.GridWidth = 100;
  59. _grid.IsGridWidthInPercent = true;
  60. _grid.SetComma();
  61. if (swiftLibrary.HasRight(ApproveRejectFunctionId))
  62. {
  63. var link = "&nbsp;<a class=\"btn btn-xs btn-primary\" title=\"Approve/Reject\" href=\"Manage.aspx?id=@id&customerId=@customerId&opType=approve\"><i class=\"fa fa-pencil\"></i></a>&nbsp;<a class=\"btn btn-xs btn-success\" title=\"Edit\" href=\"Manage.aspx?id=@id&customerId=@customerId&opType=reject\"><i class=\"fa fa-check\"></i></a>";
  64. _grid.CustomLinkText = link;
  65. }
  66. var sql = "EXEC proc_online_customerWalletManager @flag = 's'";
  67. sql += ", @customerId = " + swiftLibrary.FilterString(customer.Value);
  68. rpt_grid.InnerHtml = _grid.CreateGrid(sql);
  69. }
  70. }
  71. }