/// <summary> /// Gets the map union hotel info by tour id and day. /// </summary> /// <param name="id">The id.</param> /// <param name="day">The day.</param> /// <returns></returns> public iPow.Application.Union.Dto.SearchHotelDto GetMapUnionHotelInfoByTourIdAndDay(int id, int day) { iPow.Application.Union.Dto.SearchHotelDto data = new Union.Dto.SearchHotelDto(); data.hotel_list = new List <Union.Dto.SearchHotelDetailDto>(); data.page = 0; data.total = 0; var trueSightList = GetSightOrHotelIdList(id, "sight", day); if (trueSightList.Count > 0) { var cityName = ""; var cid = 0; for (int i = 0; i < trueSightList.Count; i++) { if (trueSightList[i] > 0) { var temp = sightInfoService.GetSightSingleById(trueSightList[i]); cityName = temp.City.Replace("市", ""); cid = unionCityService.GetUnionCityIdByName(cityName); if (cid > 0 && temp.Latitude > 0 && temp.Longitude > 0) { var intime = System.DateTime.Now.ToString("yyyy-MM-dd").Replace("-", "_"); string latlon = ""; string strMin = "0"; string strMax = "0"; latlon = "(" + temp.Latitude.ToString() + "," + temp.Longitude.ToString() + ")"; var cirHotelInfoList = hotelLeftMidService.GetMidHotHotelByLatLong(intime, cityName, System.Web.HttpUtility.UrlEncode(latlon), "1", strMin, strMax); if (cirHotelInfoList != null && cirHotelInfoList.hotel_list.Count > 0) { data.total += cirHotelInfoList.total; data.hotel_list.AddRange(cirHotelInfoList.hotel_list); } } } } data.page = (data.hotel_list.Count / 10) == 0 ? (data.hotel_list.Count / 10) : (data.hotel_list.Count / 10) + 1; } return(data); }
/// <summary> /// Gets the map union hotel info by tour id and day. /// </summary> /// <param name="id">The id.</param> /// <param name="day">The day.</param> /// <returns></returns> public iPow.Application.Union.Dto.SearchHotelDto GetMapUnionHotelInfoByTourIdAndDay(int id, int day) { iPow.Application.Union.Dto.SearchHotelDto data = new Union.Dto.SearchHotelDto(); data.hotel_list = new List<Union.Dto.SearchHotelDetailDto>(); data.page = 0; data.total = 0; var trueSightList = GetSightOrHotelIdList(id, "sight", day); if (trueSightList.Count > 0) { var cityName = ""; var cid = 0; for (int i = 0; i < trueSightList.Count; i++) { if (trueSightList[i] > 0) { var temp = sightInfoService.GetSightSingleById(trueSightList[i]); cityName = temp.City.Replace("市", ""); cid = unionCityService.GetUnionCityIdByName(cityName); if (cid > 0 && temp.Latitude > 0 && temp.Longitude > 0) { var intime = System.DateTime.Now.ToString("yyyy-MM-dd").Replace("-", "_"); string latlon = ""; string strMin = "0"; string strMax = "0"; latlon = "(" + temp.Latitude.ToString() + "," + temp.Longitude.ToString() + ")"; var cirHotelInfoList = hotelLeftMidService.GetMidHotHotelByLatLong(intime, cityName, System.Web.HttpUtility.UrlEncode(latlon), "1", strMin, strMax); if (cirHotelInfoList != null && cirHotelInfoList.hotel_list.Count > 0) { data.total += cirHotelInfoList.total; data.hotel_list.AddRange(cirHotelInfoList.hotel_list); } } } } data.page = (data.hotel_list.Count / 10) == 0 ? (data.hotel_list.Count / 10) : (data.hotel_list.Count / 10) + 1; } return data; }