コード例 #1
0
ファイル: HotelModel.cs プロジェクト: uhealin/toyz-toyz4net
        public void from(ELongHotelDetailAdapter adapter)
        {
            this.id = adapter.id;
            this.dateUpdated = ELongStaticClient.ParseDateTime(adapter.dateUpdated);
            this.name = adapter.name;
            this.address = adapter.address;
            this.zip = adapter.zip;
            this.category = ObjectUtil.ParseInt(adapter.category,0);
            this.typology = adapter.typology;
            this.roomNumber = ObjectUtil.ParseInt(adapter.roomNumber,0);
            this.availPolicy = adapter.availPolicy;
            this.activationDate = ELongStaticClient.ParseDateTime(adapter.activationDate);
            this.usersRating = ObjectUtil.ParseInt(adapter.usersRating,0);
            this.elongRanking = ObjectUtil.ParseInt(adapter.elongRanking, 0);
            this.templateType = adapter.templateType;
            this.translations = adapter.translations;
            this.doublePriceMin = ObjectUtil.ParseDouble(adapter.doublePriceMin, 0);
            this.doublePriceMax = ObjectUtil.ParseDouble(adapter.doublePriceMax, 0);
            this.currency = adapter.currency;
            this.lat = ObjectUtil.ParseDouble(adapter.lat, 0);
            this.lon = ObjectUtil.ParseDouble(adapter.lon, 0);
            this.country = adapter.country;
            this.region = adapter.region;
            this.city = adapter.city;
            this.province = adapter.province;
            this.businessZone = adapter.businessZone;
            this.district = adapter.district;
            this.propertyUrl = adapter.propertyUrl;
            this.introEditor = adapter.introEditor;
            this.ccAccepted = adapter.ccAccepted;
            this.description = adapter.description;
            this.phone = adapter.Phone;
            this.fax = adapter.Fax;
            this.openingDate = ELongStaticClient.ParseDateTime(adapter.OpeningDate);
            this.renovationDate = ELongStaticClient.ParseDateTime(adapter.RenovationDate);
            this.star = ObjectUtil.ParseInt(adapter.star, 0);
            this.brandId = adapter.brandID;
            this.iseconomic = ObjectUtil.Parse(adapter.iseconomic, "0");
            this.isapartment = ObjectUtil.Parse(adapter.Isapartment, "0");
            this.trafficGuide = adapter.exTrafficGuide;
            this.trafficOverview = adapter.exTrafficOverview;
            this.generalOverview = adapter.exGeneralOverview;
            this.recreationOverview = adapter.exRecreationOverview;
            this.roomOverview = adapter.exRoomOverview;
            this.conferenceOverview = adapter.exConferenceOverview;
            this.dinnerOverview = adapter.exDinnerOverview;

            this.generalArray = adapter.exGeneranArray;
            this.recreationArray = adapter.exRecreationArray;
            this.roomArray = adapter.exRoomArray;
            this.conferenceArray = adapter.exConferenceArray;
            this.dinnerArray = adapter.exDinnerArray;
        }
コード例 #2
0
        public static ELongHotelDetailAdapter GetHotelDetail(string hotelId)
        {
            ELongHotelDetailAdapter adapter = new ELongHotelDetailAdapter();
            string path = string.Format(PATH_HOTEL_ID_CN, hotelId);
            XmlDocument doc = GetDoc(path);
            XmlNamespaceManager xnm = new XmlNamespaceManager(new XmlDocument().NameTable);
            xnm.AddNamespace("q1", "http://api.elong.com/staticInfo/");
            XmlNode node = doc.SelectSingleNode("q1:HotelDetail", xnm);
            adapter.from(node, xnm, "q1:", "");

            node = doc.SelectSingleNode("q1:HotelDetail/q1:trafficAndAroundInformations/q1:Overview",xnm);
            adapter.exTrafficOverview = node.InnerText;

            node = doc.SelectSingleNode("q1:HotelDetail/q1:trafficAndAroundInformations/q1:TrafficGuide",xnm);
            adapter.exTrafficGuide = node.InnerText;

            node = doc.SelectSingleNode("q1:HotelDetail/q1:generalAmenities/q1:Overview", xnm);
            adapter.exGeneralOverview = node.InnerText;

            XmlNodeList nodes = doc.SelectNodes("q1:HotelDetail/q1:generalAmenities/q1:AmenitySimpleList/q1:string", xnm);
            adapter.exGeneranArray = "";
            foreach (XmlNode n in nodes) {
                adapter.exGeneranArray += n.InnerText+",";
            }
            adapter.exGeneranArray = adapter.exGeneranArray.Trim(',');

            node = doc.SelectSingleNode("q1:HotelDetail/q1:roomAmenities/q1:Overview", xnm);
            adapter.exRoomOverview = node.InnerText;

            nodes = doc.SelectNodes("q1:HotelDetail/q1:roomAmenities/q1:AmenitySimpleList/q1:string", xnm);
            adapter.exRoomArray = "";
            foreach (XmlNode n in nodes)
            {
                adapter.exRoomArray += n.InnerText + ",";
            }
            adapter.exRoomArray = adapter.exRoomArray.Trim(',');

            node = doc.SelectSingleNode("q1:HotelDetail/q1:diningAmenities/q1:Overview", xnm);
            adapter.exDinnerOverview = node.InnerText;

            nodes = doc.SelectNodes("q1:HotelDetail/q1:diningAmenities/q1:AmenitySimpleList/q1:string", xnm);
            adapter.exDinnerArray = "";
            foreach (XmlNode n in nodes)
            {
                adapter.exDinnerArray += n.InnerText + ",";
            }
            adapter.exDinnerArray = adapter.exDinnerArray.Trim(',');

            node = doc.SelectSingleNode("q1:HotelDetail/q1:recreationAmenities/q1:Overview", xnm);
            adapter.exRecreationOverview = node.InnerText;

            nodes = doc.SelectNodes("q1:HotelDetail/q1:recreationAmenities/q1:AmenitySimpleList/q1:string", xnm);
            adapter.exRecreationArray = "";
            foreach (XmlNode n in nodes)
            {
                adapter.exRecreationArray += n.InnerText + ",";
            }
            adapter.exRecreationArray = adapter.exRecreationArray.Trim(',');

            node = doc.SelectSingleNode("q1:HotelDetail/q1:conferenceAmenities/q1:Overview", xnm);
            adapter.exConferenceOverview = node.InnerText;

            nodes = doc.SelectNodes("q1:HotelDetail/q1:conferenceAmenities/q1:AmenitySimpleList/q1:string", xnm);
            adapter.exConferenceArray = "";
            foreach (XmlNode n in nodes)
            {
                adapter.exConferenceArray += n.InnerText + ",";
            }
            adapter.exConferenceArray = adapter.exConferenceArray.Trim(',');

            return adapter;
        }
コード例 #3
0
        public static ELongHotelDetailAdapter GetHotelDetail(string hotelId)
        {
            ELongHotelDetailAdapter adapter = new ELongHotelDetailAdapter();
            string              path        = string.Format(PATH_HOTEL_ID_CN, hotelId);
            XmlDocument         doc         = GetDoc(path);
            XmlNamespaceManager xnm         = new XmlNamespaceManager(new XmlDocument().NameTable);

            xnm.AddNamespace("q1", "http://api.elong.com/staticInfo/");
            XmlNode node = doc.SelectSingleNode("q1:HotelDetail", xnm);

            adapter.from(node, xnm, "q1:", "");

            node = doc.SelectSingleNode("q1:HotelDetail/q1:trafficAndAroundInformations/q1:Overview", xnm);
            adapter.exTrafficOverview = node.InnerText;

            node = doc.SelectSingleNode("q1:HotelDetail/q1:trafficAndAroundInformations/q1:TrafficGuide", xnm);
            adapter.exTrafficGuide = node.InnerText;

            node = doc.SelectSingleNode("q1:HotelDetail/q1:generalAmenities/q1:Overview", xnm);
            adapter.exGeneralOverview = node.InnerText;

            XmlNodeList nodes = doc.SelectNodes("q1:HotelDetail/q1:generalAmenities/q1:AmenitySimpleList/q1:string", xnm);

            adapter.exGeneranArray = "";
            foreach (XmlNode n in nodes)
            {
                adapter.exGeneranArray += n.InnerText + ",";
            }
            adapter.exGeneranArray = adapter.exGeneranArray.Trim(',');

            node = doc.SelectSingleNode("q1:HotelDetail/q1:roomAmenities/q1:Overview", xnm);
            adapter.exRoomOverview = node.InnerText;

            nodes = doc.SelectNodes("q1:HotelDetail/q1:roomAmenities/q1:AmenitySimpleList/q1:string", xnm);
            adapter.exRoomArray = "";
            foreach (XmlNode n in nodes)
            {
                adapter.exRoomArray += n.InnerText + ",";
            }
            adapter.exRoomArray = adapter.exRoomArray.Trim(',');

            node = doc.SelectSingleNode("q1:HotelDetail/q1:diningAmenities/q1:Overview", xnm);
            adapter.exDinnerOverview = node.InnerText;

            nodes = doc.SelectNodes("q1:HotelDetail/q1:diningAmenities/q1:AmenitySimpleList/q1:string", xnm);
            adapter.exDinnerArray = "";
            foreach (XmlNode n in nodes)
            {
                adapter.exDinnerArray += n.InnerText + ",";
            }
            adapter.exDinnerArray = adapter.exDinnerArray.Trim(',');



            node = doc.SelectSingleNode("q1:HotelDetail/q1:recreationAmenities/q1:Overview", xnm);
            adapter.exRecreationOverview = node.InnerText;

            nodes = doc.SelectNodes("q1:HotelDetail/q1:recreationAmenities/q1:AmenitySimpleList/q1:string", xnm);
            adapter.exRecreationArray = "";
            foreach (XmlNode n in nodes)
            {
                adapter.exRecreationArray += n.InnerText + ",";
            }
            adapter.exRecreationArray = adapter.exRecreationArray.Trim(',');

            node = doc.SelectSingleNode("q1:HotelDetail/q1:conferenceAmenities/q1:Overview", xnm);
            adapter.exConferenceOverview = node.InnerText;

            nodes = doc.SelectNodes("q1:HotelDetail/q1:conferenceAmenities/q1:AmenitySimpleList/q1:string", xnm);
            adapter.exConferenceArray = "";
            foreach (XmlNode n in nodes)
            {
                adapter.exConferenceArray += n.InnerText + ",";
            }
            adapter.exConferenceArray = adapter.exConferenceArray.Trim(',');

            return(adapter);
        }