Beispiel #1
0
        /// <summary>
        /// 查询酒店时判断是否有错误
        /// </summary>
        /// <param name="errorInfo">错误实体</param>
        /// <param name="model">酒店实体</param>
        /// <returns></returns>
        protected string IsOk(EyouSoft.HotelBI.ErrorInfo errorInfo, EyouSoft.Model.HotelStructure.HotelInfo model)
        {
            string mess = "";//错误消息

            //如果错误实体不为空
            if (errorInfo != null)
            {
                switch (errorInfo.ErrorType)//错误类别
                {
                case EyouSoft.HotelBI.ErrorType.业务级错误:
                    mess = string.Format("{0}至{1}房型已满", comeDate, leaveDate);
                    break;

                case EyouSoft.HotelBI.ErrorType.未知错误:
                    mess = "提交数据超时,请稍后在试";
                    break;

                case EyouSoft.HotelBI.ErrorType.None:
                    mess = "";
                    break;

                case EyouSoft.HotelBI.ErrorType.系统级错误:
                    mess = "查询数据时出错";
                    break;
                }
            }
            if (mess == "") //如果错误消息为空
            {               //判断酒店实体或酒店代码是否存在
                if (model == null || string.IsNullOrEmpty(model.HotelCode))
                {
                    mess = string.Format("{0}至{1}房型已满", comeDate, leaveDate);
                }
            }
            return(mess);//返回错误消息
        }
Beispiel #2
0
        /// <summary>
        /// 查询酒店时是否有错误信息
        /// </summary>
        /// <param name="errorInfo">错误信息实体</param>
        /// <param name="model">酒店实体</param>
        /// <returns></returns>
        protected string IsOk(EyouSoft.HotelBI.ErrorInfo errorInfo, EyouSoft.Model.HotelStructure.HotelInfo model)
        {
            string mess = "";

            if (errorInfo != null)
            {
                switch (errorInfo.ErrorType)
                {
                case EyouSoft.HotelBI.ErrorType.业务级错误:
                    mess = string.Format("{0}至{1}房型已满", comeDate, leaveDate);
                    break;

                case EyouSoft.HotelBI.ErrorType.未知错误:
                    mess = "查询数据超时";
                    break;

                case EyouSoft.HotelBI.ErrorType.None:
                    mess = "";
                    break;

                case EyouSoft.HotelBI.ErrorType.系统级错误:
                    mess = "查询数据时出错";
                    break;
                }
            }
            else
            {
                mess = "查询数据时出错";
            }
            if (model == null || string.IsNullOrEmpty(model.HotelCode))
            {
                mess = string.Format("{0}至{1}房型已满", comeDate, leaveDate);
            }
            return(mess);
        }
Beispiel #3
0
        /// <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;
        }
Beispiel #4
0
        protected string IsOk(EyouSoft.HotelBI.ErrorInfo errorInfo, EyouSoft.Model.HotelStructure.HotelInfo model)
        {
            string mess = "";

            if (errorInfo != null)
            {
                switch (errorInfo.ErrorType)
                {
                case EyouSoft.HotelBI.ErrorType.业务级错误:
                    mess = "酒店或房型不存在";
                    break;

                case EyouSoft.HotelBI.ErrorType.未知错误:
                    mess = "查询数据超时,请稍后再试";
                    break;

                case EyouSoft.HotelBI.ErrorType.None:
                    mess = "";
                    break;

                case EyouSoft.HotelBI.ErrorType.系统级错误:
                    mess = "查询数据时出错";
                    break;
                }
            }
            else
            {
                mess = "查询数据时出错";
            }
            if (mess == "")
            {
                if (model == null || string.IsNullOrEmpty(model.HotelCode))
                {
                    mess = "酒店或房型不存在";
                }
            }
            return(mess);
        }
Beispiel #5
0
        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");
                }
            }
        }
Beispiel #6
0
        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;
            }
        }
Beispiel #7
0
        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
        }