Exemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            base.BaseInit(context);
            context.Response.ContentType = "text/plain";
            string TourId        = EyouSoft.Common.Utils.InputText(context.Request.QueryString["TourId"]);
            string RemnantNumber = EyouSoft.Common.Utils.InputText(context.Request.QueryString["RemnantNumber"]);
            string leaveDate     = EyouSoft.Common.Utils.InputText(context.Request.QueryString["leaveDate"]);
            string callback      = context.Request.QueryString["callback"];
            string type          = context.Request.QueryString["onlyprice"];

            if (type == "yes")
            {
                string      routeId     = context.Request.QueryString["RouteId"];
                MPowderList PowderModel = EyouSoft.BLL.NewTourStructure.BPowderList.CreateInstance().GetModel(TourId);
                string      Price       = string.Empty;//市场价
                if (PowderModel != null)
                {
                    Price = "成人价 " + EyouSoft.Common.Utils.FilterEndOfTheZeroDecimal(PowderModel.RetailAdultPrice) + "元/人起";
                }
                else
                {
                    Price = "电询";
                }
                context.Response.Write("[{ \"price\":\"" + Price + "\"}]");
            }
            else
            {
                context.Response.Write(";" + callback + "([{PriceInfo:'" + this.GetPriceInfo(TourId, RemnantNumber, leaveDate) + "'}])");
            }
            context.Response.End();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 批量修改行程
        /// </summary>
        /// <param name="item">散拼实体</param>
        /// <param name="tourId">团队编号</param>
        /// <returns></returns>
        public bool UpdateStandardPlan(MPowderList item, params string[] tourId)
        {
            bool result = false;

            if (item != null && tourId != null && tourId.Length > 0)
            {
                if (dal.UpdateStandardPlan(item, tourId) > 0)
                {
                    result = true;
                }
            }
            return(result);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 批量添加
        /// </summary>
        /// <param name="item">散拼实体</param>
        /// <param name="leaveDates">出团日期</param>
        /// <param name="registrationDate">报名截止日期</param>
        /// <returns></returns>
        public bool AddBatchPowder(MPowderList item, DateTime[] leaveDates, DateTime[] registrationDate)
        {
            bool result = false;

            if (item != null && leaveDates != null && leaveDates.Length > 0 &&
                registrationDate != null && registrationDate.Length > 0 && !string.IsNullOrEmpty(item.Publishers))
            {
                if (dal.AddBatchPowder(item, leaveDates, registrationDate) > 0)
                {
                    result = true;
                }
            }
            return(result);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 修改散拼计划
        /// </summary>
        /// <param name="item">散拼实体</param>
        /// <returns></returns>
        public bool UpdatePowder(MPowderList item)
        {
            bool result = false;

            if (item != null)
            {
                item.StartCityName = BRoute.GetCityName(item.StartCity);
                item.EndCityName   = BRoute.GetCityName(item.EndCity);
                item.ComeBackDate  = item.LeaveDate.AddDays(item.Day);
                if (dal.UpdatePowder(item) > 0)
                {
                    result = true;
                }
            }
            return(result);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 添加散拼计划
        /// </summary>
        /// <param name="item">散拼实体</param>
        /// <returns></returns>
        public bool AddPowder(MPowderList item)
        {
            bool result = false;

            if (item != null)
            {
                item.TourId        = Guid.NewGuid().ToString();
                item.StartCityName = BRoute.GetCityName(item.StartCity);
                item.EndCityName   = BRoute.GetCityName(item.EndCity);
                item.ComeBackDate  = item.LeaveDate.AddDays(item.Day);
                if (dal.AddPowder(item) > 0)
                {
                    result = true;
                }
            }
            return(result);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 修改保存
        /// </summary>
        private void UpdateSave()
        {
            string data = Utils.GetFormValue("data");

            string[]            modelStr = data.Split('|');
            int                 i        = modelStr.Length;
            IList <MPowderList> ls       = new List <MPowderList>();

            while (i-- > 0)
            {
                string[]    subModelStr = modelStr[i].Split(',');
                MPowderList model       = EyouSoft.BLL.NewTourStructure.BPowderList.CreateInstance().GetModel(subModelStr[0]);
                //报名截止时间
                model.RegistrationEndDate = Utils.GetDateTime(subModelStr[1]);
                //人数
                model.TourNum = Utils.GetInt(subModelStr[2]);
                //留位
                model.SaveNum = Utils.GetInt(subModelStr[3]);
                //状态
                model.PowderTourStatus = (PowderTourStatus)Utils.GetInt(subModelStr[4]);
                //余位
                model.MoreThan = Utils.GetInt(subModelStr[5]);
                //成人市场价
                model.RetailAdultPrice = Utils.GetDecimal(subModelStr[6]);
                //成人结算价
                model.SettlementAudltPrice = Utils.GetDecimal(subModelStr[7]);
                //儿童市场价
                model.RetailChildrenPrice = Utils.GetDecimal(subModelStr[8]);
                //儿童结算价
                model.SettlementChildrenPrice = Utils.GetDecimal(subModelStr[9]);
                //单房差
                model.MarketPrice = Utils.GetDecimal(subModelStr[10]);
                ls.Add(model);
            }
            Response.Clear();
            Response.Write(EyouSoft.BLL.NewTourStructure.BPowderList.CreateInstance().UpdatePowerList(ls));
            Response.End();
        }
Exemplo n.º 7
0
        /// <summary>
        /// 添加保存
        /// </summary>
        private void AddSave()
        {
            //出团日期
            string[] leaveDateStr = Utils.GetFormValue("leaveDate").Split(',');
            MRoute   routeModel   = EyouSoft.BLL.NewTourStructure.BRoute.CreateInstance().GetModel(Utils.GetFormValue("routeid"));
            //提前天数
            int         advanceDayRegistration = routeModel.AdvanceDayRegistration;
            MPowderList model = new MPowderList();

            #region 已注释
            //发布人名称
            //model.OperatorName = SiteUserInfo.UserName;
            ////主要浏览城市
            //model.BrowseCitys = routeModel.BrowseCitys;
            ////主要浏览国家
            //model.BrowseCountrys = routeModel.BrowseCountrys;
            ////线路特色
            //model.Characteristic = routeModel.Characteristic;
            ////点击量
            //model.ClickNum = routeModel.ClickNum;
            ////发布商品牌名称
            //model.CompanyBrand = routeModel.CompanyBrand;
            ////公司等级
            //model.Companylev = routeModel.Companylev;
            ////发布商简称
            //model.Introduction = routeModel.Introduction;
            #endregion
            //发布人IP
            model.IP = Request.UserHostAddress;
            //发布人编号
            model.OperatorId = SiteUserInfo.ID;
            //公司编号
            model.Publishers = SiteUserInfo.CompanyID;
            //线路Id
            model.RouteId = Utils.GetFormValue("routeid");
            //线路名称
            model.RouteName = routeModel.RouteName;
            //专线类型
            model.AreaId = routeModel.AreaId;
            //团队人数
            model.TourNum = Utils.GetInt(Utils.GetFormValue("txt_tourNum"));
            //是否限制人数
            model.IsLimit = Utils.GetFormValue("hd_isLimit") == "0";
            if (!model.IsLimit)
            {
                //余位
                model.MoreThan = Utils.GetInt(Utils.GetFormValue("txt_moreThan"), model.TourNum);
            }
            //成人市场价
            model.RetailAdultPrice = Utils.GetDecimal(Utils.GetFormValue("txt_retailAdultPrice"));
            //成人结算价
            model.SettlementAudltPrice = Utils.GetDecimal(Utils.GetFormValue("txt_settlementAudltPrice"));
            //儿童市场价
            model.RetailChildrenPrice = Utils.GetDecimal(Utils.GetFormValue("txt_retailChildrenPrice"), 0);
            //儿童结算价
            model.SettlementChildrenPrice = Utils.GetDecimal(Utils.GetFormValue("txt_settlementChildrenPrice"), 0);
            //单房差
            model.MarketPrice = Utils.GetDecimal(Utils.GetFormValue("txt_marketPrice"));
            //集合说明
            model.SetDec = Utils.GetFormValue("txt_setDec");
            //线路销售备注
            model.TourNotes = Utils.GetFormValue("txt_tourNotes");
            //领队全陪
            model.TeamLeaderDec = Utils.GetFormValue("txt_teamLeaderDec");
            //航班出发时间
            model.StartDate = Utils.GetFormValue("txt_startDate");
            //航班返回时间
            model.EndDate = Utils.GetFormValue("txt_endDate");

            //计算有几个出团日期
            int i = leaveDateStr.Length;
            //出团日期
            DateTime[] leaveDate = new DateTime[i];
            //报名截止时间
            DateTime[] registrationEndDate = new DateTime[i];
            //遍历
            while (i-- > 0)
            {
                //出团日期
                leaveDate[i] = Utils.GetDateTime(leaveDateStr[i]);
                //计算截止时间
                registrationEndDate[i] = leaveDate[i] - new TimeSpan(advanceDayRegistration, 0, 0, 0);

                //周六继续提前1天
                if ((int)registrationEndDate[i].DayOfWeek == 6)
                {
                    registrationEndDate[i] = registrationEndDate[i] - new TimeSpan(1, 0, 0, 0);
                }
                //周日继续提前2天
                if ((int)registrationEndDate[i].DayOfWeek == 0)
                {
                    registrationEndDate[i] = registrationEndDate[i] - new TimeSpan(2, 0, 0, 0);
                }
            }
            Response.Clear();
            Response.Write(EyouSoft.BLL.NewTourStructure.BPowderList.CreateInstance().AddBatchPowder(model, leaveDate, registrationEndDate));
            Response.End();
        }
Exemplo n.º 8
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected void InitPage()
        {
            //根据订单编号获取相应的实体
            var IBLL = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance();

            TOModel = EyouSoft.BLL.NewTourStructure.BTourOrder.CreateInstance().GetModel(OrderId);
            if (TOModel != null)
            {
                #region 根据专线商编号获取专线商公司实体信息
                CompanyDetailInfo DetailInfoModelZX = IBLL.GetModel(TOModel.Publishers);
                if (DetailInfoModelZX != null)
                {
                    //专线商公司信息
                    this.Zhuanxian.Text  = DetailInfoModelZX.CompanyName;
                    this.Zhuanxian1.Text = DetailInfoModelZX.CompanyName;
                    //专线商联系信息
                    this.ZhuanxianContact.Text = DetailInfoModelZX.ContactInfo.ContactName + " 手机 " + DetailInfoModelZX.ContactInfo.Mobile + " 传真号 " + DetailInfoModelZX.ContactInfo.Fax;
                    this.zxBankInfo.Text       = GetBankList(DetailInfoModelZX.BankAccounts);
                }
                #endregion

                #region 根据组团社编号获取组团社公司实体信息
                CompanyDetailInfo DetailInfoModelZT = IBLL.GetModel(TOModel.Travel);
                if (DetailInfoModelZT != null)
                {
                    //组团社
                    this.TravelName.Text = DetailInfoModelZT.CompanyName;
                    //组团联系人
                    this.ZutuanContact.Text = DetailInfoModelZT.ContactInfo.ContactName + " 手机 " + DetailInfoModelZT.ContactInfo.Mobile + " 传真号 " + DetailInfoModelZT.ContactInfo.Fax;
                    this.ztBankInfo.Text    = GetBankList(DetailInfoModelZT.BankAccounts);
                }
                #endregion

                #region 绑定游客信息
                if (TOModel.Customers != null && TOModel.Customers.Count > 0)
                {
                    this.TouristInfomation.DataSource = TOModel.Customers;
                    this.TouristInfomation.DataBind();
                }
                #endregion

                #region 根据团队编号获取散拼信息实体
                PowderListModel = BPowderList.CreateInstance().GetModel(TOModel.TourId);
                if (PowderListModel != null)
                {
                    //绑定日程
                    if (PowderListModel.StandardPlans != null && PowderListModel.StandardPlans.Count > 0)
                    {
                        isStandard = true;
                        BindStandardPlan(PowderListModel.StandardPlans);
                    }
                    else
                    {
                        this.FastStandard.Text = PowderListModel.StandardStroke;
                    }
                    if (PowderListModel.FitQuotation != null && PowderListModel.FitQuotation != "")
                    {
                        this.Containes.Text = PowderListModel.FitQuotation;
                    }
                    //报价包含
                    if (PowderListModel.ServiceStandard != null)
                    {
                        if (PowderListModel.FitQuotation == null || PowderListModel.FitQuotation == "")
                        {
                            this.Containes.Text = Utils.TextToHtml(GetContainers(PowderListModel.ServiceStandard));
                        }
                        //报价不含
                        this.NoContaines.Text = Utils.TextToHtml(PowderListModel.ServiceStandard.NotContainService);
                    }
                }
                #endregion

                #region 普通信息
                //团号
                this.TeamId.Text = TOModel.TourNo;
                //线路名称
                this.RouteName.Text = TOModel.RouteName;
                //出团时间
                this.LeaveDate.Text = TOModel.LeaveDate.ToString("yyyy-MM-dd");
                //人数
                this.PersonNum.Text = (TOModel.AdultNum + TOModel.ChildrenNum).ToString();
                //备注
                this.Remark.Text = Utils.TextToHtml(TOModel.TourNotes);
                //结算价合计
                this.SumSettlement.Value = Utils.FilterEndOfTheZeroDecimal(TOModel.TotalSettlementPrice);
                #endregion
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// 加载页面
        /// </summary>
        private void InitPage()
        {
            MPowderList model = EyouSoft.BLL.NewTourStructure.BPowderList.CreateInstance().GetModel(tourId);

            companyid = model.Publishers;
            if (!isAllUpdata)
            {
                //绑定团队状态
                BindPowderTourStatus();
            }
            //绑定销售城市
            SalesArea();
            //绑定交通
            BindTraffic();
            //绑定线路区域主题
            BindTheme();

            if (model != null)
            {
                routeId = model.RouteId;
                if (!isAllUpdata)
                {
                    #region 团队报价标准
                    //出团时间
                    lbl_LeaveDate.Text = model.LeaveDate.ToString("yyyy-MM-dd");
                    //报名截止时间
                    txt_registrationEndDate.Text = model.RegistrationEndDate.ToString("yyyy-MM-dd");
                    //成人市场价
                    txt_retailAdultPrice.Text = Utils.FilterEndOfTheZeroDecimal(model.RetailAdultPrice);
                    //成人结算价
                    txt_settlementAudltPrice.Text = Utils.FilterEndOfTheZeroDecimal(model.SettlementAudltPrice);
                    //儿童市场价
                    txt_retailChildrenPrice.Text = Utils.FilterEndOfTheZeroDecimal(model.RetailChildrenPrice);
                    //儿童结算价
                    txt_settlementChildrenPrice.Text = Utils.FilterEndOfTheZeroDecimal(model.SettlementChildrenPrice);
                    //单房差
                    txt_marketPrice.Text = Utils.FilterEndOfTheZeroDecimal(model.MarketPrice);
                    //计划收客人数
                    txt_orderPeopleNum.Text = model.TourNum.ToString();
                    //是否显示余位
                    isShowMoreThan = model.IsLimit;
                    //余位
                    txt_moreThan.Text = model.MoreThan.ToString();
                    //留位
                    txt_saveNum.Text = model.SaveNum.ToString();
                    //航班出发时间
                    txt_startDate.Text = model.StartDate;
                    //航班返回时间
                    txt_endDate.Text = model.EndDate;
                    //集合说明时间
                    txt_setDec.Value = model.SetDec;
                    //领队全陪说明
                    txt_teamLeaderDec.Value = model.TeamLeaderDec;
                    //团队备注
                    txt_tourNotes.Value = model.TourNotes;
                    //团队状态
                    ddl_powderTourStatus.SelectedValue = ((int)model.PowderTourStatus).ToString();
                    //团队推荐
                    ddl_Status.SelectedValue = ((int)model.RecommendType).ToString();
                    //发布时间
                    litTime.Text = model.IssueTime.ToShortDateString();
                    //发布ip
                    litIP.Text = model.IP;
                    #endregion
                }
                #region 行程信息
                //绑定出发返回城市
                BindCity();
                //专线名称
                lbl_travelRangeName.Text = model.AreaName;
                //线路名称
                txt_LineName.Text = model.RouteName;
                //发布商
                txtPublishersName.Value = model.PublishersName;
                //发布人
                EyouSoft.Common.Function.MessageBox.ResponseScript(Page, "GetOperator('" + model.Publishers + "','" + model.OperatorId + "')");
                //B2B显示控制
                dropB2B.SelectedValue = ((int)model.B2B).ToString();
                //B2C显示控制
                dropB2C.SelectedValue = ((int)model.B2C).ToString();
                //B2B排序值
                txt_B2B.Value = model.B2BOrder.ToString();
                //B2B排序值
                txt_B2C.Value = model.B2COrder.ToString();
                //绑定推荐状态
                BindRecommendType(model.RecommendType == RecommendType.推荐);
                //推荐状态
                ddl_Status.SelectedValue = ((int)model.RecommendType).ToString();
                //出发交通
                ddl_DepartureTraffic.SelectedIndex = (int)model.StartTraffic - 1;
                //返回交通
                ddl_ReturnTraffic.SelectedIndex = (int)model.EndTraffic - 1;
                //出发城市
                hd_goCity.Value = model.StartCity + "|" + model.StartCityName;
                //返回城市
                hd_returnCity.Value = model.EndCity + "|" + model.EndCityName;
                //线路特色
                txt_LineFeatures.Value = model.Characteristic;
                //住宿天数
                txt_days.Text = model.Day.ToString();
                //住宿夜数
                txt_nights.Text = model.Late.ToString();
                //简易版行程
                txt_BriefnessTravel.Value = model.StandardStroke;
                //散客报价
                txt_FIT.Value = model.FitQuotation;
                //销售须知
                txt_Notes.Value = model.VendorsNotes;

                //主题
                hd_SubjectLine.Value = SetTheme(model.Themes);
                //销售区域
                hd_SellCity.Value = SetSalesArea(model.Citys);
                #region 主要浏览
                //主要浏览国家
                SysArea AreaModel = EyouSoft.BLL.SystemStructure.SysArea.CreateInstance().GetSysAreaModel(model.AreaId);
                if (AreaModel != null)
                {
                    if (model.RouteType == AreaType.国际线)
                    {
                        if (model.BrowseCountrys != null && model.BrowseCountrys.Count > 0)
                        {
                            //主要浏览国家
                            if (AreaModel.VisitCity != null && AreaModel.VisitCity.Count > 0)
                            {
                                IList <MSysCountry> lsCountry = EyouSoft.BLL.SystemStructure.BSysCountry.CreateInstance().GetCountryList(
                                    AreaModel.VisitCity.Select(ls => ls.CountryId).ToArray()
                                    );
                                if (lsCountry != null && lsCountry.Count > 0)
                                {
                                    rpt_VisitingNational.DataSource = lsCountry;
                                    rpt_VisitingNational.DataBind();
                                }
                            }

                            citysOrCountrys = true;
                            int    i = model.BrowseCountrys.Count;
                            string str = string.Empty, qzstr = string.Empty;
                            while (i-- > 0)
                            {
                                str += model.BrowseCountrys[i].CountryId + ",";
                                //签证信息
                                if (model.BrowseCountrys[i].IsVisa)
                                {
                                    qzstr += model.BrowseCountrys[i].CountryId + ",";
                                }
                            }
                            if (qzstr.Length > 0)
                            {
                                hd_qz.Value = qzstr.Substring(0, qzstr.Length - 1);
                            }
                            hd_BrowseCountrys.Value = str.Substring(0, str.Length - 1);
                        }
                        //免签 直接显示免签
                        if (model.IsNotVisa)
                        {
                            chk_null.Checked = true;
                            hd_qz.Value      = string.Empty;
                        }
                        //国际线路成人定金
                        txt_AdultDeposit.Text = model.AdultPrice < 0 ? string.Empty : Utils.FilterEndOfTheZeroDecimal(model.AdultPrice);
                        //国际线路儿童定金
                        txt_ChildrenDeposit.Text = model.ChildrenPrice < 0 ? string.Empty : Utils.FilterEndOfTheZeroDecimal(model.ChildrenPrice);
                    }
                    else
                    {
                        //主要浏览城市
                        if (AreaModel.VisitCity != null && AreaModel.VisitCity.Count > 0)
                        {
                            IList <SysCity> lsCity = EyouSoft.BLL.SystemStructure.SysCity.CreateInstance().GetSysCityList(
                                AreaModel.VisitCity.Where(ls => ls.CountyId == 0 && ls.CityId != 0).Select(ls => ls.CityId).ToArray()
                                );
                            IList <SysDistrictCounty> lsDistrictCounty = EyouSoft.BLL.SystemStructure.SysDistrictCounty.CreateInstance().GetDistrictCountyList(
                                AreaModel.VisitCity.Select(ls => ls.CountyId).ToArray()
                                );
                            if (lsDistrictCounty != null && lsDistrictCounty.Count > 0)
                            {
                                rpt_districtCounty.DataSource = lsDistrictCounty;
                                rpt_districtCounty.DataBind();
                            }
                            if (lsCity != null && lsCity.Count > 0)
                            {
                                rpt_browseCitys.DataSource = lsCity;
                                rpt_browseCitys.DataBind();
                            }
                        }
                        //主要浏览城市
                        if (model.BrowseCitys != null && model.BrowseCitys.Count > 0)
                        {
                            citysOrCountrys = false;
                            int    i   = model.BrowseCitys.Count;
                            string str = string.Empty;
                            while (i-- > 0)
                            {
                                if (model.BrowseCitys[i].CountyId > 0)
                                {
                                    str += model.BrowseCitys[i].CountyId + "|" + model.BrowseCitys[i].CityId + ",";
                                }
                                else
                                {
                                    str += model.BrowseCitys[i].CityId + ",";
                                }
                            }
                            hd_BrowseCitys.Value = str.Substring(0, str.Length - 1);
                        }
                    }
                }

                #endregion
                //行程
                if (model.StandardStroke.Length > 0)
                {
                    txt_BriefnessTravel.Value = model.StandardStroke;
                }
                else
                {
                    if (model.StandardPlans != null && model.StandardPlans.Count > 0)
                    {
                        isTravel = true;
                        rpt_standardPlans.DataSource = model.StandardPlans;
                        rpt_standardPlans.DataBind();
                    }
                }
                if (model.ServiceStandard != null)
                {
                    //报价不包含
                    txt_PriceExcluding.Value = model.ServiceStandard.NotContainService;
                    //赠送项目
                    txt_GiftItems.Value = model.ServiceStandard.GiftInfo;
                    //儿童及其他安排
                    txt_OtherArr.Value = model.ServiceStandard.ChildrenInfo;
                    //购物安排
                    txt_ShoppingArr.Value = model.ServiceStandard.ShoppingInfo;
                    //自费项目
                    txt_ThisConsumption.Value = model.ServiceStandard.ExpenseItem;
                    //备注
                    txt_Remarks.Value = model.ServiceStandard.Notes;
                    //判断是否为团队
                    isServiceStandard = model.ServiceStandard.CarContent.Length > 0 ||        //用车
                                        model.ServiceStandard.DinnerContent.Length > 0 ||     //用餐
                                        model.ServiceStandard.ResideContent.Length > 0 ||     //住宿
                                        model.ServiceStandard.SightContent.Length > 0 ||      //景点
                                        model.ServiceStandard.TrafficContent.Length > 0 ||    //往返交通
                                        model.ServiceStandard.GuideContent.Length > 0 ||      //导游
                                        model.ServiceStandard.IncludeOtherContent.Length > 0; //其他包含
                    if (isServiceStandard)
                    {
                        this.AddStandardRoute_ServiceStandard.RouteServiceStandardInfo = model.ServiceStandard;
                    }
                }
                #endregion
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// 保存
        /// </summary>
        private void Save()
        {
            IPowderList bll    = EyouSoft.BLL.NewTourStructure.BPowderList.CreateInstance();
            bool        isSave = false;
            MPowderList model  = bll.GetModel(tourId);

            if (model == null)
            {
                Response.Clear();
                Response.Write(isSave.ToString());
                Response.End();
                return;
            }
            string[] tourIds = Utils.GetFormValue(hd_tourIds.UniqueID).Split(',');
            #region 行程信息
            //主要浏览
            if (model.RouteType == AreaType.国际线)
            {
                //主要浏览国家
                model.BrowseCountrys = new List <MBrowseCountryControl>();
                string[] browseCountryControl = Utils.GetFormValue(hd_BrowseCountrys.UniqueID).Split(',');
                int      i     = browseCountryControl.Length;
                string[] qzArr = Utils.GetFormValue(hd_qz.UniqueID).Split(',');
                while (i-- > 0)
                {
                    MBrowseCountryControl browseCityControlModel = new MBrowseCountryControl();
                    browseCityControlModel.CountryId = Utils.GetInt(browseCountryControl[i]);
                    if (qzArr.Length > 0)
                    {
                        int j = qzArr.Length;
                        while (j-- > 0)
                        {
                            if (qzArr[j] == browseCountryControl[i])
                            {
                                browseCityControlModel.IsVisa = true;
                            }
                        }
                    }
                    model.BrowseCountrys.Add(browseCityControlModel);
                }
                model.IsNotVisa = chk_null.Checked;
                //国际线路成人定金
                model.AdultPrice = Utils.GetDecimal(Utils.GetFormValue(txt_AdultDeposit.UniqueID), -1);
                //国际线路儿童定金
                model.ChildrenPrice = Utils.GetDecimal(Utils.GetFormValue(txt_ChildrenDeposit.UniqueID), -1);
            }
            else
            {
                //主要浏览城市
                IList <MBrowseCityControl> browseCityControl = new List <MBrowseCityControl>();
                string[] browseCitys = Utils.GetFormValue(hd_BrowseCitys.UniqueID).Split(',');
                int      i           = browseCitys.Length;
                while (i-- > 0)
                {
                    MBrowseCityControl browseCityControlModel = new MBrowseCityControl();
                    //拆分城市县
                    int[] array = Utils.StringArrToIntArr(browseCitys[i].Split('|'));
                    if (array.Length > 1)
                    {
                        //县Id
                        browseCityControlModel.CountyId = array[0];
                        //城市Id
                        browseCityControlModel.CityId = array[1];
                    }
                    else
                    {
                        //城市Id
                        browseCityControlModel.CityId = Utils.GetInt(browseCitys[i]);
                    }

                    browseCityControl.Add(browseCityControlModel);
                }
                model.BrowseCitys = browseCityControl;
            }
            //线路名称
            model.RouteName = Utils.GetFormValue(txt_LineName.UniqueID);

            //B2B显示控制
            model.B2B = (RouteB2BDisplay)Utils.GetInt(Utils.GetFormValue(dropB2B.UniqueID));
            //B2C显示控制
            model.B2C = (RouteB2CDisplay)Utils.GetInt(Utils.GetFormValue(dropB2C.UniqueID));
            //B2B排序值
            model.B2BOrder = Utils.GetInt(Utils.GetFormValue(txt_B2B.UniqueID));
            //B2C排序值
            model.B2COrder = Utils.GetInt(Utils.GetFormValue(txt_B2C.UniqueID));
            //推荐类型
            model.RecommendType = (RecommendType)Utils.GetInt(Utils.GetFormValue(ddl_Status.UniqueID));
            //出发交通
            model.StartTraffic = (TrafficType)Utils.GetInt(Utils.GetFormValue(ddl_DepartureTraffic.UniqueID));
            //返回交通
            model.EndTraffic = (TrafficType)Utils.GetInt(Utils.GetFormValue(ddl_ReturnTraffic.UniqueID));
            //出发城市
            string[] sCity = Utils.GetFormValue(hd_goCity.UniqueID).Split('|');
            model.StartCity     = Utils.GetInt(sCity[0]);
            model.StartCityName = sCity[1];
            //返回城市
            string[] eCity = Utils.GetFormValue(hd_returnCity.UniqueID).Split('|');
            model.EndCity     = Utils.GetInt(eCity[0]);
            model.EndCityName = eCity[1];
            //线路特色
            model.Characteristic = Utils.GetFormValue(txt_LineFeatures.UniqueID);
            //天数
            model.Day = Utils.GetInt(Utils.GetFormValue(txt_days.UniqueID));
            //夜数
            model.Late = Utils.GetInt(Utils.GetFormValue(txt_nights.UniqueID));
            //线路主题
            model.Themes = GetTheme();
            //报价包含
            string fITOrTeam = Utils.GetFormValue("hd_FITOrTeam").Trim();
            //发布人账号
            model.OperatorId = Utils.GetFormValue(hiddropPublisher.UniqueID);
            //实例化
            model.ServiceStandard = new MServiceStandard();
            if (fITOrTeam == "FIT")
            {
                model.FitQuotation = Utils.GetFormValue(txt_FIT.UniqueID);
            }
            else
            {
                //用车
                model.ServiceStandard.CarContent = Utils.GetFormValue("txt_car");
                //其他包含
                model.ServiceStandard.IncludeOtherContent = Utils.GetFormValue("txt_qt");
                //用餐
                model.ServiceStandard.DinnerContent = Utils.GetFormValue("txt_yc");
                //导游
                model.ServiceStandard.GuideContent = Utils.GetFormValue("txt_dy");
                //住宿
                model.ServiceStandard.ResideContent = Utils.GetFormValue("txt_zs");
                //景点
                model.ServiceStandard.SightContent = Utils.GetFormValue("txt_jd");
                //往返交通
                model.ServiceStandard.TrafficContent = Utils.GetFormValue("txt_fhjt");
            }
            //报价不包含
            model.ServiceStandard.NotContainService = Utils.GetFormValue(txt_PriceExcluding.UniqueID);
            //赠送项目
            model.ServiceStandard.GiftInfo = Utils.GetFormValue(txt_GiftItems.UniqueID);
            //儿童及其他安排
            model.ServiceStandard.ChildrenInfo = Utils.GetFormValue(txt_OtherArr.UniqueID);
            //购物安排
            model.ServiceStandard.ShoppingInfo = Utils.GetFormValue(txt_ShoppingArr.UniqueID);
            //自费项目
            model.ServiceStandard.ExpenseItem = Utils.GetFormValue(txt_ThisConsumption.UniqueID);
            //销售商须知(只有组团社用到)
            model.VendorsNotes = Utils.GetFormValue(txt_Notes.UniqueID);
            //备注
            model.ServiceStandard.Notes = Utils.GetFormValue(txt_Remarks.UniqueID);
            //销售区域
            model.Citys = GetSalesArea();
            //行程类型
            string travelType = Utils.GetFormValue("hd_TravelContent").Trim();
            #endregion
            if (!isAllUpdata)
            {
                #region 散拼计划修改
                #region 团队信息
                //公司编号
                model.Publishers = companyid;
                //团队人数
                model.TourNum = Utils.GetInt(Utils.GetFormValue(txt_orderPeopleNum.UniqueID));
                //报名截止时间
                model.RegistrationEndDate = Utils.GetDateTime(Utils.GetFormValue(txt_registrationEndDate.UniqueID));
                if (!model.IsLimit)
                {
                    //余位
                    model.MoreThan = Utils.GetInt(Utils.GetFormValue(txt_moreThan.UniqueID));
                }
                //留位
                model.SaveNum = Utils.GetInt(Utils.GetFormValue(txt_saveNum.UniqueID));
                //成人市场价
                model.RetailAdultPrice = Utils.GetDecimal(Utils.GetFormValue(txt_retailAdultPrice.UniqueID));
                //成人结算价
                model.SettlementAudltPrice = Utils.GetDecimal(Utils.GetFormValue(txt_settlementAudltPrice.UniqueID));
                //儿童市场价
                model.RetailChildrenPrice = Utils.GetDecimal(Utils.GetFormValue(txt_retailChildrenPrice.UniqueID));
                //儿童结算价
                model.SettlementChildrenPrice = Utils.GetDecimal(Utils.GetFormValue(txt_settlementChildrenPrice.UniqueID));
                //单房差
                model.MarketPrice = Utils.GetDecimal(Utils.GetFormValue(txt_marketPrice.UniqueID));
                //集合说明
                model.SetDec = Utils.GetFormValue(txt_setDec.UniqueID);
                //线路销售备注
                model.TourNotes = Utils.GetFormValue(txt_tourNotes.UniqueID);
                //领队全陪
                model.TeamLeaderDec = Utils.GetFormValue(txt_teamLeaderDec.UniqueID);
                //航班出发时间
                model.StartDate = Utils.GetFormValue(txt_startDate.UniqueID);
                //航班返回时间
                model.EndDate = Utils.GetFormValue(txt_endDate.UniqueID);
                //收客状态
                model.PowderTourStatus = (PowderTourStatus)Utils.GetInt(Utils.GetFormValue(ddl_powderTourStatus.UniqueID), 3);
                //国际线路成人定金
                model.AdultPrice = Utils.GetDecimal(Utils.GetFormValue(txt_AdultDeposit.UniqueID), -1);
                //国际线路儿童定金
                model.ChildrenPrice = Utils.GetDecimal(Utils.GetFormValue(txt_ChildrenDeposit.UniqueID), -1);
                #endregion
                if (travelType == "SAE")
                {
                    //行程简易版
                    model.StandardStroke = Utils.EditInputText(
                        Request.Form[txt_BriefnessTravel.UniqueID] != null
                        &&
                        Request.Form[txt_BriefnessTravel.UniqueID].ToString().Length > 0 ?
                        Request.Form[txt_BriefnessTravel.UniqueID] :
                        string.Empty);
                    isSave = bll.UpdatePowder(model);
                }
                else
                {
                    //行程内容标准
                    model.StandardPlans = GetTravel();
                    isSave = bll.UpdatePowder(model);
                }
                #endregion
            }
            else
            {
                #region 批量修改散拼计划
                if (travelType == "SAE")
                {
                    //行程简易版
                    model.StandardStroke = Utils.EditInputText(
                        Request.Form[txt_BriefnessTravel.UniqueID] != null
                        &&
                        Request.Form[txt_BriefnessTravel.UniqueID].ToString().Length > 0 ?
                        Request.Form[txt_BriefnessTravel.UniqueID] :
                        string.Empty);
                }
                else
                {
                    //行程内容标准
                    model.StandardPlans = GetTravel();
                }
                #endregion
                isSave = bll.UpdateStandardPlan(model, tourIds);
            }
            Response.Clear();
            Response.Write(isSave.ToString());
            Response.End();
        }
Exemplo n.º 11
0
        /// <summary>
        /// 添加保存
        /// </summary>
        private void AddSave()
        {
            MRoute routeModel = EyouSoft.BLL.NewTourStructure.BRoute.CreateInstance().GetModel(Utils.GetFormValue("RouteId"));

            if (routeModel != null)
            {
                //提前天数
                int         advanceDayRegistration = routeModel.AdvanceDayRegistration;
                MPowderList model = new MPowderList();

                #region 线路信息赋值
                //线路Id
                model.RouteId        = Utils.GetFormValue("RouteId");
                model.Characteristic = routeModel.Characteristic;
                //线路名称
                model.RouteName = routeModel.RouteName;
                //专线类型
                model.AreaId   = routeModel.AreaId;
                model.AreaName = routeModel.AreaName;
                //发布人编号
                model.OperatorId   = routeModel.OperatorId;
                model.OperatorName = routeModel.OperatorName;
                //公司编号
                model.Publishers     = CompanyId;
                model.BrowseCitys    = routeModel.BrowseCitys;
                model.BrowseCountrys = routeModel.BrowseCountrys;
                model.Citys          = routeModel.Citys;
                model.ClickNum       = 0;
                model.EndCity        = routeModel.EndCity;
                model.EndCityName    = routeModel.EndCityName;
                model.Day            = routeModel.Day;
                model.EndTraffic     = routeModel.EndTraffic;
                model.FitQuotation   = routeModel.FitQuotation;
                model.IssueTime      = DateTime.Now;
                model.Late           = routeModel.Late;
                //收客状态
                model.PowderTourStatus = PowderTourStatus.收客;
                model.RecommendType    = RecommendType.新品;
                model.RouteImg         = routeModel.RouteImg;
                model.RouteImg1        = routeModel.RouteImg1;
                model.RouteImg2        = routeModel.RouteImg2;
                model.ServiceStandard  = routeModel.ServiceStandard;
                model.StandardPlans    = routeModel.StandardPlans;
                model.StartTraffic     = routeModel.StartTraffic;
                model.TeamLeaderDec    = routeModel.TeamPlanDes;
                model.Themes           = routeModel.Themes;
                model.VendorsNotes     = routeModel.VendorsNotes;

                EyouSoft.Model.CompanyStructure.CompanyInfo comModel = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetModel(CompanyId);
                if (comModel != null)
                {
                    model.CompanyLev   = comModel.CompanyLev;
                    model.CompanyBrand = comModel.CompanyBrand;
                    model.Introduction = comModel.Introduction;
                }

                #endregion
                //团队人数
                model.TourNum = Utils.GetInt(Utils.GetFormValue("txt_tourNum"));

                //是否限制人数
                model.IsLimit = Utils.GetFormValue("hd_isLimit") == "0";
                if (!model.IsLimit)
                {
                    //余位
                    model.MoreThan = Utils.GetInt(Utils.GetFormValue("txt_moreThan"));
                }
                //成人市场价
                model.RetailAdultPrice = Utils.GetDecimal(Utils.GetFormValue("txt_retailAdultPrice"));
                //成人结算价
                model.SettlementAudltPrice = Utils.GetDecimal(Utils.GetFormValue("txt_settlementAudltPrice"));
                //儿童市场价
                model.RetailChildrenPrice = Utils.GetDecimal(Utils.GetFormValue("txt_retailChildrenPrice"));
                //儿童结算价
                model.SettlementChildrenPrice = Utils.GetDecimal(Utils.GetFormValue("txt_settlementChildrenPrice"));
                //单房差
                model.MarketPrice = Utils.GetDecimal(Utils.GetFormValue("txt_marketPrice"));
                //集合说明
                model.SetDec = Utils.GetFormValue("txt_marketPrice");
                //线路销售备注
                model.TourNotes = Utils.GetFormValue("txt_tourNotes");
                //领队全陪
                model.TeamLeaderDec = Utils.GetFormValue("txt_tourNotes");

                model.StartDate = Utils.GetFormValue(this.txt_startDate.UniqueID);
                model.EndDate   = Utils.GetFormValue(this.txt_endDate.UniqueID);

                //出团日期
                string[] leaveDateStr = Utils.GetFormValue("leaveDate").Split(',');

                //计算有几个出团日期
                int i = leaveDateStr.Length;
                //出团日期
                DateTime[] leaveDate = new DateTime[i];
                //报名截止时间
                DateTime[] registrationEndDate = new DateTime[i];
                //遍历
                while (i-- > 0)
                {
                    //出团日期
                    leaveDate[i] = Utils.GetDateTime(leaveDateStr[i]);
                    //计算截止时间
                    registrationEndDate[i] = leaveDate[i] - new TimeSpan(advanceDayRegistration, 0, 0, 0);

                    //周六继续提前1天
                    if ((int)registrationEndDate[i].DayOfWeek == 6)
                    {
                        registrationEndDate[i] = registrationEndDate[i] - new TimeSpan(1, 0, 0, 0);
                    }
                    //周日继续提前2天
                    if ((int)registrationEndDate[i].DayOfWeek == 0)
                    {
                        registrationEndDate[i] = registrationEndDate[i] - new TimeSpan(2, 0, 0, 0);
                    }
                }
                model.IP = Page.Request.UserHostAddress;
                bool ret = EyouSoft.BLL.NewTourStructure.BPowderList.CreateInstance().AddBatchPowder(model, leaveDate, registrationEndDate);
                Response.Clear();
                if (ret)
                {
                    Response.Write(true);
                }
                else
                {
                    Response.Write(false);
                }
                Response.End();
            }
        }