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.

62 lines
1.7 KiB

2 years ago
  1. using System.Collections.Generic;
  2. namespace EasyBL.WebApi.Message
  3. {
  4. public class FlexigridResponseMessage : ResponseMessage
  5. {
  6. #region Flexigrid
  7. public class FlexigirdColumn
  8. {
  9. public string Display { get; set; }
  10. public string Name { get; set; }
  11. public int Width { get; set; }
  12. public bool Sortable { get; set; }
  13. public string Align { get; set; }
  14. public bool Hide { get; set; }
  15. public FlexigirdColumn()
  16. {
  17. Hide = false;
  18. }
  19. public static string GetJsonString(FlexigirdColumn i_fc)
  20. {
  21. return $"{{ display: '{i_fc.Display}', name: '{i_fc.Name}', width: {i_fc.Width}, sortable: {((i_fc.Sortable) ? "true" : "false")}, align: '{i_fc.Align}', hide : {((i_fc.Hide) ? "true" : "false")} }}";
  22. }
  23. }
  24. public class FlexigridRow
  25. {
  26. public string id;
  27. public Dictionary<string, string> cell = new Dictionary<string, string>();
  28. }
  29. /// <summary>
  30. /// 目前所在的頁數,從1開始
  31. /// </summary>
  32. public int page;
  33. /// <summary>
  34. /// 總筆數
  35. /// </summary>
  36. public long total;
  37. public List<FlexigridRow> Rows { get; private set; }
  38. #endregion Flexigrid
  39. public FlexigridResponseMessage(RequestMessage i_crm = null)
  40. {
  41. RESULT = ResponseResult.RR_TRUE;
  42. if (null != i_crm)
  43. {
  44. PROJECT = i_crm.PROJECT;
  45. PROJECTVER = i_crm.PROJECTVER;
  46. TYPE = i_crm.TYPE;
  47. }
  48. Rows = new List<FlexigridRow>();
  49. }
  50. }
  51. }