/// <summary> /// 列表数据初始化 /// </summary> /// <param name="searchModel"></param> private void ListDataInit(EyouSoft.HotelBI.MultipleSeach searchModel) { EyouSoft.Model.HotelStructure.RespPageInfo pageInfoModel = null; EyouSoft.HotelBI.ErrorInfo errorModel = new EyouSoft.HotelBI.ErrorInfo(); IList <EyouSoft.Model.HotelStructure.HotelInfo> list = EyouSoft.BLL.HotelStructure.Hotel.CreateInstance().GetHotelList(searchModel, ref pageInfoModel, out errorModel); //如果接口查询异常 则提示 查询超时 if (errorModel == null || errorModel.ErrorType == EyouSoft.HotelBI.ErrorType.未知错误 || errorModel.ErrorType == EyouSoft.HotelBI.ErrorType.系统级错误) { //提示查询超时 this.lblMsg.Text = "查询超时,请重新查询或稍后再试."; //不显示分页控件 this.ExportPageInfo.Visible = false; return; } if (list != null) { if (list.Count > 0) { this.rpt_list.DataSource = list; this.rpt_list.DataBind(); if (pageInfoModel != null) { recordCount = pageInfoModel.TotalNum; } BindPage(); } else { //提示没有查询到酒店 this.lblMsg.Text = "未找到相关酒店,建议您修改相关查询条件后再查询."; this.ExportPageInfo.Visible = false; } } else { //提示没有查询到酒店 this.lblMsg.Text = "未找到相关酒店,建议您修改相关查询条件后再查询."; this.ExportPageInfo.Visible = false; } list = null; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region 获得参数 //城市三字码 string cityCode = Utils.GetQueryStringValue("cityCode"); //入住日期 inTime = Utils.GetQueryStringValue("inTime"); //离开日期 leaveTime = Utils.GetQueryStringValue("leaveTime"); //开始价格 decimal?priceBegin = Utils.GetDecimal(Utils.GetQueryStringValue("priceBegin")); //结束价格 decimal?priceEnd = Utils.GetDecimal(Utils.GetQueryStringValue("priceEnd")); //地理位置 string landMark = Utils.GetQueryStringValue("landMark"); string LandMarkTxt = Utils.GetQueryStringValue("LandMarkTxt"); //酒店星级 string hotelLevel = Utils.GetQueryStringValue("hotelLevel"); if (hotelLevel == null || hotelLevel == "") { hotelLevel = "0"; } //即时确认 string instant = Utils.GetQueryStringValue("instant"); //接机服务 string service = Utils.GetQueryStringValue("service"); //上网设施 string internet = Utils.GetQueryStringValue("internet"); //装修时间 string decoration = Utils.GetQueryStringValue("decoration"); //特殊房型 string special = Utils.GetQueryStringValue("special"); //床型 string bed = Utils.GetQueryStringValue("bed"); //行政区域 string district = Utils.GetQueryStringValue("district"); string districtTxt = Utils.GetQueryStringValue("districtTxt"); //查询方式 string searchWay = Utils.GetQueryStringValue("searchWay"); //酒店名称 string hotelName = Utils.GetQueryStringValue("hotelName"); //排序 string sort = Utils.GetQueryStringValue("sort"); //设置城市 CityId = Utils.GetInt(Utils.GetQueryStringValue("CityId")); //点击登录时返回的URL returnUrl = Utils.GetQueryStringValue("returnUrl"); #endregion #region 为查询MODEL赋值 EyouSoft.HotelBI.MultipleSeach searchModel = new EyouSoft.HotelBI.MultipleSeach(); // searchModel.AvailReqType = EyouSoft.HotelBI.AvailReqTypeEnum.includeStatic; searchModel.RoomTypeDetailShowed = true; searchModel.CityCode = cityCode; searchModel.CheckInDate = inTime; searchModel.CheckOutDate = leaveTime; if (priceBegin > 0) { searchModel.PriceMinRate = priceBegin; } if (priceEnd > 0) { searchModel.PriceMaxRate = priceEnd; } if (landMark != "") { searchModel.LandMark = Server.UrlDecode(LandMarkTxt); } searchModel.HotelRank = (EyouSoft.HotelBI.HotelRankEnum)Enum.Parse(typeof(EyouSoft.HotelBI.HotelRankEnum), hotelLevel); searchModel.District = Server.UrlDecode(districtTxt); if (hotelName != "") { searchModel.HotelChineseName = hotelName; } if (instant == "1") { searchModel.ConfirmRightNowIndicator = true; } else { searchModel.ConfirmRightNowIndicator = false; } if (service == "1") { searchModel.AirReception = EyouSoft.HotelBI.BoolEnum.Y; } else { searchModel.AirReception = EyouSoft.HotelBI.BoolEnum.none; } if (internet == "1") { searchModel.Internet = EyouSoft.HotelBI.BoolEnum.Y; } else { searchModel.Internet = EyouSoft.HotelBI.BoolEnum.none; } searchModel.Fitment = decoration; searchModel.RoomName = special; searchModel.BedType = bed; #region 设置页面排序 EyouSoft.HotelBI.HotelOrderBy hotelSort; switch (sort) { case "": hotelSort = EyouSoft.HotelBI.HotelOrderBy.Default; break; case "1": hotelSort = EyouSoft.HotelBI.HotelOrderBy.PRICEHTL; break; case "2": hotelSort = EyouSoft.HotelBI.HotelOrderBy.PRICELTH; break; case "3": hotelSort = EyouSoft.HotelBI.HotelOrderBy.STARHTL; break; default: hotelSort = EyouSoft.HotelBI.HotelOrderBy.STARLTH; break; } searchModel.OrderBy = hotelSort; #endregion //设置分页 searchModel.IsPageView = true; searchModel.NumOfEachPage = 10; //设置当前页 pageIndex = Utils.GetInt(Request.QueryString["Page"], 1); searchModel.PageNo = pageIndex; #endregion //酒店初始化列表 ListDataInit(searchModel); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!CheckMasterGrant(YuYingPermission.酒店后台管理_首页板块数据管理)) { Utils.ResponseNoPermit(YuYingPermission.酒店后台管理_首页板块数据管理, true); return; } pageIndex = Utils.GetInt(Request.QueryString["page"], 1); int recordCount = 0; int dataType = Utils.GetInt(Request.QueryString["datatype"], -1); //数据类型 string InTime = Request.QueryString["CheckInDate"]; //入住日期 string OutTime = Request.QueryString["CheckOutDate"]; //离店日趋 string City = Utils.GetQueryStringValue("City"); //城市 int StarNum = Utils.GetInt(Request.QueryString["StarNum"], 0); //星级 int SelectType = Utils.GetInt(Request.QueryString["SelectType"], 0); //选择类型 string HotelName = Utils.GetQueryStringValue("HotelName"); // HotelShowType = Utils.GetInt(Request.QueryString["HotelShowType"], 0); if (!StringValidate.IsDateTime(InTime)) { Utils.ResponseMeg(false, "入住日期格式错误!"); return; } if (!StringValidate.IsDateTime(OutTime)) { Utils.ResponseMeg(false, "离店日期格式错误!"); return; } if (Convert.ToDateTime(InTime) > Convert.ToDateTime(OutTime)) { Utils.ResponseMeg(false, "入住日期和离店日期范围填写错误!"); return; } decimal?MinPrice = null; //价格范围 decimal?MaxPrice = null; string price = Utils.GetQueryStringValue("MinPrice"); if (!string.IsNullOrEmpty(price)) { if (StringValidate.IsDecimal(price)) { MinPrice = Convert.ToDecimal(price); } else { Utils.ResponseMeg(false, "价格下限输入错误!"); return; } } price = Utils.GetQueryStringValue("MaxPrice"); if (!string.IsNullOrEmpty(price)) { //price = price.ToString("F2"); if (StringValidate.IsDecimal(price)) { MaxPrice = Convert.ToDecimal(price); } else { Utils.ResponseMeg(false, "价格上限输入错误!"); return; } } //IList<EyouSoft.Model.HotelStructure.HotelInfo> list = EyouSoft.BLL.HotelStructure.HotelLocalInfo.CreateInstance().GetList(pageSize, pageIndex, ref recordCount, (EyouSoft.Model.HotelStructure.HotelShowType)Enum.Parse(typeof(EyouSoft.Model.HotelStructure.hotelshow), dataType)); EyouSoft.HotelBI.MultipleSeach searchModel = new EyouSoft.HotelBI.MultipleSeach(); searchModel.CheckInDate = InTime; searchModel.CheckOutDate = OutTime; searchModel.CityCode = City; searchModel.HotelChineseName = HotelName; searchModel.HotelRank = (EyouSoft.HotelBI.HotelRankEnum)StarNum; searchModel.IsPageView = true; searchModel.NumOfEachPage = 20; searchModel.PageNo = pageIndex; if (SelectType == 1) { // searchModel.Payment = "T"; //前台现付 } searchModel.PriceMaxRate = MaxPrice; searchModel.PriceMinRate = MinPrice; EyouSoft.Model.HotelStructure.RespPageInfo respPageInfo = null; EyouSoft.HotelBI.ErrorInfo errorModel = new EyouSoft.HotelBI.ErrorInfo(); IList <EyouSoft.Model.HotelStructure.HotelInfo> HotelList = EyouSoft.BLL.HotelStructure.Hotel.CreateInstance().GetHotelList(searchModel, ref respPageInfo, out errorModel); //如果接口查询异常 则提示 查询超时 if (errorModel == null || errorModel.ErrorType == EyouSoft.HotelBI.ErrorType.未知错误 || errorModel.ErrorType == EyouSoft.HotelBI.ErrorType.系统级错误) { Response.Clear(); Response.Write("查询超时,请重新查询或稍后再试."); Response.End(); return; } hidInterHotel.Value = JsonConvert.SerializeObject(HotelList); if (HotelList != null && HotelList.Count > 0) { this.ExporPageInfoSelect1.intPageSize = pageSize; this.ExporPageInfoSelect1.intRecordCount = respPageInfo != null?respPageInfo.TotalNum:recordCount; this.ExporPageInfoSelect1.CurrencyPage = pageIndex; this.ExporPageInfoSelect1.HrefType = Adpost.Common.ExporPage.HrefTypeEnum.JsHref; this.ExporPageInfoSelect1.AttributesEventAdd("onclick", "FirstPageDataAdd.LoadData(this,\"AjaxInterfaceData.aspx\");", 1); this.ExporPageInfoSelect1.AttributesEventAdd("onchange", "FirstPageDataAdd.LoadData(this,\"AjaxInterfaceData.aspx\");", 0); crptInterList.DataSource = HotelList; crptInterList.DataBind(); HotelList = null; } else { crptInterList.EmptyText = "<tr><td colspan=\"4\"><div style=\"text-align:center; margin-top:75px; margin-bottom:75px;\">暂无数据!</span></div></td></tr>"; ExporPageInfoSelect1.Visible = false; } searchModel = null; } }