/// <summary> /// 向接口发送请求,返回接口返回的XML /// </summary> /// <param name="SearchXML">要发送到接口的XML</param> /// <param name="ErrModel">请求错误信息</param> /// <returns>接口返回的XML</returns> private string GetResponseXML(string SearchXML, out HotelBI.ErrorInfo ErrModel) { ErrModel = null; if (string.IsNullOrEmpty(SearchXML)) { return(string.Empty); } string strXML = HotelBI.Utils.CreateRequest(SearchXML); ErrModel = HotelBI.Utils.ResponseErrorHandling(strXML); if (ErrModel.ErrorType != EyouSoft.HotelBI.ErrorType.None) { return(string.Empty); } return(strXML); }
/// <summary> /// 获取本地缓存酒店信息集合 /// </summary> /// <param name="searchInfo">查询信息</param> /// <param name="pageInfo">分页信息</param> /// <param name="errInfo">错误信息</param> /// <returns></returns> private IList <EyouSoft.Model.HotelStructure.HotelInfo> GetLocalCacheHotels(HotelBI.MultipleSeach searchInfo, EyouSoft.Model.HotelStructure.RespPageInfo pageInfo, out HotelBI.ErrorInfo errInfo) { errInfo = new EyouSoft.HotelBI.ErrorInfo(); IList <EyouSoft.Model.HotelStructure.HotelInfo> items = null; EyouSoft.Model.HotelStructure.MLocalHotelSearchInfo localSearchInfo = new EyouSoft.Model.HotelStructure.MLocalHotelSearchInfo(); localSearchInfo.BedType = searchInfo.BedType; localSearchInfo.CheckInDate = EyouSoft.Common.Utility.GetDateTime(searchInfo.CheckInDate); localSearchInfo.CheckOutDate = EyouSoft.Common.Utility.GetDateTime(searchInfo.CheckOutDate); localSearchInfo.CityCode = searchInfo.CityCode; localSearchInfo.Fitment = searchInfo.Fitment; localSearchInfo.HotelName = searchInfo.HotelChineseName; localSearchInfo.HotelNameEn = searchInfo.HotelEnglishName; //localSearchInfo.SpecialRoomName = searchInfo.RoomView; localSearchInfo.SpecialRoomName = searchInfo.RoomName; localSearchInfo.LandMarkName = searchInfo.LandMark; localSearchInfo.District = searchInfo.District; localSearchInfo.OrderBy = searchInfo.OrderBy; localSearchInfo.PriceMaxRate = searchInfo.PriceMaxRate; localSearchInfo.PriceMinRate = searchInfo.PriceMinRate; if (searchInfo.HotelRank != HotelRankEnum._00) { localSearchInfo.Rank = searchInfo.HotelRank.ToString().Replace("_", ""); } if (searchInfo.Internet != BoolEnum.none) { localSearchInfo.IsInternet = searchInfo.Internet == BoolEnum.Y ? true : false; } int pageSize = pageInfo.PageSize; int pageIndex = pageInfo.CurrentPage; int recordCount = pageInfo.TotalNum; items = dal.GetHotels(pageSize, pageIndex, ref recordCount, localSearchInfo); pageInfo.TotalNum = recordCount; return(items); }
/// <summary> /// 获取某酒店信息 /// </summary> /// <param name="QueryModel">单酒店查询实体</param> /// <param name="ErrModel">请求错误信息</param> /// <returns>酒店信息实体</returns> public EyouSoft.Model.HotelStructure.HotelInfo GetHotelModel(HotelBI.SingleSeach QueryModel, out HotelBI.ErrorInfo ErrModel) { ErrModel = null; if (QueryModel == null) { return(null); } return(GetHotelModelByXML(GetResponseXML(QueryModel.SingleRequestXML, out ErrModel))); }
/// <summary> /// 获取酒店集合 /// </summary> /// <param name="QueryModel">酒店查询实体</param> /// <param name="RespPageInfo">酒店查询返回的分页信息</param> /// <param name="ErrModel">请求错误信息</param> /// <returns>酒店实体集合</returns> public IList <EyouSoft.Model.HotelStructure.HotelInfo> GetHotelList(HotelBI.MultipleSeach QueryModel, ref EyouSoft.Model.HotelStructure.RespPageInfo RespPageInfo, out HotelBI.ErrorInfo ErrModel) { ErrModel = null; if (QueryModel == null) { return(null); } RespPageInfo = RespPageInfo ?? new EyouSoft.Model.HotelStructure.RespPageInfo() { CurrentPage = 1, PageSize = 10, TotalNum = 0, TotalPageNum = 0 }; RespPageInfo.CurrentPage = QueryModel.PageNo; RespPageInfo.PageSize = QueryModel.NumOfEachPage; return(this.GetLocalCacheHotels(QueryModel, RespPageInfo, out ErrModel)); //return GetHotelListByXML(GetResponseXML(QueryModel.MultiRequestXML, out ErrModel), ref RespPageInfo); }