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.

71 lines
2.4 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using Swift.DAL.SocialWall.Feeds;
  8. using Swift.web.Library;
  9. using System.Runtime.Serialization;
  10. using Newtonsoft.Json;
  11. using System.Web.Script.Serialization;
  12. using System.Text;
  13. using System.Data;
  14. namespace Swift.web.Remit.SocialWall.Feeds
  15. {
  16. public partial class ReportDetail : System.Web.UI.Page
  17. {
  18. private const string GridName = "grd_ssc";
  19. //private readonly SwiftGrid _grid = new SwiftGrid();
  20. private string ViewFunctionId = "2022000";
  21. //private string AddEditFunctionId = "2022010";
  22. private readonly RemittanceLibrary _sl = new RemittanceLibrary();
  23. SocialWallGetReportDetails _socialwallDao = new SocialWallGetReportDetails();
  24. public string criteriaID;
  25. protected void Page_Load(object sender, EventArgs e)
  26. {
  27. LoadGrid();
  28. }
  29. private void LoadGrid()
  30. {
  31. JavaScriptSerializer js = new JavaScriptSerializer();
  32. var _gridText = new StringBuilder();
  33. var _responseResult = GetGrid();
  34. dynamic myObject = JsonConvert.DeserializeObject(_responseResult.ToString());
  35. grdReport.DataSource = myObject;
  36. grdReport.DataBind();
  37. grdReport.PageIndexChanged += new DataGridPageChangedEventHandler(dataGrid_PageIndexChanged);
  38. }
  39. void dataGrid_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
  40. {
  41. if (source != null)
  42. {
  43. DataGrid dataGrid = source as DataGrid;
  44. dataGrid.CurrentPageIndex = e.NewPageIndex;
  45. dataGrid.DataBind();
  46. }
  47. }
  48. public DataTable DerializeDataTable(string data)
  49. {
  50. string json = data; //"data" should contain your JSON
  51. dynamic table = JsonConvert.DeserializeObject<DataTable>(json);
  52. return table;
  53. }
  54. private object GetGrid()
  55. {
  56. var Feeds = _socialwallDao.GetReportDetails();
  57. var serializer = new JavaScriptSerializer();
  58. var serializedResult = serializer.Serialize(Feeds);
  59. // var deserializedResult = serializer.Deserialize<List<object>>(serializedResult);
  60. return serializedResult.ToString();
  61. }
  62. }
  63. }