protected void Page_Load(object sender, EventArgs e) { ImageServerPath = EyouSoft.Common.ImageManage.GetImagerServerUrl(1); #region 根据查询条件获取酒店信息实体 hotelCode = Utils.GetQueryStringValue("hotelCode"); comeDate = Utils.GetQueryStringValue("comeDate"); leaveDate = Utils.GetQueryStringValue("leaveDate"); cityId = Utils.GetInt(Utils.GetQueryStringValue("cityId")); comeDate = comeDate == "" ? DateTime.Now.ToString("yyyy-MM-dd") : comeDate; leaveDate = leaveDate == "" ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : leaveDate; EyouSoft.HotelBI.SingleSeach search = new EyouSoft.HotelBI.SingleSeach(); search.HotelCode = hotelCode; search.CheckInDate = comeDate; search.CheckOutDate = leaveDate; search.AvailReqType = EyouSoft.HotelBI.AvailReqTypeEnum.includeStatic; EyouSoft.HotelBI.ErrorInfo errorInfo; hotelModel = EyouSoft.BLL.HotelStructure.Hotel.CreateInstance().GetHotelModel(search, out errorInfo); #endregion #region 判断查询酒店时是否有错误 string theMess = IsOk(errorInfo, hotelModel); if (theMess != "") { hotelModel = new EyouSoft.Model.HotelStructure.HotelInfo(); hotelModel.HotelPosition = new EyouSoft.Model.HotelStructure.HotelPositionInfo(); Response.Clear(); Response.Write(theMess); Response.End(); return; } #endregion BindRate();//绑定房型 }
protected void GetHotelModel() { #region 根据查询条件获取酒店信息实体 cityId = Utils.GetInt(Utils.GetQueryStringValue("cityId")); comeDate = comeDate == "" ? DateTime.Now.ToString("yyyy-MM-dd") : comeDate; leaveDate = leaveDate == "" ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : leaveDate; EyouSoft.HotelBI.SingleSeach search = new EyouSoft.HotelBI.SingleSeach(); search.HotelCode = hotelCode; search.CheckInDate = comeDate; search.CheckOutDate = leaveDate; search.AvailReqType = EyouSoft.HotelBI.AvailReqTypeEnum.includeStatic; EyouSoft.HotelBI.ErrorInfo errorInfo; hotelModel = EyouSoft.BLL.HotelStructure.Hotel.CreateInstance().GetHotelModel(search, out errorInfo); #endregion #region 判断查询酒店时是否有错误 string theMess = IsOk(errorInfo, hotelModel); if (theMess != "") { hotelModel = new EyouSoft.Model.HotelStructure.HotelInfo(); hotelModel.HotelPosition = new EyouSoft.Model.HotelStructure.HotelPositionInfo(); Utils.ShowError(theMess, "hotel"); return; } #endregion this.Title = hotelModel.HotelName + "_酒店预订_酒店信息_同业114酒店频道"; this.AddMetaTag("description", "同业114酒店频道,提供" + hotelModel.HotelName + "的房型图片,环境介绍,返佣结算报价等明细信息,是旅游同业全面了解该酒店信息的资源网站"); BindRate();//绑定房型 }
/// <summary> /// 获取绑定酒店的房间列表 /// </summary> /// <param name="list"></param> /// <param name="num"></param> /// <returns></returns> protected string GetRoomByHotel(IList <EyouSoft.Model.HotelStructure.RoomTypeInfo> list, int num, string hotelCode) { StringBuilder strHead = new StringBuilder(); StringBuilder strHidden = new StringBuilder(); EyouSoft.HotelBI.SingleSeach search = new EyouSoft.HotelBI.SingleSeach(); EyouSoft.HotelBI.ErrorInfo errorInfo; //search.HotelCode = hotelCode; //search.CheckInDate = inTime; //search.CheckOutDate = leaveTime; //search.AvailReqType = EyouSoft.HotelBI.AvailReqTypeEnum.includeStatic; //EyouSoft.Model.HotelStructure.HotelInfo hotelModel = EyouSoft.BLL.HotelStructure.Hotel.CreateInstance().GetHotelModel(search, out errorInfo); //获得单酒店的房间信息 IList <EyouSoft.Model.HotelStructure.RoomTypeInfo> roomList = list; //if (hotelModel != null) //{ // IList<EyouSoft.Model.HotelStructure.RoomTypeInfo> rList = hotelModel.RoomTypeList; // //如果单酒店房间信息有数据时 优先显示 // if (rList != null && rList.Count > 0) // { // roomList.Clear(); // roomList = rList; // } //} if (roomList != null && roomList.Count > 0) { //设置标题 strHead.Append("<table width=\"550px\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><th width=\"70px\" height=\"20px\" align=\"center\" bgcolor=\"#FFFFFF\"> 房型</th><th width=\"55px\" align=\"center\" bgcolor=\"#FFFFFF\">门市价</th> <th width=\"55px\" align=\"center\" bgcolor=\"#FFFFFF\">销售价</th><th width=\"55px\" align=\"center\" bgcolor=\"#FFFFFF\"> 返佣价</th><th width=\"60px\" align=\"center\" nowrap=\"nowrap\" bgcolor=\"#FFFFFF\"> 返佣比例 </th> <th width=\"60px\" align=\"center\" bgcolor=\"#FFFFFF\">结算价</th><th width=\"45px\" align=\"center\" bgcolor=\"#FFFFFF\">早餐</th><th width=\"45px\" align=\"center\" bgcolor=\"#FFFFFF\"> 床型</th><th width=\"45px\" align=\"center\" bgcolor=\"#FFFFFF\">宽带 </th><th width=\"60px\" align=\"center\" bgcolor=\"#FFFFFF\"> 预定</th></tr>"); strHidden.Append("<div id=\"div_list_" + num + "\" style=\"display: none;\"><table width=\"550px\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" id=\"con_two_" + num + "\" >"); string displayPrice = ""; //门市价 string amountPrice = ""; //销售价 string commissionAmount = ""; //返佣价 string percent = ""; //返佣 百分比 登录才显示 string balancePrice = ""; //结算价 登录才显示 string freeMeal = ""; //早餐数量 string Internet = ""; //是否有网 int count = 0; for (int i = 0; i < roomList.Count; i++) { if (roomList[i].RoomRate.RateInfos.Count > 0) { displayPrice = roomList[i].RoomRate.RateInfos[0].DisplayPrice.ToString("0"); amountPrice = roomList[i].RoomRate.RateInfos[0].AmountPrice.ToString("0"); commissionAmount = roomList[i].RoomRate.RateInfos[0].CommissionAmount.ToString("0"); freeMeal = EyouSoft.Common.Utils.FilterEndOfTheZeroDecimal(roomList[i].RoomRate.RateInfos[0].FreeMeal); if (IsLogin) { percent = EyouSoft.Common.Utils.FilterEndOfTheZeroDecimal(roomList[i].RoomRate.RateInfos[0].Percent * 100) + "%"; balancePrice = roomList[i].RoomRate.RateInfos[0].BalancePrice.ToString("0"); } else { percent = "<a href=\"" + EyouSoft.Security.Membership.UserProvider.BuildLoginAndReturnUrl(returnUrl, "登录") + "\"><font class=\"C_red\">登录查看</font></a>"; balancePrice = "<a href=\"" + EyouSoft.Security.Membership.UserProvider.BuildLoginAndReturnUrl(returnUrl, "登录") + "\"><font class=\"C_red\">登录查看</font></a>"; } if (freeMeal == "0") { freeMeal = "无早"; } else { freeMeal = "有早"; } if (roomList[i].RoomRate.Internet) { Internet = "有"; } else { Internet = "无"; } if (count < 2) { strHead.Append("<tr class=\"xuxian\"> <td width=\"70px\" align=\"center\" nowrap=\"nowrap\" style=\"white-space:normal; word-break:break-all;\">" + roomList[i].RoomTypeName + "</td><td width=\"55px\" align=\"center\">¥<del>" + displayPrice + "</del></td><td width=\"55px\" align=\"center\">¥" + amountPrice + "</td><td width=\"55px\" align=\"center\"> ¥" + commissionAmount + "</td><td width=\"60px\" align=\"center\">" + percent + "</td> <td width=\"60px\" align=\"center\"> " + balancePrice + "</td> <td width=\"45px\" align=\"center\">" + freeMeal + "</td><td width=\"45px\" align=\"center\">" + roomList[i].BedType + "</td><td width=\"45px\" align=\"center\">" + Internet + "</td> <td width=\"60px\" align=\"center\" valign=\"middle\"> <a href=\"javascript:void(0);\" onclick=\"OpenYuDing('" + hotelCode + "','" + roomList[i].RoomTypeCode + "','" + roomList[i].VendorCode + "','" + roomList[i].RatePlanCode + "')\" ><img src=\"" + ImageServerUrl + "/images/hotel/yuding.gif\" /></a></td></tr>"); count++; } else { strHidden.Append("<tr class=\"xuxian\" > <td width=\"70px\" align=\"center\" nowrap=\"nowrap\" style=\"white-space:normal; word-break:break-all;\">" + roomList[i].RoomTypeName + "</td><td align=\"center\" width=\"55px\" >¥<del>" + displayPrice + "</del></td><td align=\"center\" width=\"55px\" >¥" + amountPrice + "</td><td align=\"center\" width=\"55px\" > ¥" + commissionAmount + "</td><td align=\"center\" width=\"60px\" >" + percent + "</td> <td align=\"center\" width=\"60px\" > " + balancePrice + "</td> <td align=\"center\" width=\"45px\" >" + freeMeal + "</td><td align=\"center\" width=\"45px\" >" + roomList[i].BedType + "</td><td align=\"center\" width=\"45px\" >" + Internet + "</td> <td align=\"center\" valign=\"middle\" width=\"60px\" > <a href=\"javascript:void(0);\" onclick=\"OpenYuDing('" + hotelCode + "','" + roomList[i].RoomTypeCode + "','" + roomList[i].VendorCode + "','" + roomList[i].RatePlanCode + "')\" ><img src=\"" + ImageServerUrl + "/images/hotel/yuding.gif\" /></a></td></tr>"); } } } strHead.Append("</table>"); if (roomList.Count >= 3) { strHidden.Append("</table><div style=\"clear:both;\"></div></div>"); strHidden.Append("<table width=\"550px\"><tr><td colspan=\"9\" align=\"center\" nowrap=\"nowrap\" bgcolor=\"#f1f1ef\"> </td><td height=\"25\" align=\"right\" nowrap=\"nowrap\" bgcolor=\"#f1f1ef\"> <a id=\"a_" + num + "\" href=\"javascript:void(0);\" onclick=\"ShowHideRoom('" + num + "')\" >全部房型</a><img id=\"img_connn_" + num + "\" src=\"" + ImageServerUrl + "/images/hotel/iconnn.gif\" /></td></tr></table>"); } else { strHidden.Append("</table><div style=\"clear:both;\"></div></div>"); } strHead.Append("</table>"); } else { return("没有找到符合条件的房间!"); } return(strHead.ToString() + strHidden.ToString()); }
protected string bookPolicy; //预定规则和要求 protected void Page_Load(object sender, EventArgs e) { if (!IsLogin) { EyouSoft.Security.Membership.UserProvider.RedirectLogin(this.Request.Url.ToString(), "请登录后预定"); return; } this.CityAndMenu1.HeadMenuIndex = 4; #region 获取酒店查询条件 hotelCode = Utils.GetQueryStringValue("hotelCode"); //酒店编号 comeDate = Utils.GetQueryStringValue("comeDate"); //入住日期 leaveDate = Utils.GetQueryStringValue("leaveDate"); //离店日期 DateTime cDate = Utils.GetDateTime(comeDate); DateTime lDate = Utils.GetDateTime(leaveDate); inDays = (lDate - cDate).Days; //获取入住天数 roomCode = Utils.GetQueryStringValue("roomCode"); //房型代码 vendorCode = string.Empty; //Utils.GetQueryStringValue("vendorCode");//供应商代码 ratePlanCode = Utils.GetQueryStringValue("ratePlanCode"); //价格计划代码 #endregion HotelSearch1.CityId = Utils.GetInt(Utils.GetQueryStringValue("CityID")); CommonUser1.CityId = HotelSearch1.CityId; SpecialHotel1.CityId = HotelSearch1.CityId; HotHotel1.CityId = HotelSearch1.CityId; string method = Utils.GetFormValue("method");//当前操作 #region 查询酒店实体 //设置查询条件 EyouSoft.HotelBI.SingleSeach searchModel = new EyouSoft.HotelBI.SingleSeach(); searchModel.HotelCode = hotelCode; //酒店代码 searchModel.CheckInDate = comeDate; //入住时间 searchModel.CheckOutDate = leaveDate; //离店时间 searchModel.RoomTypeCode = roomCode; //房型代码 searchModel.VendorCode = vendorCode; //供应商代码 searchModel.RatePlanCode = ratePlanCode; //价格计划代码 searchModel.AvailReqType = EyouSoft.HotelBI.AvailReqTypeEnum.includeStatic; //查询完整酒店信息 EyouSoft.HotelBI.ErrorInfo errorInfo = null; //错误信息实体 EyouSoft.Model.HotelStructure.HotelInfo hotelModel = EyouSoft.BLL.HotelStructure.Hotel.CreateInstance().GetHotelModel(searchModel, out errorInfo); //酒店实体 #endregion string themess = IsOk(errorInfo, hotelModel);//获取错误信息 //如果没有错误信息则获取酒店各种信息 if (themess == "") { #region 获取酒店实体中的信息 hotelName = hotelModel.HotelName; this.Page.Title = hotelName + "_酒店预订_同业114酒店频道"; //根据房型代码获取酒店中的房型 if (hotelModel.RoomTypeList != null && hotelModel.RoomTypeList.Count > 0) { roomTypeModel = hotelModel.RoomTypeList.FirstOrDefault(r => r.RoomTypeCode == roomCode && /*r.VendorCode == vendorCode &&*/ r.RatePlanCode == ratePlanCode);//获取房型信息 } visistList = EyouSoft.BLL.TicketStructure.TicketVisitor.CreateInstance().GetHotelListByName("", SiteUserInfo.CompanyID);//获取酒店常旅客 //获取房型明细中的第一条 if (roomTypeModel != null && roomTypeModel.RoomRate.RateInfos.Count > 0) { payType = roomTypeModel.RoomRate.Payment == EyouSoft.HotelBI.HBEPaymentType.T ? "前台现付" : ""; backPrice = roomTypeModel.RoomRate.RateInfos.Sum(r => r.CommissionAmount); //取得总反佣价 rateModel = roomTypeModel.RoomRate.RateInfos[0]; //获取第一条明细 }//如果房型信息不存在则显示房型已满 else { Utils.ShowError(string.Format("{0}至{1}房型已满", comeDate, leaveDate), "hotel"); roomTypeModel = new EyouSoft.Model.HotelStructure.RoomTypeInfo(); EyouSoft.Model.HotelStructure.RoomRateInfo roomRateModel = new EyouSoft.Model.HotelStructure.RoomRateInfo(); roomRateModel.RateInfos = new List <EyouSoft.Model.HotelStructure.RateInfo>(); roomTypeModel.RoomRate = roomRateModel; rateModel = new EyouSoft.Model.HotelStructure.RateInfo(); return; } //获取预定规则和要求 if (roomTypeModel.RoomRate.BookPolicy != null) { bookPolicy = roomTypeModel.RoomRate.BookPolicy.LongDesc; } #endregion #region 单操作 if (method == "save") //下单操作 { if (hotelModel.HotelCode == "") //如果传入不存在的酒店则输出失败 { Utils.ResponseMeg(false, string.Format("{0}至{1}房型已满", comeDate, leaveDate)); return; } string aEarlyTime = Utils.GetFormValue("hb_selETime"); //最早到达时间 string aLateTime = Utils.GetFormValue("hb_selLTime"); //最迟到达时间 int intLateTime = Utils.GetInt(aLateTime); if (intLateTime > 24) { aLateTime = (intLateTime - 24).ToString(); } EyouSoft.Model.HotelStructure.OrderInfo orderModel = new EyouSoft.Model.HotelStructure.OrderInfo(); orderModel.ArriveEarlyTime = (aEarlyTime.Length == 1 ? ("0" + aEarlyTime) : aEarlyTime) + "00"; //到店最早时间 orderModel.ArriveLateTime = (aLateTime.Length == 1 ? ("0" + aLateTime) : aLateTime) + "00"; //到店最晚时间 orderModel.BuyerCId = SiteUserInfo.CompanyID; //采购公司编号 orderModel.BuyerCName = SiteUserInfo.CompanyName; //采购公司名 orderModel.BuyerUFullName = SiteUserInfo.ContactInfo.ContactName; //采购用户姓名 orderModel.BuyerUId = SiteUserInfo.ID; //采购用户编号 orderModel.BuyerUName = SiteUserInfo.UserName; //采购用户名 orderModel.CheckInDate = cDate; //入住时间 orderModel.CheckOutDate = lDate; //离店时间 orderModel.CheckState = EyouSoft.Model.HotelStructure.CheckStateList.待审结; orderModel.CityCode = hotelModel.CityCode; //城市代码 orderModel.CityName = hotelModel.CityCode; //城市名称 orderModel.Comments = bookPolicy; //备注 orderModel.CommissionFix = rateModel.Fix; //固定反佣 orderModel.CommissionPercent = rateModel.Percent; //反佣比例 orderModel.CommissionType = EyouSoft.HotelBI.HBECommissionType.FIX; orderModel.ContacterFullname = Utils.GetFormValue("hb_txtContactName"); //联系人姓名 orderModel.ContacterMobile = Utils.GetFormValue("hb_txtContactMoible"); //联系人手机 orderModel.ContacterTelephone = Utils.GetFormValue("hb_txtContactArea") + "-" + Utils.GetFormValue("hb_txtContactTel") + (!string.IsNullOrEmpty(Utils.GetFormValue("hb_txtContactFen")) ? ("-" + Utils.GetFormValue("hb_txtContactFen")) : ""); //联系人电话 if (!string.IsNullOrEmpty(hotelModel.CountryCode)) { orderModel.CountryCode = hotelModel.CountryCode;//国家代码 } orderModel.CreateDateTime = DateTime.Now; orderModel.HotelCode = hotelModel.HotelCode; orderModel.HotelName = hotelModel.HotelName; orderModel.IsMobileContact = Utils.GetFormValue("hb_chkIsMoible") == "1";//是否短信通知客人 orderModel.OrderType = EyouSoft.Model.HotelStructure.OrderType.国内现付; orderModel.PaymentType = EyouSoft.HotelBI.HBEPaymentType.T; orderModel.Quantity = Utils.GetInt(Utils.GetFormValue("hb_selRoom")); orderModel.RatePlanCode = roomTypeModel.RatePlanCode ?? "RatePlanCode"; orderModel.RoomTypeCode = roomTypeModel.RoomTypeCode ?? "RoomTypeCode"; orderModel.RoomTypeName = roomTypeModel.RoomTypeName; decimal ExcessiveFee = 0;//额外收费 IList <EyouSoft.Model.HotelStructure.RateInfo> riList = roomTypeModel.RoomRate.RateInfos; if (riList != null && riList.Count >= 0) { foreach (EyouSoft.Model.HotelStructure.RateInfo rate in riList) { if (rate.ExcessiveFees != null) { ExcessiveFee += rate.ExcessiveFees.Sum(ef => ef.Amount);//计算额外收费 } } } orderModel.TotalAmount = roomTypeModel.RoomRate.AmountPrice * orderModel.Quantity + ExcessiveFee; //总房价(总销售+额外收费) orderModel.TotalCommission = roomTypeModel.RoomRate.RateInfos.Sum(r => r.CommissionPrice) * orderModel.Quantity; //总佣金 orderModel.VendorCode = roomTypeModel.VendorCode; orderModel.VendorName = roomTypeModel.VendorName; //特殊要求 orderModel.SpecialRequest = string.Format("无烟要求:{0},早餐:{1},{2},{3}", Utils.GetFormValue("hb_selIsSmoke"), Utils.GetFormValue("hb_selIsBreakfast"), Utils.GetFormValue("hb_chkFloor"), Utils.GetFormValue("hb_chkRoom")); IList <EyouSoft.HotelBI.HBEResGuestInfo> guestList = new List <EyouSoft.HotelBI.HBEResGuestInfo>(); string[] guestName = Utils.GetFormValues("hb_txtGuestName"); //获取客户姓名 string[] guestType = Utils.GetFormValues("hb_selGuestType"); //获取客户类型 string guestMoible = Utils.GetFormValue("hb_chkGuestMoible"); //获取通知手机 //添加酒店旅客 EyouSoft.IBLL.TicketStructure.ITicketVisitor visistorBll = EyouSoft.BLL.TicketStructure.TicketVisitor.CreateInstance(); for (int i = 0; i < orderModel.Quantity; i++) { //添加常旅客 if (i == 0) { string cName = ""; string eName = ""; if (IsLetter(guestName[i]))//判断中文或英文 { eName = guestName[i]; } else { cName = guestName[i]; } //判断常旅客是否存在 if (!visistorBll.HotelVistorIsExist(cName, eName, guestMoible, SiteUserInfo.CompanyID, null)) { EyouSoft.Model.TicketStructure.TicketVistorInfo vInfo = new EyouSoft.Model.TicketStructure.TicketVistorInfo(); vInfo.ChinaName = cName; vInfo.EnglishName = eName; vInfo.CompanyId = SiteUserInfo.CompanyID; vInfo.Id = Guid.NewGuid().ToString(); vInfo.ContactTel = guestMoible; vInfo.CardNo = ""; vInfo.CardType = EyouSoft.Model.TicketStructure.TicketCardType.None; vInfo.ContactSex = EyouSoft.Model.CompanyStructure.Sex.未知; EyouSoft.Model.TicketStructure.TicketNationInfo nation = new EyouSoft.Model.TicketStructure.TicketNationInfo(); nation.CountryCode = ""; nation.CountryName = ""; vInfo.NationInfo = nation; vInfo.VistorType = EyouSoft.Model.TicketStructure.TicketVistorType.成人; vInfo.DataType = EyouSoft.Model.TicketStructure.TicketDataType.酒店常旅客; visistorBll.AddTicketVisitorInfo(vInfo);//执行添加 } } EyouSoft.HotelBI.HBEResGuestInfo guest = new EyouSoft.HotelBI.HBEResGuestInfo(); guest.GuestTypeIndicator = (EyouSoft.HotelBI.HBEGuestTypeIndicator)(int.Parse(guestType[i])); guest.IsMobileContact = orderModel.IsMobileContact; guest.Mobile = guestMoible; guest.PersonName = guestName[i]; guestList.Add(guest); } orderModel.ResGuests = guestList; //赋值旅客信息 string errorDesc = ""; //错误描述 if (EyouSoft.BLL.HotelStructure.HotelOrder.CreateInstance().Add(orderModel, out errorDesc) > 0) { Utils.ResponseMeg(true, orderModel.ResOrderId); } else { Utils.ResponseMeg(false, errorDesc == "" ? "下单失败" : "下单失败:" + errorDesc);//下单失败 } } #endregion else { #region 绑定酒店房费 HotelSearch1.ImageServerPath = ImageServerPath; if (hotelModel.HotelCode == "")//如果出入不存在酒店则返回到查询列表 { Utils.ShowError(string.Format("{0}至{1}房型已满", comeDate, leaveDate), "hotel"); return; } GetRateInfoList();//绑定酒店房费列表 #endregion } } else//如果错误信息不为空 { //如果是保存操作则输出错误信息 if (method == "save") { Utils.ResponseMeg(false, themess); } else//如果是初始化页面时则跳转到错误页面 { Utils.ShowError(themess, "hotel"); } } }
protected void Page_Load(object sender, EventArgs e) { this.CityAndMenu1.HeadMenuIndex = 4; if (!IsLogin) { EyouSoft.Security.Membership.UserProvider.RedirectLogin(this.Request.Url.ToString(), "请登录后预定"); return; } string method = Utils.GetFormValue("method"); #region 根据条件获取酒店实体 EyouSoft.HotelBI.SingleSeach searchModel = new EyouSoft.HotelBI.SingleSeach(); comeDate = Utils.GetQueryStringValue("comeDate"); //入住日期 leaveDate = Utils.GetQueryStringValue("leaveDate"); //离店日期 HotelSearch1.CityId = Utils.GetInt(Utils.GetQueryStringValue("cityId")); CommonUser1.CityId = HotelSearch1.CityId; cityId = HotelSearch1.CityId; comeDate = comeDate == "" ? DateTime.Now.ToString("yyyy-MM-dd") : comeDate; //如果取不到则取当前日 leaveDate = leaveDate == "" ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : leaveDate; //如果取不到则为明天 cDate = Utils.GetDateTime(comeDate); lDate = Utils.GetDateTime(leaveDate); days = (lDate - cDate).Days; hotelCode = Utils.GetQueryStringValue("hotelCode");//酒店代号 searchModel.HotelCode = hotelCode; searchModel.CheckInDate = comeDate; searchModel.CheckOutDate = leaveDate; searchModel.AvailReqType = EyouSoft.HotelBI.AvailReqTypeEnum.includeStatic; EyouSoft.HotelBI.ErrorInfo errorInfo = null; EyouSoft.Model.HotelStructure.HotelInfo hotelModel = EyouSoft.BLL.HotelStructure.Hotel.CreateInstance().GetHotelModel(searchModel, out errorInfo); #endregion string theMess = IsOk(errorInfo, hotelModel); #region 初始化酒店信息 //如果不是下单则绑定房型类别 if (method != "save") { HotelSearch1.ImageServerPath = ImageServerPath; if (theMess == "") { hotelName = hotelModel.HotelName; this.Page.Title = hotelName + "_酒店团队预订_同业114酒店频道"; } else { Utils.ShowError(theMess, ""); } } #endregion #region 预定团队 else { if (theMess != "")//如果酒店为空则输出失败 { Utils.ResponseMeg(false, theMess); return; } //团队定制实体 EyouSoft.Model.HotelStructure.HotelTourCustoms tourModel = new EyouSoft.Model.HotelStructure.HotelTourCustoms(); tourModel.BudgetMax = Utils.GetDecimal(Utils.GetFormValue("htb_txtBudgetMax")); //预算最大值 tourModel.BudgetMin = Utils.GetDecimal(Utils.GetFormValue("htb_txtBudgetMin")); //预算最小值 tourModel.GuestType = Utils.GetFormValue("htb_selPType") == "1" ? EyouSoft.HotelBI.HBEGuestTypeIndicator.F : EyouSoft.HotelBI.HBEGuestTypeIndicator.D; //宾客类型 tourModel.OtherRemark = Utils.GetFormValue("htb_txtRemark"); //其他要求 tourModel.PeopleCount = Utils.GetInt(Utils.GetFormValue("htb_txtPCount")); //人数 tourModel.RoomCount = Utils.GetInt(Utils.GetFormValue("htb_txtRoomNum")); //房间数 tourModel.TourType = (TourTypeList)Utils.GetInt(Utils.GetFormValue("htb_selTourType"), 1); //团队类型 tourModel.RoomAsk = Utils.GetFormValue("htb_selRoomType"); //房间要求 tourModel.CityCode = hotelModel.CityCode; tourModel.CompanyId = SiteUserInfo.CompanyID; tourModel.HotelCode = hotelModel.HotelCode; tourModel.HotelName = hotelModel.HotelName; tourModel.HotelStar = hotelModel.Rank; tourModel.LiveEndDate = lDate; tourModel.LiveStartDate = cDate; tourModel.Payment = EyouSoft.HotelBI.HBEPaymentType.T; //预订团队订单 if (EyouSoft.BLL.HotelStructure.HotelTourCustoms.CreateInstance().Add(tourModel)) { Utils.ResponseMegSuccess();//输出成功 } else { Utils.ResponseMegError();//输出失败 } } #endregion }