Exemple #1
0
        /// <summary>
        /// 保存
        /// </summary>
        private void Save(string Operating)
        {
            /*
             * 初始化保存Model
             * 当存在线路Id获取原线路实体
             * 否则实例化一个新的线路实体
             */
            MRoute model = Utils.GetQueryStringValue("routeId").Length > 0 ?
                           EyouSoft.BLL.NewTourStructure.BRoute.CreateInstance().GetModel(Utils.GetQueryStringValue("routeId"))
                :
                           new MRoute();

            //确保原线路实体不为空
            if (model != null)
            {
                #region 实体赋值
                //写死
                model.B2BOrder = 50;
                model.B2COrder = 50;
                //线路类型
                model.RouteType = (AreaType)Utils.GetInt(Utils.GetQueryStringValue("travelRangeType"));
                #region 主要浏览
                if (model.RouteType == AreaType.国际线)
                {
                    #region 主要浏览国家
                    //主要浏览国家信息
                    string[] browseCountryControl = Utils.GetFormValue(hd_BrowseCountrys.UniqueID).Split(',');
                    if (browseCountryControl.Length > 0)
                    {
                        //主要浏览国家
                        model.BrowseCountrys = new List <MBrowseCountryControl>();
                        //主要浏览国家个数
                        int i = browseCountryControl.Length;
                        //主要浏览国家签证信息
                        string qzArr = Utils.GetFormValue(hd_qz.UniqueID);
                        //递减遍历
                        while (i-- > 0)
                        {
                            //国家实体
                            MBrowseCountryControl browseCityControlModel = new MBrowseCountryControl();
                            //国家id
                            browseCityControlModel.CountryId = Utils.GetInt(browseCountryControl[i]);

                            //免签没有选择,才给其他赋值,否则直接不赋值
                            if (!chk_null.Checked)
                            {
                                //判断是否签证
                                if (qzArr.IndexOf(browseCountryControl[i] + ",") >= 0)
                                {
                                    browseCityControlModel.IsVisa = true;
                                }
                            }

                            model.BrowseCountrys.Add(browseCityControlModel);
                        }
                    }
                    else
                    {
                        model.BrowseCountrys = null;
                    }
                    //是否免签
                    if (chk_null.Checked)
                    {
                        model.IsNotVisa = true;
                    }
                    else
                    {
                        model.IsNotVisa = false;
                    }
                    //国际线路成人定金
                    model.AdultPrice = Utils.GetDecimal(Utils.GetFormValue(txt_AdultDeposit.UniqueID), -1);
                    //国际线路儿童定金
                    model.ChildrenPrice = Utils.GetDecimal(Utils.GetFormValue(txt_ChildrenDeposit.UniqueID), -1);
                    #endregion
                }
                else
                {
                    #region 主要浏览城市
                    string[] browseCitys = Utils.GetFormValue(hd_BrowseCitys.UniqueID).Split(',');
                    int      i           = browseCitys.Length;
                    if (i > 0)
                    {
                        //主要浏览城市
                        IList <MBrowseCityControl> browseCityControl = new List <MBrowseCityControl>();


                        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;
                    }
                    else
                    {
                        model.BrowseCitys = null;
                    }
                    #endregion
                }
                #endregion
                //公司编号
                model.Publishers = SiteUserInfo.CompanyID;
                //发布人ID
                model.OperatorId = SiteUserInfo.ID;
                //发布人名称
                model.OperatorName = SiteUserInfo.CompanyName;
                //专线类型
                model.AreaId = Utils.GetInt(Utils.GetQueryStringValue("travelRangeId"));
                //线路名称
                model.RouteName = Utils.GetFormValue(txt_LineName.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.GroupNum = Utils.GetInt(Utils.GetFormValue(txt_MinNumberPeople.UniqueID));
                //团队参考价格
                model.IndependentGroupPrice = Utils.GetDecimal(Utils.GetFormValue(txt_ReferencePrice.UniqueID));
                //天数
                model.Day = Utils.GetInt(Utils.GetFormValue(txt_days.UniqueID));
                //夜数
                model.Late = Utils.GetInt(Utils.GetFormValue(txt_nights.UniqueID));
                //线路主题
                model.Themes = GetTheme();
                //提前几天报名
                model.AdvanceDayRegistration = Utils.GetInt(Utils.GetFormValue(txt_EarlyDays.UniqueID));
                //散客报名无需成团,铁定发团
                model.IsCertain = Utils.GetFormValue(chk_FITRegistration.UniqueID) == "true";
                //报价包含
                string fITOrTeam = Utils.GetFormValue("hd_FITOrTeam").Trim();
                //线路配图
                string[] imgs = Utils.GetFormValue(this.files.UniqueID + "$hidFileName").Split('|');
                if (imgs != null && imgs.Count() > 1)
                {
                    model.RouteImg  = imgs[0];
                    model.RouteImg1 = imgs[1];
                    model.RouteImg2 = imgs[1];
                }
                //model.RouteImg = Utils.GetFormValue(this.files.UniqueID + "$hidFileName").Length > 0 ? Utils.GetFormValue(this.files.UniqueID + "$hidFileName") : model.RouteImg == null ? string.Empty : model.RouteImg;
                //实例化
                model.ServiceStandard = new MServiceStandard();
                #region 行程
                if (fITOrTeam == "FIT")
                {
                    string strTmp = Utils.GetFormValue(txt_FIT.UniqueID);
                    model.FitQuotation = string.IsNullOrEmpty(strTmp)
                                             ? string.Empty
                                             : strTmp;
                    /*清空标准版原有信息*/
                    //用车
                    model.ServiceStandard.CarContent = string.Empty;
                    //其他包含
                    model.ServiceStandard.IncludeOtherContent = string.Empty;
                    //用餐
                    model.ServiceStandard.DinnerContent = string.Empty;
                    //导游
                    model.ServiceStandard.GuideContent = string.Empty;
                    //住宿
                    model.ServiceStandard.ResideContent = string.Empty;
                    //景点
                    model.ServiceStandard.SightContent = string.Empty;
                    //往返交通
                    model.ServiceStandard.TrafficContent = string.Empty;
                    /***********************************************************/
                }
                else
                {
                    /*清空简易版原有信息*/
                    model.FitQuotation = string.Empty;
                    /************************************************************/
                    //用车
                    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");
                }
                #endregion
                //报价不包含
                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);
                //销售区域
                if (routeSource == RouteSource.专线商添加 || model.RouteSource == RouteSource.专线商添加)
                {
                    model.Citys = GetSalesArea();
                }
                #endregion
                IRoute bll = EyouSoft.BLL.NewTourStructure.BRoute.CreateInstance();
                //行程类型
                string travelType = Utils.GetFormValue("hd_TravelContent").Trim();

                /*
                 * 操作结果变量
                 * >0=保存成功的线路Id,空字符串=保存失败,-2线路名已存在
                 */
                string isSave = "-1";
                //添加
                if (Operating == "AddSave")
                {
                    #region 添加
                    if (travelType == "SAE")
                    {
                        #region 行程简易版
                        model.FastPlan = Utils.EditInputText(Request.Form[txt_AddTourismBriefnessTravel.UniqueID] ?? string.Empty);
                        if ((RouteSource)Utils.GetInt(Utils.GetQueryStringValue("RouteSource"), 1) == RouteSource.专线商添加)
                        {
                            //专线添加
                            isSave = (!bll.IsExits(SiteUserInfo.CompanyID, model.RouteName)) ? bll.AddQuickRoute(model) : "-2";
                        }
                        else
                        {
                            //地接添加
                            isSave = (!bll.IsExits(SiteUserInfo.CompanyID, model.RouteName)) ? bll.AddGroundQuickRoute(model) : "-2";
                        }
                        #endregion
                    }
                    else
                    {
                        #region 行程内容标准
                        model.StandardPlans = GetTravel();
                        if ((RouteSource)Utils.GetInt(Utils.GetQueryStringValue("RouteSource"), 1) == RouteSource.专线商添加)
                        {
                            //专线添加
                            isSave = (!bll.IsExits(SiteUserInfo.CompanyID, model.RouteName)) ? bll.AddStandardRoute(model) : "-2";
                        }
                        else
                        {
                            //地接添加
                            isSave = (!bll.IsExits(SiteUserInfo.CompanyID, model.RouteName)) ? bll.AddGroundStandardRoute(model) : "-2";
                        }
                        #endregion
                    }
                    #endregion
                }
                else
                {
                    #region 修改
                    if (travelType == "SAE")
                    {
                        #region 行程简易版
                        model.ReleaseType = ReleaseType.Quick;
                        //清除原先标准版数据
                        model.StandardPlans = null;
                        model.FastPlan      = Utils.EditInputText(
                            Request.Form[txt_AddTourismBriefnessTravel.UniqueID] != null
                            &&
                            Request.Form[txt_AddTourismBriefnessTravel.UniqueID].ToString().Length > 0 ?
                            Request.Form[txt_AddTourismBriefnessTravel.UniqueID] :
                            string.Empty);
                        #endregion
                    }
                    else
                    {
                        #region 行程标准版
                        model.ReleaseType = ReleaseType.Standard;
                        //清除原先简易版数据
                        model.FastPlan      = string.Empty;
                        model.StandardPlans = GetTravel();
                        #endregion
                    }
                    #endregion
                    isSave = bll.UpdateRoute(model) ? model.RouteId : "-2";
                }
                Response.Clear();
                Response.Write(isSave.ToString());
                Response.End();
            }
            Response.Clear();
            Response.Write("");
            Response.End();
        }
Exemple #2
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();
        }