// // GET: /Hotel/ public ActionResult Detail(string hotelId) { HotelDetailModel hotelDetail = BaseZdBiz.Load <HotelDetailModel>(hotelId); ViewData[typeof(HotelDetailModel).Name] = hotelDetail; HotelFeatrueInfoModel hotelFi = BaseZdBiz.Load <HotelFeatrueInfoModel>(hotelId); ViewData[typeof(HotelFeatrueInfoModel).Name] = hotelFi; HotelModel hotel = BaseZdBiz.Load <HotelModel>(hotelId); ViewData[typeof(HotelModel).Name] = hotel; ICriteria icr = BaseZdBiz.CreateCriteria <HotelImageModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelId)); IList <HotelImageModel> images = icr.List <HotelImageModel>(); ViewData[typeof(HotelImageModel).Name] = images; GeoBiz geoBiz = GeoBiz.GetInstant(); GeoModel geo = geoBiz.GetGeoByCityId(hotelDetail.city); this.VdGeoLocation(geo); icr = BaseZdBiz.CreateCriteria <HotelLandMarkModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id)); IList <HotelLandMarkModel> hotelLls = icr.List <HotelLandMarkModel>(); ViewData[typeof(HotelLandMarkModel).Name] = hotelLls; icr = BaseZdBiz.CreateCriteria <HotelSurroundingAttractionModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id)); IList <HotelSurroundingAttractionModel> hotelSas = icr.List <HotelSurroundingAttractionModel>(); ViewData[typeof(HotelSurroundingAttractionModel).Name] = hotelSas; icr = BaseZdBiz.CreateCriteria <HotelSurroundingCommerceModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id)); IList <HotelSurroundingCommerceModel> hotelScs = icr.List <HotelSurroundingCommerceModel>(); ViewData[typeof(HotelSurroundingCommerceModel).Name] = hotelScs; icr = BaseZdBiz.CreateCriteria <HotelSurroundingRestaurantModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id)); IList <HotelSurroundingRestaurantModel> hotelSrs = icr.List <HotelSurroundingRestaurantModel>(); ViewData[typeof(HotelSurroundingRestaurantModel).Name] = hotelSrs; icr = BaseZdBiz.CreateCriteria <HotelSurroundingShopModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id)); IList <HotelSurroundingShopModel> hotelSss = icr.List <HotelSurroundingShopModel>(); ViewData[typeof(HotelSurroundingShopModel).Name] = hotelSss; icr = BaseZdBiz.CreateCriteria <HotelTrafficInfoModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id)); IList <HotelTrafficInfoModel> hotelTrs = icr.List <HotelTrafficInfoModel>(); ViewData[typeof(HotelTrafficInfoModel).Name] = hotelTrs; icr = BaseZdBiz.CreateCriteria <HotelCommentModel>(new PagerObject(1, 5)); icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id)); icr.AddOrder(Order.Desc("createDate")); IList <HotelCommentModel> hotelComments = icr.List <HotelCommentModel>(); ViewData[typeof(HotelCommentModel).Name] = hotelComments; PageSeoModel seo = PublicBiz.getCurPageSeo(); this.setPageDesc(string.Format(seo.hotelDetailDesc, hotel.hotelId, hotel.hotelName, hotelDetail.address, hotelDetail.description, geo.cityCode, geo.cityName)); this.setPageKeyWords(string.Format(seo.hotelDetailKeywords, hotel.hotelId, hotel.hotelName, hotelDetail.address, hotelDetail.description, geo.cityCode, geo.cityName)); this.VdHotCity(15); return(View()); }
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); }