HfData.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using Newtonsoft.Json.Linq;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Web;
  6. namespace NEducation.Code
  7. {
  8. public class HfData
  9. {
  10. public string Id { get; set; }
  11. public string ParentId { get; set; }
  12. public string ServiceId { get; set; }
  13. public string Code { get; set; }
  14. public string NameGlobal { get; set; }
  15. public string NameLocal { get; set; }
  16. public string DescriptionGlobal { get; set; }
  17. public string DescriptionLocal { get; set; }
  18. public string IntroductionGlobal { get; set; }
  19. public string IntroductionLocal { get; set; }
  20. public string Icon { get; set; }
  21. public string Logo { get; set; }
  22. public string ContentGlobal { get; set; }
  23. public string ContentLocal { get; set; }
  24. public string ContentType { get; set; }
  25. public string CreatedDate { get; set; }
  26. public string UpdateDate { get; set; }
  27. public string FromDate { get; set; }
  28. public string EndDate { get; set; }
  29. public string Status { get; set; }
  30. public string Note { get; set; }
  31. public string PathParent { get; set; }
  32. // parse data from JSON data
  33. public HfData() { }
  34. public HfData(string json) : this(JObject.Parse(json))
  35. { }
  36. public HfData(JObject jObject)
  37. {
  38. if (jObject != null)
  39. {
  40. Id = (string)jObject["id"];
  41. ParentId = (string)jObject["parentId"];
  42. ServiceId = (string)jObject["serviceId"];
  43. Code = (string)jObject["code"];
  44. NameGlobal = (string)jObject["nameGlobal"];
  45. NameLocal = (string)jObject["nameLocal"];
  46. DescriptionGlobal = (string)jObject["descriptionGlobal"];
  47. DescriptionLocal = (string)jObject["descriptionLocal"];
  48. IntroductionGlobal = (string)jObject["introductionGlobal"];
  49. IntroductionLocal = (string)jObject["introductionLocal"];
  50. Icon = (string)jObject["icon"];
  51. Logo = (string)jObject["logo"];
  52. ContentGlobal = (string)jObject["contentGlobal"];
  53. ContentLocal = (string)jObject["contentLocal"];
  54. ContentType = (string)jObject["contentType"];
  55. CreatedDate = (string)jObject["createdDate"];
  56. UpdateDate = (string)jObject["updateDate"];
  57. FromDate = (string)jObject["fromDate"];
  58. EndDate = (string)jObject["endDate"];
  59. Status = (string)jObject["status"];
  60. Note = (string)jObject["note"];
  61. PathParent = (string)jObject["pathParent"];
  62. }
  63. }
  64. }
  65. }