using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace NEducation.Code { public class HfData { public string Id { get; set; } public string ParentId { get; set; } public string ServiceId { get; set; } public string Code { get; set; } public string NameGlobal { get; set; } public string NameLocal { get; set; } public string DescriptionGlobal { get; set; } public string DescriptionLocal { get; set; } public string IntroductionGlobal { get; set; } public string IntroductionLocal { get; set; } public string Icon { get; set; } public string Logo { get; set; } public string ContentGlobal { get; set; } public string ContentLocal { get; set; } public string ContentType { get; set; } public string CreatedDate { get; set; } public string UpdateDate { get; set; } public string FromDate { get; set; } public string EndDate { get; set; } public string Status { get; set; } public string Note { get; set; } public string PathParent { get; set; } // parse data from JSON data public HfData() { } public HfData(string json) : this(JObject.Parse(json)) { } public HfData(JObject jObject) { if (jObject != null) { Id = (string)jObject["id"]; ParentId = (string)jObject["parentId"]; ServiceId = (string)jObject["serviceId"]; Code = (string)jObject["code"]; NameGlobal = (string)jObject["nameGlobal"]; NameLocal = (string)jObject["nameLocal"]; DescriptionGlobal = (string)jObject["descriptionGlobal"]; DescriptionLocal = (string)jObject["descriptionLocal"]; IntroductionGlobal = (string)jObject["introductionGlobal"]; IntroductionLocal = (string)jObject["introductionLocal"]; Icon = (string)jObject["icon"]; Logo = (string)jObject["logo"]; ContentGlobal = (string)jObject["contentGlobal"]; ContentLocal = (string)jObject["contentLocal"]; ContentType = (string)jObject["contentType"]; CreatedDate = (string)jObject["createdDate"]; UpdateDate = (string)jObject["updateDate"]; FromDate = (string)jObject["fromDate"]; EndDate = (string)jObject["endDate"]; Status = (string)jObject["status"]; Note = (string)jObject["note"]; PathParent = (string)jObject["pathParent"]; } } } }