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.

74 lines
2.9 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.ApplicationLog
  7. {
  8. public partial class UserLog : System.Web.UI.Page
  9. {
  10. private const string ViewFunctionId = "10121300";
  11. protected const string GridName = "grdUseLog";
  12. private readonly SwiftGrid _grid = new SwiftGrid();
  13. private readonly SwiftLibrary _sl = new SwiftLibrary();
  14. protected void Page_Load(object sender, EventArgs e)
  15. {
  16. _sl.CheckSession();
  17. if (!IsPostBack)
  18. {
  19. Authenticate();
  20. GetStatic.PrintMessage(Page);
  21. }
  22. LoadGrid();
  23. }
  24. private void Authenticate()
  25. {
  26. _sl.CheckAuthentication(ViewFunctionId);
  27. }
  28. private void LoadGrid()
  29. {
  30. _grid.FilterList = new List<GridFilter>
  31. {
  32. new GridFilter("createdBy", "User", "LT"),
  33. new GridFilter("logType", "Log Type","1:exec proc_dropDownList @FLAG='logtype'" ),
  34. };
  35. _grid.ColumnList = new List<GridColumn>
  36. {
  37. new GridColumn("logType", "Log Type", "", "T"),
  38. new GridColumn("IP", "IP", "", "T"),
  39. new GridColumn("Reason", "Reason", "", "T"),
  40. new GridColumn("createdBy", "User", "", "T"),
  41. new GridColumn("createdDate", "Log Date", "", "T"),
  42. };
  43. _grid.GridType = 1;
  44. _grid.GridDataSource = SwiftGrid.GridDS.RemittanceDB;
  45. _grid.InputPerRow = 2;
  46. _grid.GridName = GridName;
  47. _grid.ShowFilterForm = true;
  48. _grid.ShowPagingBar = true;
  49. _grid.RowIdField = "rowId";
  50. _grid.AlwaysShowFilterForm = true;
  51. _grid.AllowCustomLink = true;
  52. _grid.AddButtonTitleText = "Add New Data";
  53. _grid.AllowCustomLink = true;
  54. _grid.CustomLinkVariables = "rowId";
  55. _grid.CustomLinkText = "<a href='#' onClick=\"PopUpWindow('ViewDetail.aspx?id=@rowId','dialogHeight:350px;dialogWidth:600px;dialogLeft:300;dialogTop:200;center:yes') \"><img src=\"../../Images/but_view.gif\" alt='User Log' border='0' /></a>";
  56. //_grid.CustomLinkText = "<a href=\"SubList.aspx?id=@rowId\" ><img src=\"../../Images/but_view.gif\" ></a>";
  57. //_grid.AddPage = "ViewDetail.aspx";
  58. _grid.ThisPage = "UserLog.aspx";
  59. _grid.SetComma();
  60. _grid.InputLabelOnLeftSide = true;
  61. const string sql = "exec [Proc_UserLogs] @flag = 's'";
  62. guserLog_grid.InnerHtml = _grid.CreateGrid(sql);
  63. }
  64. }
  65. }