| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using Newtonsoft.Json;
- using Newtonsoft.Json.Linq;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- namespace SuperCms.Models
- {
- public class ConnTelco
- {
- public String id { get; set; }
- public String telcoCode { get; set; }
- public String telcoName { get; set; }
- public String sequence { get; set; }
- public String timeDiff { get; set; }
- public override string ToString()
- {
- return JsonConvert.SerializeObject(this);
- }
- public ConnTelco() { }
- public ConnTelco(string json) : this(JObject.Parse(json))
- { }
- public ConnTelco(JObject jObject)
- {
- if (jObject != null)
- {
- id = (string)jObject["ID"];
- telcoCode = (string)jObject["TELCO_CODE"];
- telcoName = (string)jObject["TELCO_NAME"];
- sequence = (string)jObject["SEQUENCE"];
- timeDiff = (string)jObject["TIME_DIFF"];
- }
- }
- }
- public class ConnTelcos
- {
- [JsonProperty("data")]
- public List<ConnTelco> data { get; set; }
- public override string ToString()
- {
- return JsonConvert.SerializeObject(this);
- }
- public ConnTelcos() { }
- public ConnTelcos(string json) : this(JObject.Parse(json)) { }
- public ConnTelcos(JObject jObject)
- {
- if (jObject != null)
- {
- var list = jObject["data"];
- if (list != null && list.HasValues)
- {
- data = new List<ConnTelco>();
- JArray a = (JArray)list;
- foreach (JObject o in a.Children<JObject>())
- {
- data.Add(new ConnTelco(o));
- }
- }
- }
- }
- }
- }
|