Ejemplo n.º 1
0
        public ActionResult GetTodayLowPrice()
        {
            List <TodayLowPriceDto> data = null;
            var li = localtionService.GetLocationInfo();

            if (li != null)
            {
                var cityId = cityService.GetUnionCityIdByName(string.IsNullOrEmpty(li.City) ? "深圳" : li.City);
                if (cityId > 0)
                {
                    data = todayLowPriceService.GetUnionTodayLowPriceByCityIdAndType(cityId.ToString(), "0", true, 5);
                }
            }
            return(View("RightTodayLowPrice", data));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the hotel search model.
 /// </summary>
 /// <param name="intime">The intime.</param>
 /// <param name="cidName">Name of the cid.</param>
 /// <param name="key">The key.</param>
 /// <param name="pi">The pi.</param>
 /// <param name="price1">The price1.</param>
 /// <param name="price2">The price2.</param>
 /// <param name="type">The type.</param>
 /// <param name="order">The order.</param>
 /// <returns></returns>
 public iPow.Application.Union.Dto.SearchHotelDto GetHotelSearchModel(string intime, string cidName, string key,
                                                                      string pi = "1", string price1 = "0", string price2 = "0", string type = "0", string order = "0")
 {
     iPow.Application.Union.Dto.SearchHotelDto data = null;
     if (!string.IsNullOrEmpty(intime) && !string.IsNullOrEmpty(cidName) &&
         !string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(pi) &&
         !string.IsNullOrEmpty(price1) && !string.IsNullOrEmpty(price2) &&
         !string.IsNullOrEmpty(type) && !string.IsNullOrEmpty(order))
     {
         var cid = cityService.GetUnionCityIdByName(cidName.Replace("市", ""));
         if (cid > 0)
         {
             Config.IUnionConfig fig     = Config.ConfigManager.GetConfigProvider();
             UnionDataUrlBase    dataUrl = new DataUrl.Default.HotelSearchDefaultService(fig);
             dataUrl.UrlParas.Add("t1", intime);
             dataUrl.UrlParas.Add("cid", cid.ToString());
             dataUrl.UrlParas.Add("jdlx", type);
             dataUrl.UrlParas.Add("px", order);
             dataUrl.UrlParas.Add("key_name", key);
             dataUrl.UrlParas.Add("pg", pi);
             dataUrl.UrlParas.Add("p1", price1);
             dataUrl.UrlParas.Add("p2", price2);
             iPow.Infrastructure.Crosscutting.Function.WebHttpHelper
                 req = new Infrastructure.Crosscutting.Function.WebHttpHelper();
             var url = dataUrl.GetUrl();
             try
             {
                 var dataStr = req.WebRequest(iPow.Infrastructure.Crosscutting.Function.HttpMethod.GET, url.AbsoluteUri, "");
                 if (dataStr != null && dataStr != "")
                 {
                     data = Newtonsoft.Json.JsonConvert.DeserializeObject <iPow.Application.Union.Dto.SearchHotelDto>(dataStr);
                 }
             }
             catch (Exception ex)
             {
                 iPow.Infrastructure.Data.LoggerReopsitoryManager.AddLogInfo(1, 0,
                                                                             iPow.Infrastructure.Crosscutting.Function.StringHelper.GetCurrentUrl(),
                                                                             iPow.Infrastructure.Crosscutting.Function.StringHelper.GetReferrerUrl(),
                                                                             "酒店搜索", ex.Message,
                                                                             iPow.Infrastructure.Crosscutting.Function.StringHelper.GetRealIP());
             }
         }
     }
     return(data);
 }
Ejemplo n.º 3
0
        /// <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);
        }