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; }
public IList<HotelDetailModel> queryHotelList(HotelDetailModel hotel) { if (!this.login()) { return new List<HotelDetailModel>(); } GetHotelListRequest req = new GetHotelListRequest(); req.RequestHead = this.requestHead; req.GetHotelCondition.HotelId = hotel.id; req.GetHotelCondition.RoomTypeID = ""; GetHotelListResponse res= elongService.GetHotelList(req); return null; }