コード例 #1
0
        public static IList <ELongGeoLocationAdapter> GetGeoLocationList()
        {
            IList <ELongGeoLocationAdapter> list = new List <ELongGeoLocationAdapter>();
            XmlDocument         doc   = GetDoc(PATH_GEO_CN);
            XmlNamespaceManager xnm   = GetXnmQ1();
            XmlNode             root  = doc.SelectSingleNode("q1:HotelGeoList", xnm);
            XmlNodeList         nodes = root.SelectNodes("q1:HotelGeo", xnm);

            string[] localTages = new string[] { GEO_LOCATION_DISTRICTS, GEO_LOCATION_COMMERCIAL, GEO_LOCATION_LANDMARK };
            string   geoId      = "";

            foreach (XmlNode node in nodes)
            {
                geoId = node.SelectSingleNode("q1:id", xnm).InnerText;
                foreach (string tag in localTages)
                {
                    XmlNode     localTypeNode = node.SelectSingleNode("q1:" + tag, xnm);
                    XmlNodeList localNodeList = localTypeNode.ChildNodes;
                    foreach (XmlNode localNode in localNodeList)
                    {
                        ELongGeoLocationAdapter adapter = new ELongGeoLocationAdapter();
                        adapter.from(localNode, xnm, "q1:", "");
                        adapter.exType  = tag;
                        adapter.exGeoId = geoId;
                        list.Add(adapter);
                    }
                }
            }
            return(list);
        }
コード例 #2
0
ファイル: GeoModel.cs プロジェクト: uhealin/toyz-toyz4net
 public void from(ELongGeoLocationAdapter adapter)
 {
     this.id = string.Format("{0}::{1}", adapter.exGeoId, adapter.id);
     this.name = adapter.name;
     this.locationId = adapter.id;
     this.geoFk = adapter.exGeoId;
 }
コード例 #3
0
 public static IList<ELongGeoLocationAdapter> GetGeoLocationList()
 {
     IList<ELongGeoLocationAdapter> list = new List<ELongGeoLocationAdapter>();
     XmlDocument doc = GetDoc(PATH_GEO_CN);
     XmlNamespaceManager xnm = GetXnmQ1();
     XmlNode root = doc.SelectSingleNode("q1:HotelGeoList", xnm);
     XmlNodeList nodes = root.SelectNodes("q1:HotelGeo", xnm);
     string[] localTages = new string[] { GEO_LOCATION_DISTRICTS,GEO_LOCATION_COMMERCIAL, GEO_LOCATION_LANDMARK };
     string geoId = "";
     foreach (XmlNode node in nodes)
     {
         geoId = node.SelectSingleNode("q1:id", xnm).InnerText;
         foreach (string tag in localTages) {
             XmlNode localTypeNode = node.SelectSingleNode("q1:"+tag,xnm);
             XmlNodeList localNodeList= localTypeNode.ChildNodes;
             foreach (XmlNode localNode in localNodeList) {
                 ELongGeoLocationAdapter adapter = new ELongGeoLocationAdapter();
                 adapter.from(localNode, xnm, "q1:", "");
                 adapter.exType = tag;
                 adapter.exGeoId = geoId;
                 list.Add(adapter);
             }
         }
     }
     return list;
 }