Example #1
0
        public static void RefreshProvince()
        {
            provincesList.Clear();
            string      xml = hiPiaoSrv.GetCityOfprovince();
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(xml);
            XmlNodeList    provincesNode = doc.SelectNodes("//Province");
            XmlNodeList    citysNode     = null;
            CityObject     city          = null;
            ProvinceObject province      = null;

            for (int i = 0; i < provincesNode.Count; i++)
            {
                province      = new ProvinceObject();
                province.Name = provincesNode[i].Attributes["name"].Value;
                citysNode     = provincesNode[i].ChildNodes;
                for (int j = 0; j < citysNode.Count; j++)
                {
                    city         = new CityObject();
                    city.Id      = citysNode[j].Attributes["id"].Value;
                    city.McityId = citysNode[j].Attributes["mcityId"].Value;
                    city.Name    = citysNode[j].Attributes["name"].Value;
                    province.Citys.Add(city);
                }
                provincesList.Add(province);
            }
        }
Example #2
0
 public static void RefreshProvince()
 {
     provincesList.Clear();
     string xml = hiPiaoSrv.GetCityOfprovince();
     XmlDocument doc = new XmlDocument();
     doc.LoadXml(xml);
     XmlNodeList provincesNode = doc.SelectNodes("//Province");
     XmlNodeList citysNode=null;
     CityObject city=null;
     ProvinceObject province = null;
     for (int i = 0; i < provincesNode.Count; i++)
     {
         province = new ProvinceObject();
         province.Name = provincesNode[i].Attributes["name"].Value;
         citysNode = provincesNode[i].ChildNodes;
         for (int j = 0; j < citysNode.Count; j++)
         {
             city = new CityObject();
             city.Id = citysNode[j].Attributes["id"].Value;
             city.McityId = citysNode[j].Attributes["mcityId"].Value;
             city.Name = citysNode[j].Attributes["name"].Value;
             province.Citys.Add(city);
         }
         provincesList.Add(province);
     }
 }