Пример #1
0
        public void ImportGeoLocationList()
        {
            IList <ELongGeoLocationAdapter> locals = ELongStaticClient.GetGeoLocationList();

            this.OpenSession();
            ITransaction tx = this.session.BeginTransaction();

            foreach (ELongGeoLocationAdapter local in locals)
            {
                System.Console.WriteLine(string.Format("{0}:{1}:{2}:{3}", local.exType, local.exGeoId, local.id, local.name));
                if (local.exType == ELongStaticClient.GEO_LOCATION_COMMERCIAL)
                {
                    GeoCommercialLocationModel temp = new GeoCommercialLocationModel();
                    temp.from(local);
                    this.session.SaveOrUpdate(temp);
                }
                else if (local.exType == ELongStaticClient.GEO_LOCATION_DISTRICTS)
                {
                    GeoDistrictsModel temp = new GeoDistrictsModel();
                    temp.from(local);
                    this.session.SaveOrUpdate(temp);
                }
                else if (local.exType == ELongStaticClient.GEO_LOCATION_LANDMARK)
                {
                    GeoLandmarkLocationModel temp = new GeoLandmarkLocationModel();
                    temp.from(local);
                    this.session.SaveOrUpdate(temp);
                }
            }
            tx.Commit();
            this.CloseSession();
        }
Пример #2
0
 public void fromYiLong(ELongHotelAdapter hotel)
 {
     this.hotelId     = hotel.Hotel_id;
     this.hotelName   = hotel.Hotel_name;
     this.hotelNameEn = hotel.Hotel_name_en;
     this.addTime     = ELongStaticClient.ParseDateTime(hotel.Addtime);
     this.delTime     = ELongStaticClient.ParseDateTime(hotel.DelTime);
     this.modifyTime  = ELongStaticClient.ParseDateTime(hotel.Modifytime);
     this.isreserve   = ObjectUtil.Parse(hotel.Isreserve, RESERVE_DELETED);
 }
Пример #3
0
        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;
        }
Пример #4
0
 public void from(ELongBrandAdapter brand)
 {
     this.brandID          = brand.brandID;
     this.groupID          = brand.groupId;
     this.brandName        = brand.brandName;
     this.brandNameLong    = brand.brandNameLong;
     this.brandFirstLetter = brand.brandFirstletter;
     this.brandPinYin      = brand.brandPinYin;
     this.picURL           = brand.picURL;
     this.brandURL         = brand.brandURL;
     this.hotelCount       = ObjectUtil.ParseInt(brand.hotelCount, 0);
     this.lastChangetime   = ELongStaticClient.ParseDateTime(brand.lastChangetime);
 }
Пример #5
0
        public void ImportHotelList()
        {
            IList <ELongHotelAdapter> hotels = ELongStaticClient.GetHotelList();

            this.OpenSession();
            ITransaction tx = this.session.BeginTransaction();

            foreach (ELongHotelAdapter hotel in hotels)
            {
                HotelModel hm = new HotelModel();
                hm.fromYiLong(hotel);
                this.session.SaveOrUpdate(hm);
            }
            tx.Commit();
        }
Пример #6
0
        public void ImportDictList()
        {
            IList <ELongBaseCodeAdapter> basecodes = ELongStaticClient.GetBaseCodeList();

            //this.OpenSession();
            // ITransaction tx = this.session.BeginTransaction();
            foreach (ELongBaseCodeAdapter basecode in basecodes)
            {
                DictModel dict = new DictModel();
                dict.from(basecode);
                System.Console.WriteLine(string.Format("{0}:{1}:{2}", dict.type, dict.text, dict.value));
                BaseZdBiz.SaveOrUpdate(dict, "");
            }
            //tx.Commit();
        }
Пример #7
0
        public void ImportGeoList()
        {
            IList <ELongGeoAdapter> Geos = ELongStaticClient.GetGeoList();

            this.OpenSession();
            ITransaction tx = this.session.BeginTransaction();

            foreach (ELongGeoAdapter geo in Geos)
            {
                GeoModel temp = new GeoModel();
                temp.from(geo);
                System.Console.WriteLine(string.Format("{0}:{1}:{2}:{3}", temp.id, temp.provinceName, temp.cityName, temp.url));
                this.session.SaveOrUpdate(temp);
            }
            tx.Commit();
        }
Пример #8
0
        public void ImportBrandList()
        {
            IList <ELongBrandAdapter> brands = ELongStaticClient.GetBrandList();

            this.OpenSession();
            ITransaction tx = this.session.BeginTransaction();

            foreach (ELongBrandAdapter brand in brands)
            {
                BrandModel temp = new BrandModel();
                temp.from(brand);
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}:{3}", temp.brandID, temp.brandNameLong, temp.groupID, temp.lastChangetime.ToString()));
                this.session.SaveOrUpdate(temp);
            }
            tx.Commit();
        }
Пример #9
0
        public JsResultObject ImportHotelDetail(string hotelId, bool hasSubInfo)
        {
            JsResultObject re = new JsResultObject();

            ELongHotelDetailAdapter adapter = ELongStaticClient.GetHotelDetail(hotelId);
            HotelDetailModel        hotel   = new HotelDetailModel();

            hotel.from(adapter);
            System.Console.WriteLine(string.Format("{0}:{1}:{2}", hotel.country, hotel.city, hotel.name));
            re = BaseZdBiz.SaveOrUpdate(hotel, "");


            if (!hasSubInfo)
            {
                return(re);
            }

            IList <ELongHotelImageAdapter> images = ELongStaticClient.GetHotelImageList(hotelId);

            foreach (ELongHotelImageAdapter image in images)
            {
                HotelImageModel temp = new HotelImageModel();
                temp.setPk(temp.createPk());
                temp.from(image);
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.title, temp.imgUrl));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }



            IList <ELongHotelRoomAdapter> rooms = ELongStaticClient.GetHotelRoomList(hotelId);

            foreach (ELongHotelRoomAdapter room in rooms)
            {
                HotelRoomModel temp = new HotelRoomModel();
                temp.setPk(temp.createPk());
                temp.from(room);
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.roomName, temp.area));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }

            ELongHotelFeatureInfoAdapter featureInfo           = ELongStaticClient.GetHotelFeatureInfo(hotelId);
            HotelFeatrueInfoModel        hotelFeatrueInfoModel = new HotelFeatrueInfoModel();

            hotelFeatrueInfoModel.from(featureInfo);
            re.rowNum += BaseZdBiz.SaveOrUpdate(hotelFeatrueInfoModel, "").rowNum;


            IList <ELongHotelLandMarkAdapter> landmarks = ELongStaticClient.GetHotelLandMarkList(hotelId);

            foreach (ELongHotelLandMarkAdapter landmark in landmarks)
            {
                HotelLandMarkModel temp = new HotelLandMarkModel();
                temp.setPk(temp.createPk());
                temp.from(landmark);
                temp.id = temp.createPk().ToString();
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.roomName, temp.area));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }

            IList <ElongHotelSurroundingAttractionAdapter> attractions = ELongStaticClient.GetHotelSurroundingAttractionList(hotelId);

            foreach (ElongHotelSurroundingAttractionAdapter attraction in attractions)
            {
                HotelSurroundingAttractionModel temp = new HotelSurroundingAttractionModel();
                temp.setPk(temp.createPk());
                temp.from(attraction);
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.roomName, temp.area));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }

            IList <ELongHotelSurroundingCommerceAdapter> commerces = ELongStaticClient.GetHotelSurroundingCommerceList(hotelId);

            foreach (ELongHotelSurroundingCommerceAdapter commerce in commerces)
            {
                HotelSurroundingCommerceModel temp = new HotelSurroundingCommerceModel();
                temp.setPk(temp.createPk());
                temp.from(commerce);
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.roomName, temp.area));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }

            IList <ElongHotelSurroundingRestaurantAdapter> restaurants = ELongStaticClient.GetHotelSurroundingRestaurantList(hotelId);

            foreach (ElongHotelSurroundingRestaurantAdapter restaurant in restaurants)
            {
                HotelSurroundingRestaurantModel temp = new HotelSurroundingRestaurantModel();
                temp.setPk(temp.createPk());
                temp.from(restaurant);
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.roomName, temp.area));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }

            IList <ElongHotelSurroundingShopAdapter> shops = ELongStaticClient.GetHotelSurroundingShopList(hotelId);

            foreach (ElongHotelSurroundingShopAdapter shop in shops)
            {
                HotelSurroundingShopModel temp = new HotelSurroundingShopModel();
                temp.setPk(temp.createPk());
                temp.from(shop);
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.roomName, temp.area));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }


            IList <ElongHotelTrafficInfoAdapter> traffics = ELongStaticClient.GetHotelTrafficInfoList(hotelId);

            foreach (ElongHotelTrafficInfoAdapter traffic in traffics)
            {
                HotelTrafficInfoModel temp = new HotelTrafficInfoModel();

                temp.from(traffic);
                temp.id = temp.createPk().ToString();
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.roomName, temp.area));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }


            return(re);
        }