| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using Newtonsoft.Json.Linq;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- namespace SuperAdmin.Models.Object
- {
- public class Province
- {
- public String id { get; set; }
- public String name { get; set; }
- public String code { get; set; }
- public Province(string id, string name, string code)
- {
- this.id = id;
- this.name = name;
- this.code = code;
- }
- public Province() { }
- public Province(string json) : this(JObject.Parse(json))
- { }
- public Province(JObject jObject)
- {
- if (jObject != null)
- {
- id = (string)jObject["id"];
- name = (string)jObject["name"];
- code = (string)jObject["code"];
- }
- }
- }
- public class Provinces
- {
- public List<Province> data { get; set; }
- public Provinces() { }
- public Provinces(string json) : this(JObject.Parse(json)) { }
- public Provinces(JObject jObject)
- {
- if (jObject != null)
- {
- var list = jObject["listProvice"];
- if (list != null && list.HasValues)
- {
- data = new List<Province>();
- JArray a = (JArray)list;
- foreach (JObject o in a.Children<JObject>())
- {
- data.Add(new Province(o));
- }
- }
- }
- }
- }
- }
|