public PartialViewResult Index(string ids, int?min, int?max) { iPow.Application.Union.Dto.SearchHotelDto data = null; int id = Int32.Parse(ids); var res = sightInfoService.GetSightSingleById(id); if (res != null && res.Latitude != null && res.Longitude != null) { var intime = System.DateTime.Now.ToString("yyyy-MM-dd").Replace("-", "_"); string cityName = "深圳"; string latlon = ""; string strMin = "0"; string strMax = "0"; if (min != null) { strMin = min.ToString(); } if (max != null) { strMax = max.ToString(); } cityName = res.City.Replace("市", ""); latlon = "(" + res.Latitude.ToString() + "," + res.Longitude.ToString() + ")"; data = hoteLeftMidService.GetMidHotHotelByLatLong(intime, cityName, Server.UrlEncode(latlon), "1", strMin, strMax); } return(PartialView(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); }
/// <summary> /// Initializes a new instance of the <see cref="PicModel"/> class. /// 景区Id号,和游记攻略Id号 /// </summary> /// <param name="sightId">The sight id.</param> /// <param name="id">The id.</param> /// <returns></returns> public ArticleDetailDto GetArticleDetailModel(int?sightId, int?id) { ArticleDetailDto data = new ArticleDetailDto(); data.ArticleInfo = GetArticleSingleById(id); if (data.ArticleInfo != null) { data.ArticleInfo.VisitCount += 1; try { articleInfoRepository.Uow.Commit(); } catch { } data.ArticleType = GetArticleClassById(data.ArticleInfo.ClassID); var sightDto = sightInfoService.GetSightSingleById(sightId); //var sightDto = AutoMapper.Mapper.Map<iPow.Infrastructure.Data.DataSys.Sys_SightInfo // ,iPow.Domain.Dto.Sys_SightInfoDto>(sight); data.SightInfo = sightDto; if (data.SightInfo != null) { data.SightClass = sightInfoService.GetSightClassById(data.SightInfo.ClassID); #region sight cir var sightCir = data.SightInfo.CirParkID; if (sightCir != null) { sightCir = (sightCir.Length > 1 && (sightCir.LastIndexOf(',') == 0)) ? sightCir.Substring(0, sightCir.Length - 1) : sightCir; string[] cirStrArray = sightCir.Split(','); List <int> cirList = new List <int>(); for (int i = 0; i < cirStrArray.Length; i++) { int temp = 0; int.TryParse(cirStrArray[i], out temp); if (temp != 0) { cirList.Add(temp); } } data.CirSightInfoList = sightInfoService.GetCirSightListBySight(data.SightInfo, 9); } if (data.CirSightInfoList == null) { data.CirSightInfoList = new List <iPow.Domain.Dto.Sys_SightInfoDto>(); } data.CirSightInfoList.Insert(0, data.SightInfo); #endregion #region hotel cir //新版的酒店,数据写在页面上,所以不要这个字段了 //edited by yjihrp 2011.11.25.14.54 //var hotelCir = data.SightInfo.CirHotelID; //if (hotelCir != null) //{ // hotelCir = (hotelCir.Length > 1 && (hotelCir.LastIndexOf(',') == 0)) ? hotelCir.Substring(0, hotelCir.Length - 1) : hotelCir; // string[] cirStrArray = hotelCir.Split(','); // List<int?> cirList = new List<int?>(); // for (int i = 0; i < cirStrArray.Length; i++) // { // int temp = 0; // int.TryParse(cirStrArray[i], out temp); // if (temp != 0) // { cirList.Add(temp); } // } // data.CirHotelInfoList = Bll.SightInfo.GetCirHotelListBySight(data.SightInfo, 10); //} //end edited by yjihrp 2011.11.25.14.54 #endregion } } return(data); }