Exemple #1
0
        /// <summary>
        /// 修改线路区域
        /// </summary>
        /// <param name="model">线路区域实体</param>
        /// <returns>返回受影响行数</returns>
        public virtual int UpdateSysArea(EyouSoft.Model.SystemStructure.SysArea model)
        {
            if (model == null)
            {
                return(0);
            }

            var strSql = new StringBuilder();

            strSql.Append(
                @" if not exists (select 1 from tbl_SysArea where AreaName = @AreaName AND RouteType = @RouteType AND [ID] <> @AreaId) ");
            strSql.Append(" begin ");
            strSql.Append(@" UPDATE [tbl_SysArea] SET [AreaName] = @AreaName,[RouteType] = @RouteType WHERE [ID] = @AreaId; ");
            if (model.VisitCity != null && model.VisitCity.Count > 0)
            {
                strSql.Append(SqlSysAreaVisitCityDel);
                foreach (var t in model.VisitCity)
                {
                    if (t == null)
                    {
                        continue;
                    }

                    strSql.AppendFormat(SqlSysAreaVisitCityAdd, t.CountryId, t.ProvinceId, t.CityId, t.CountyId);
                }
            }
            strSql.Append(" end ");
            DbCommand dc = base.SystemStore.GetSqlStringCommand(strSql.ToString());

            base.SystemStore.AddInParameter(dc, "AreaName", DbType.String, model.AreaName);
            base.SystemStore.AddInParameter(dc, "RouteType", DbType.Byte, (int)model.RouteType);
            base.SystemStore.AddInParameter(dc, "AreaId", DbType.Int32, model.AreaId);

            return(DbHelper.ExecuteSql(dc, base.SystemStore));
        }
Exemple #2
0
        /// <summary>
        /// 线路区域对应的有效线路(地接社)
        /// </summary>
        /// <returns></returns>
        public IList <EyouSoft.Model.TourStructure.AreaStatInfo> GetCurrentUserRouteByAreaStats()
        {
            string companyId = new EyouSoft.Security.Membership.Utility().GetCurrentUserCompanyId();

            if (string.IsNullOrEmpty(companyId))
            {
                return(null);
            }

            IList <EyouSoft.Model.TourStructure.AreaStatInfo> stats = dal.GetRouteByAreaStats(companyId, new EyouSoft.Security.Membership.Utility().GetCurrentUserArea());

            if (stats != null && stats.Count > 0)
            {
                foreach (EyouSoft.Model.TourStructure.AreaStatInfo tmp in stats)
                {
                    EyouSoft.Model.SystemStructure.SysArea areaInfo = EyouSoft.BLL.SystemStructure.SysArea.CreateInstance().GetSysAreaModel(tmp.AreaId);

                    if (areaInfo != null)
                    {
                        tmp.AreaName = areaInfo.AreaName;
                    }
                }
            }

            return(stats);
        }
Exemple #3
0
        /// <summary>
        /// 通过查询命令返回实体集合
        /// </summary>
        /// <param name="dc">查询命令</param>
        /// <returns></returns>
        private IList <EyouSoft.Model.SystemStructure.SysArea> GetQueryList(DbCommand dc)
        {
            IList <Model.SystemStructure.SysArea> List = new List <Model.SystemStructure.SysArea>();

            using (IDataReader dr = DbHelper.ExecuteReader(dc, base.SystemStore))
            {
                Model.SystemStructure.SysArea model = null;
                while (dr.Read())
                {
                    model = new EyouSoft.Model.SystemStructure.SysArea();
                    if (!dr.IsDBNull(0))
                    {
                        model.AreaId = dr.GetInt32(0);
                    }
                    model.AreaName = dr[1].ToString();
                    if (!dr.IsDBNull(2))
                    {
                        model.RouteType = (Model.SystemStructure.AreaType)((int)dr.GetByte(2));
                    }
                    if (!dr.IsDBNull(3))
                    {
                        model.VisitCity = new List <Model.SystemStructure.SysAreaVisitCity>();
                        var xRoot = XElement.Parse(dr.GetString(3));
                        var xRows = Common.Utility.GetXElements(xRoot, "row");
                        if (xRows != null && xRows.Any())
                        {
                            foreach (var t in xRows)
                            {
                                model.VisitCity.Add(new Model.SystemStructure.SysAreaVisitCity
                                {
                                    CountryId =
                                        Common.Utility.GetInt(
                                            Common.Utility.GetXAttributeValue(t, "CountryId")),
                                    ProvinceId =
                                        Common.Utility.GetInt(
                                            Common.Utility.GetXAttributeValue(t, "ProvinceId")),
                                    CityId =
                                        Common.Utility.GetInt(
                                            Common.Utility.GetXAttributeValue(t, "CityId")),
                                    CountyId =
                                        Common.Utility.GetInt(
                                            Common.Utility.GetXAttributeValue(t, "CountyId"))
                                });
                            }
                        }
                    }

                    List.Add(model);
                }
                model = null;
            }
            return(List);
        }
Exemple #4
0
 protected string GetAreaName(int areaId)
 {
     EyouSoft.Model.SystemStructure.SysArea areaModel = areaBll.GetSysAreaModel(areaId);
     if (areaModel != null)
     {
         return(areaModel.AreaName);
     }
     else
     {
         return("");
     }
 }
Exemple #5
0
        protected bool IsTour  = false;                //非组团社登录
        protected void Page_Load(object sender, EventArgs e)
        {
            TourAreaId = EyouSoft.Common.Function.StringValidate.GetIntValue(Request.QueryString["TourAreaId"]);
            #region 页面初始化控件赋值
            UCRightList1.IsPinpai   = true;
            UCRightList1.IsToolbar  = false;
            UCRightList1.TourAreaId = TourAreaId.ToString();
            UCRightList1.CityID     = CityId;
            #endregion
            if (!Page.IsPostBack)
            {
                if (TourAreaId != 0)
                {
                    EyouSoft.Model.SystemStructure.SysArea SysAreamodel = EyouSoft.BLL.SystemStructure.SysArea.CreateInstance().GetSysAreaModel(TourAreaId);
                    if (SysAreamodel != null)
                    {
                        switch ((int)SysAreamodel.RouteType)
                        {
                        case 0:
                            RouteTypeName = "国内";
                            break;

                        case 1:
                            RouteTypeName = "国际";
                            break;

                        case 2:
                            RouteTypeName = "周边";
                            break;

                        default:
                            RouteTypeName = "";
                            break;
                        }
                        strRourListName        = SysAreamodel.AreaName;
                        this.hidRourName.Value = SysAreamodel.AreaName;
                    }
                }
                this.RouteList1.IsDefault      = true;
                this.TourSearchKeys1.IsRoute   = true;
                this.TourSearchKeys1.IsDefault = true;
                NewPublicCenter master = (this.Master as NewPublicCenter);
                master.HeadMenuIndex = 2;
                BindCompanyAndTour();
                GetUserRole();
            }
            string tourAreaName = this.hidRourName.Value;
            this.Page.Title = string.Format(PageTitle.RouteList_Title, CityModel.CityName, tourAreaName, tourAreaName, tourAreaName);
            AddMetaTag("description", string.Format(PageTitle.RouteList_Des, CityModel.CityName, tourAreaName, tourAreaName, tourAreaName));
            AddMetaTag("keywords", string.Format(PageTitle.RouteList_Keywords, tourAreaName, tourAreaName, tourAreaName));
        }
Exemple #6
0
        /// <summary>
        /// 新增线路区域
        /// </summary>
        /// <param name="model">线路区域实体</param>
        /// <returns>返回新加线路区域ID</returns>
        public virtual int AddSysArea(EyouSoft.Model.SystemStructure.SysArea model)
        {
            if (model == null)
            {
                return(0);
            }

            var strSql = new StringBuilder();

            strSql.Append(" declare @AreaId int ; set @AreaId = 0 ");
            strSql.Append(@" if not exists (select 1 from tbl_SysArea where AreaName = @AreaName AND RouteType = @RouteType) ");
            strSql.Append(" begin ");
            strSql.Append(
                @" INSERT INTO [tbl_SysArea]([AreaName],[RouteType]) VALUES (@AreaName,@RouteType); ");
            strSql.Append(" set @AreaId = @@IDENTITY; ");
            if (model.VisitCity != null && model.VisitCity.Count > 0)
            {
                foreach (var t in model.VisitCity)
                {
                    if (t == null)
                    {
                        continue;
                    }

                    strSql.AppendFormat(SqlSysAreaVisitCityAdd, t.CountryId, t.ProvinceId, t.CityId, t.CountyId);
                }
            }
            strSql.Append(" end ");
            strSql.Append(" select @AreaId; ");

            DbCommand dc = base.SystemStore.GetSqlStringCommand(strSql.ToString());

            base.SystemStore.AddInParameter(dc, "AreaName", DbType.String, model.AreaName);
            base.SystemStore.AddInParameter(dc, "RouteType", DbType.Byte, (int)model.RouteType);

            object obj = DbHelper.GetSingle(dc, base.SystemStore);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Exemple #7
0
        /// <summary>
        /// 修改线路区域
        /// </summary>
        /// <param name="model">线路区域实体</param>
        /// <returns>0:Error;1:Success</returns>
        public int UpdateSysArea(EyouSoft.Model.SystemStructure.SysArea model)
        {
            if (model == null)
            {
                return(0);
            }

            int Result = dal.UpdateSysArea(model);

            if (Result > 0)
            {
                EyouSoft.Cache.Facade.EyouSoftCache.Remove(EyouSoft.CacheTag.System.SystemArea);
                EyouSoft.Cache.Facade.EyouSoftCache.Remove(EyouSoft.CacheTag.System.SystemCity);
                return(1);
            }
            else
            {
                return(0);
            }
        }
Exemple #8
0
        /// <summary>
        /// 新增线路区域
        /// </summary>
        /// <param name="model">线路区域实体</param>
        /// <returns>0:Error;1:Success</returns>
        public int AddSysArea(EyouSoft.Model.SystemStructure.SysArea model)
        {
            if (model == null)
            {
                return(0);
            }

            int Result = dal.AddSysArea(model);

            if (Result > 0)
            {
                model.AreaId = Result;
                EyouSoft.Cache.Facade.EyouSoftCache.Remove(EyouSoft.CacheTag.System.SystemArea);
                return(1);
            }
            else
            {
                return(0);
            }
        }
Exemple #9
0
        /// <summary>
        /// 获取批发商行为分析列表
        /// </summary>
        /// <param name="PageSize">每页条数</param>
        /// <param name="PageIndex">当前页数</param>
        /// <param name="RecordCount">总记录数</param>
        /// <param name="OrderIndex">排序索引(0/1:登录时间升/降序;2/3:成交订单升/降序;4/5:留位订单升/降序;6/7:留位过期订单升/降序;8/9:不受理订单升/降序;10/11:登录次数升/降序;12/13:被查看次数升/降序;)</param>
        /// <param name="SellCompanyName">批发商名称(为null不作条件)</param>
        /// <param name="ManagerUserCityIds">管理员用户城市区域Id集合(为null或者空不作条件)</param>
        /// <param name="SellCityId">销售城市ID(小于等于0不作条件,且售城市ID小于等于0,那么区域ID不论为何值均不作条件)</param>
        /// <param name="AreaId">区域ID(小于等于0不作条件,且售城市ID小于等于0,那么区域ID不论为何值均不作条件)</param>
        /// <param name="StartTime">下单开始时间(为null不作条件)</param>
        /// <param name="EndTime">下单结束时间(为null不作条件)</param>
        /// <returns>返回批发商行为分析实体集合</returns>
        public IList <Model.TourStructure.WholesalersStatistics> GetWholesalersStatistics(int PageSize, int PageIndex
                                                                                          , ref int RecordCount, int OrderIndex, string SellCompanyName, int[] ManagerUserCityIds, int SellCityId, int AreaId
                                                                                          , DateTime?StartTime, DateTime?EndTime)
        {
            string strIds = string.Empty;

            if (ManagerUserCityIds != null && ManagerUserCityIds.Length > 0)
            {
                foreach (int i in ManagerUserCityIds)
                {
                    strIds += i.ToString() + ",";
                }
            }
            strIds = strIds.TrimEnd(',');

            var stats = dal.GetWholesalersStatistics(PageSize, PageIndex, ref RecordCount, OrderIndex, SellCompanyName, strIds, SellCityId, AreaId, StartTime, EndTime);

            #region 线路区域名称处理
            if (stats != null && stats.Count > 0)
            {
                EyouSoft.IBLL.SystemStructure.ISysArea sysAreaBLL = EyouSoft.BLL.SystemStructure.SysArea.CreateInstance();
                foreach (var tmp in stats)
                {
                    if (tmp.AreaStatinfo != null && tmp.AreaStatinfo.Count > 0)
                    {
                        foreach (var tmp1 in tmp.AreaStatinfo)
                        {
                            EyouSoft.Model.SystemStructure.SysArea sysAreaInfo = sysAreaBLL.GetSysAreaModel(tmp1.AreaId);

                            if (sysAreaInfo != null)
                            {
                                tmp1.AreaName = sysAreaInfo.AreaName;
                            }
                        }
                    }
                }
            }
            #endregion

            return(stats);
        }
Exemple #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string AreaValue = Server.UrlDecode(Request.QueryString["AreaValue"]);

            if (!String.IsNullOrEmpty(AreaValue))
            {
                EyouSoft.Model.SystemStructure.SysArea model = EyouSoft.BLL.SystemStructure.SysArea.CreateInstance().GetSysAreaModel(Utils.GetInt(AreaValue, 0));
                if (model != null)
                {
                    if (model.RouteType == EyouSoft.Model.SystemStructure.AreaType.国际线)
                    {
                        AreaType = 1;
                    }
                    else
                    {
                        AreaType = 0;
                    }
                }
            }
            flag        = Utils.InputText(Request.QueryString["flag"]);
            ReleaseType = Utils.InputText(Request.QueryString["ReleaseType"]);
            ContaierID  = Utils.InputText(Request.QueryString["ContaierID"]);
        }
Exemple #11
0
        private void Add(string AreaName)
        {
            //新增
            string strErr = "";

            if (AreaName == "")
            {
                strErr += "线路区域名称不能为空!\\n";
            }
            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            EyouSoft.Model.SystemStructure.SysArea areaModel = new EyouSoft.Model.SystemStructure.SysArea();
            areaModel.AreaName  = AreaName;
            areaModel.RouteType = EyouSoft.Model.SystemStructure.AreaType.国内短线;
            int reAddInt = EyouSoft.BLL.SystemStructure.SysArea.CreateInstance().AddSysArea(areaModel);

            //释放资源
            areaModel = null;
            return;
        }
Exemple #12
0
        /// <summary>
        /// 获得指定线路区域ID的线路区域信息集合
        /// </summary>
        /// <param name="items">线路区域ID集合</param>
        public IList <EyouSoft.Model.SystemStructure.AreaBase> GetAreaList(IList <EyouSoft.Model.SystemStructure.AreaBase> items)
        {
            //从缓存中获取线路区域名称,线路区域类型
            if (items != null && items.Count > 0)
            {
                int count = items.Count;
                EyouSoft.Model.SystemStructure.SysArea areaModel = null;
                for (int index = 0; index < count; index++)
                {
                    if (items[index] != null)
                    {
                        areaModel = this.GetSysAreaModel(items[index].AreaId);
                        if (areaModel != null)
                        {
                            items[index].AreaName  = areaModel.AreaName;
                            items[index].RouteType = areaModel.RouteType;
                        }
                    }
                }
                areaModel = null;
            }

            return(items);
        }
Exemple #13
0
        /// <summary>
        /// 获得缓存中指定线路区域ID所有的线路区域信息
        /// </summary>
        /// <param name="items">城市ID集合</param>
        private List <EyouSoft.Model.SystemStructure.AreaBase> GetCacheAreaAllInfo(List <EyouSoft.Model.SystemStructure.AreaBase> items)
        {
            //从缓存中获取省份ID,省份名称,城市名称
            if (items != null && items.Count > 0)
            {
                int count = items.Count;
                EyouSoft.Model.SystemStructure.SysArea areaModel = null;
                for (int index = 0; index < count; index++)
                {
                    if (items[index] != null)
                    {
                        areaModel = EyouSoft.BLL.SystemStructure.SysArea.CreateInstance().GetSysAreaModel(items[index].AreaId);
                        if (areaModel != null)
                        {
                            items[index].AreaName  = areaModel.AreaName;
                            items[index].RouteType = areaModel.RouteType;
                        }
                    }
                }
                areaModel = null;
            }

            return(items);
        }
Exemple #14
0
        /// <summary>
        /// 绑定线路区域下的5个广告位及团队信息
        /// </summary>
        protected void BindCompanyAndTour()
        {
            int    recordCount = 0;
            string SearchType  = Request.QueryString["SearchType"];
            int    intSearchId = 0;
            string SearchId    = Request.QueryString["Id"];

            intSearchId = EyouSoft.Common.Function.StringValidate.GetIntValue(SearchId);

            StringBuilder strEmpty       = new StringBuilder();
            string        ErrorInfo      = "";
            int?          SearchTourArea = null;

            if (TourAreaId > 0)
            {
                EyouSoft.Model.SystemStructure.SysArea Model = EyouSoft.BLL.SystemStructure.SysArea.CreateInstance().GetSysAreaModel(TourAreaId);
                if (Model != null)
                {
                    ErrorInfo += "“" + Model.AreaName + "”";
                    this.hidRourName.Value = Model.AreaName;
                    strRourListName        = Model.AreaName;
                }
                Model          = null;
                SearchTourArea = TourAreaId;
            }

            EyouSoft.Model.CompanyStructure.QueryParamsAllCompany CompanySearch = new EyouSoft.Model.CompanyStructure.QueryParamsAllCompany();
            CompanySearch.CityId = CityId;
            CompanySearch.AreaId = TourAreaId;
            IList <EyouSoft.Model.CompanyStructure.CompanyPicTxt> CompanyList = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetListCityAreaAdvRouteAgency(CompanySearch);
            StringBuilder StrCompanyList = new StringBuilder();

            if (CompanyList != null && CompanyList.Count > 0)
            {
                int CompanyCount = CompanyList.Count;
                for (int i = 0; i < CompanyList.Count; i++)
                {
                    bool   isSelect    = false;
                    string classNmae   = "pingpaibg";
                    string strisSelect = " onmouseout=\"this.style.border='1px solid #ccc'\" onmouseover=\"this.style.border='1px  solid #FFAE78'\"";
                    if (SearchType != null && SearchType.Equals("Company", StringComparison.OrdinalIgnoreCase))
                    {
                        if (CompanyList[i].ID == SearchId)
                        {
                            isSelect   = true;
                            ErrorInfo += "“" + CompanyList[i].CompanyName + "”";
                            //strEmpty.AppendFormat("“{0}”", CompanyList[i].CompanyName);
                            strisSelect = "";
                            classNmae   = "pingpaibgon";
                        }
                    }

                    StrCompanyList.AppendFormat("<li {0} ><div " + strisSelect + ">", isSelect ? " class=\"active\" " : "");
                    StrCompanyList.AppendFormat("<a href=\"{0}\"><img src=\"{1}\" width=\"114\" height=\"50\" border=\"0\" /></a>", "/TourManage/TourList.aspx?CityId=" + CityId + "&TourAreaId=" + TourAreaId + "&SearchType=Company&Id=" + CompanyList[i].ID, CompanyList[i].CompanyLogo.ImagePath != "" ? EyouSoft.Common.Domain.FileSystem + CompanyList[i].CompanyLogo.ImagePath : EyouSoft.Common.Utils.NoLogoImage100_55);
                    StrCompanyList.AppendFormat("<a href=\"{0}\"><p>{1}</p></a></div></li>", "/TourManage/TourList.aspx?CityId=" + CityId + "&TourAreaId=" + TourAreaId + "&SearchType=Company&Id=" + CompanyList[i].ID, CompanyList[i].CompanyName);
                }
            }
            CompanyList   = null;
            CompanySearch = null;


            FiveCompany = StrCompanyList.ToString();



            IList <EyouSoft.Model.TourStructure.TourBasicInfo> TourList = new List <EyouSoft.Model.TourStructure.TourBasicInfo>();

            if (!string.IsNullOrEmpty(SearchType))
            {
                //按主题类型
                if (SearchType.Equals("Theme", StringComparison.OrdinalIgnoreCase))
                {
                    TourList = EyouSoft.BLL.TourStructure.Tour.CreateInstance().GetToursByRouteTheme(PageSize, PageIndex, ref recordCount, CityId, SearchTourArea, intSearchId, false, true);
                }
                //按价格区间
                else if (SearchType.Equals("Price", StringComparison.OrdinalIgnoreCase))
                {
                    int?   MinPrice  = null;
                    int?   MaxPrice  = null;
                    string PriceType = "之间";
                    switch (SearchId)
                    {
                    case "1":
                        MinPrice = 1;
                        MaxPrice = 300;
                        break;

                    case "2":
                        MinPrice = 300;
                        MaxPrice = 800;
                        break;

                    case "3":
                        MinPrice = 800;
                        MaxPrice = 1600;
                        break;

                    case "4":
                        MinPrice = 1600;
                        MaxPrice = 3000;
                        break;

                    case "5":
                        MinPrice = 3000;
                        MaxPrice = 6000;
                        break;

                    case "6":
                        MinPrice  = 6000;
                        PriceType = "以上";
                        break;
                    }
                    TourList = EyouSoft.BLL.TourStructure.Tour.CreateInstance().GetToursByPriceRange(PageSize, PageIndex, ref recordCount, CityId, SearchTourArea, MinPrice, MaxPrice, false, true);
                    if (MinPrice != null || MaxPrice != null)
                    {
                        StringBuilder strPrice = new StringBuilder();
                        strPrice.AppendFormat("“价格在{0}{3}{1}{2}”", MinPrice == null ? "" : MinPrice.ToString(), MaxPrice == null ? "" : MaxPrice.ToString(), PriceType, PriceType == "之间" ? "-" : "");
                        ErrorInfo += strPrice.ToString();
                        strPrice   = null;
                    }
                }
                //按行程天数
                else if (SearchType.Equals("Day", StringComparison.OrdinalIgnoreCase))
                {
                    int DaysType = 0;
                    if (intSearchId == 5)
                    {
                        DaysType = 1;
                    }
                    if (intSearchId == 8) //首页5日游查询
                    {
                        intSearchId = 5;
                    }

                    TourList = EyouSoft.BLL.TourStructure.Tour.CreateInstance().GetToursByTourDays(PageSize, PageIndex, ref recordCount, CityId, SearchTourArea, DaysType, intSearchId, false, true);
                    if (intSearchId > 0)
                    {
                        StringBuilder strDays = new StringBuilder();
                        strDays.AppendFormat("“{0}”", intSearchId == 5 ? "5日游及以上" : intSearchId.ToString() + "日游");
                        ErrorInfo += strDays.ToString();
                        strDays    = null;
                    }
                }
                //按公司单位
                else if (SearchType.Equals("Company", StringComparison.OrdinalIgnoreCase))
                {
                    TourList = EyouSoft.BLL.TourStructure.Tour.CreateInstance().GetToursByCompanyId(PageSize, PageIndex, ref recordCount, CityId, SearchTourArea, SearchId, false, true);
                }
                else if (SearchType.Equals("More", StringComparison.OrdinalIgnoreCase))
                {
                    string RouteName = Utils.InputText(Request.QueryString["RouteName"]);
                    int    intDays   = 0;
                    string strDays   = Utils.InputText(Request.QueryString["Days"]);
                    if (!string.IsNullOrEmpty(strDays) && EyouSoft.Common.Function.StringValidate.IsInteger(strDays))
                    {
                        intDays = Convert.ToInt32(strDays);
                    }
                    int?SearchDay = null;
                    if (intDays > 0)
                    {
                        SearchDay = intDays;
                    }
                    string   CompanyName  = Utils.InputText(Request.QueryString["CompanyName"]);
                    DateTime?StartDate    = null;
                    string   strStartDate = Utils.InputText(Request.QueryString["StartDate"]);
                    if (!string.IsNullOrEmpty(strStartDate) && EyouSoft.Common.Function.StringValidate.IsDateTime(strStartDate))
                    {
                        StartDate = Convert.ToDateTime(strStartDate);
                    }
                    DateTime?EndDate    = null;
                    string   strEndDate = Utils.InputText(Request.QueryString["EndDate"]);
                    if (!string.IsNullOrEmpty(strEndDate) && EyouSoft.Common.Function.StringValidate.IsDateTime(strEndDate))
                    {
                        EndDate = Convert.ToDateTime(strEndDate);
                    }
                    TourList = EyouSoft.BLL.TourStructure.Tour.CreateInstance().GetTours(PageSize, PageIndex, ref recordCount, CityId, SearchTourArea, RouteName, SearchDay, CompanyName, StartDate, EndDate, false, true);
                    if (!string.IsNullOrEmpty(RouteName))
                    {
                        ErrorInfo += "“" + RouteName + "”";
                    }
                    if (intDays > 0)
                    {
                        ErrorInfo += "“" + intDays + "天”";
                    }
                    if (!string.IsNullOrEmpty(CompanyName))
                    {
                        ErrorInfo += "“" + CompanyName + "”";
                    }
                    if (StartDate != null)
                    {
                        ErrorInfo += "“" + Convert.ToDateTime(StartDate).ToShortDateString() + "”";
                    }
                    if (EndDate != null)
                    {
                        ErrorInfo += "“" + Convert.ToDateTime(EndDate).ToShortDateString() + "”";
                    }
                }
            }
            else
            {
                TourList = EyouSoft.BLL.TourStructure.Tour.CreateInstance().GetTours(PageSize, PageIndex, ref recordCount, CityId, SearchTourArea, false, true);
            }

            if (TourList != null && TourList.Count > 0)
            {
                this.ExporPageInfoSelect1.intPageSize    = PageSize;
                this.ExporPageInfoSelect1.intRecordCount = recordCount;
                this.ExporPageInfoSelect1.CurrencyPage   = PageIndex;


                if (EyouSoft.Common.URLREWRITE.UrlReWriteUtils.IsReWriteUrl(Request))
                {
                    //是否重写 分页的链接
                    this.ExporPageInfoSelect1.IsUrlRewrite = true;
                    //设置需要替换的值
                    this.ExporPageInfoSelect1.Placeholder = "#PageIndex#";
                    //获得线路的url 赋值给分页控件
                    this.ExporPageInfoSelect1.PageLinkURL = EyouSoft.Common.URLREWRITE.UrlReWriteUtils.GetUrlForPage(Request) + "_#PageIndex#";
                }
                else
                {
                    this.ExporPageInfoSelect1.PageLinkURL = Request.ServerVariables["SCRIPT_NAME"].ToString() + "?";
                    this.ExporPageInfoSelect1.UrlParams   = Request.QueryString;
                }



                this.repTourList.DataSource = TourList;
                this.repTourList.DataBind();
            }
            else
            {
                strEmpty.Append("<div class=\"noresult\" >");
                if (!string.IsNullOrEmpty(SearchType))
                {
                    //按主题类型
                    if (SearchType.Equals("Theme", StringComparison.OrdinalIgnoreCase))
                    {
                        string RouteTypeName = EyouSoft.BLL.SystemStructure.SysField.CreateInstance().GetFieldNameById(intSearchId, EyouSoft.Model.SystemStructure.SysFieldType.线路主题);
                        if (!string.IsNullOrEmpty(RouteTypeName))
                        {
                            ErrorInfo += "“" + RouteTypeName + "”";
                        }
                    }
                }
                strEmpty.Append("<div class=\"p1\"><h3><span class='timg'><img src='" + ImageServerUrl + "/images/UserPublicCenter/paoqian.gif' /></span><span>抱歉,在" + ErrorInfo + "没有找到相关的结果!</span></h3></div>");
                strEmpty.Append("<div class=\"p2\"><a href=\"" + EyouSoft.Common.Domain.UserBackCenter + "/routeagency/addquicktour.aspx\"><img src=\"" + ImageServerUrl + "/images/new2011/xianlu/nobg_07.gif\" alt=\"我要添加产品\"/></a></div>");
                strEmpty.Append("<div class=\"p3\"><b>建议你:</b><br />");
                strEmpty.Append("·适当删减或更改关键词试试<br /> ·看看输入的文字是否有错别字<br />·如关键词中含有城市名,去掉城市名试试 <br />·换个分类搜索试试");
                strEmpty.Append("</div>");
                strAllEmpty = strEmpty.ToString();
                this.ExporPageInfoSelect1.Visible = false;
                this.repTourList.EmptyText        = strAllEmpty;
            }
            TourList = null;
        }
Exemple #15
0
        /// <summary>
        /// 添加线路信息
        /// </summary>
        /// <returns></returns>
        private bool InsertRouteInfo()
        {
            bool IsResult = false;
            // 线路基本信息
            string hidRouteID = Utils.GetFormValue(this.AddQuickRoute_hidRouteID.UniqueID);    // 用于判断是添加还是修改

            string RouteArea  = Utils.GetFormValue(this.AddQuickRoute_RouteArea.UniqueID);
            string RouteName  = Utils.GetFormValue(this.AddQuickRoute_RouteName.UniqueID);
            string TourDays   = Utils.GetFormValue(this.AddQuickRoute_TourDays.UniqueID);
            string LeaveCity  = Utils.GetFormValue("AddQuickRoute_radPortCity");
            string RouteTheme = Utils.GetFormValue("AddQuickRoute_chkRouteTopic");
            string SaleCity   = Utils.GetFormValue("AddQuickRoute_chkSaleCity");

            if (LeaveCity == null || LeaveCity == string.Empty)
            {
                LeaveCity = "0";
            }

            // 快速发布线路行程信息
            string QuickPlan = Utils.EditInputText(Server.UrlDecode(Request.Form["AddQuickRoute_divFCK"]));

            if (QuickPlan == string.Empty || QuickPlan == "点击添加行程信息")
            {
                QuickPlan = string.Empty;
            }

            #region 线路区域处理
            string AreaName = string.Empty;
            int    AreaID   = 0;
            EyouSoft.Model.SystemStructure.AreaType Areatype = EyouSoft.Model.SystemStructure.AreaType.国内短线;
            if (!String.IsNullOrEmpty(RouteArea) && StringValidate.IsInteger(RouteArea))
            {
                EyouSoft.IBLL.SystemStructure.ISysArea AreaBll   = EyouSoft.BLL.SystemStructure.SysArea.CreateInstance();
                EyouSoft.Model.SystemStructure.SysArea AreaModel = AreaBll.GetSysAreaModel(int.Parse(RouteArea));
                if (AreaModel != null)
                {
                    AreaID   = AreaModel.AreaId;
                    AreaName = AreaModel.AreaName;
                    Areatype = AreaModel.RouteType;
                }
                AreaModel = null;
                AreaBll   = null;
            }
            #endregion

            #region 线路主题
            IList <int> RouteThemeList = new List <int>();
            if (!String.IsNullOrEmpty(RouteTheme))
            {
                string[] strRouteTopic = RouteTheme.Split(',');
                foreach (string str in strRouteTopic)
                {
                    RouteThemeList.Add(int.Parse(str));
                }
            }
            #endregion

            #region 销售城市
            IList <int> SaleCityList = new List <int>();
            if (!String.IsNullOrEmpty(SaleCity))
            {
                string[] strSaleCity = SaleCity.Split(',');
                foreach (string str in strSaleCity)
                {
                    SaleCityList.Add(int.Parse(str));
                }
            }
            #endregion

            // 写入线路信息
            EyouSoft.IBLL.TourStructure.IRouteBasicInfo bll   = EyouSoft.BLL.TourStructure.RouteBasicInfo.CreateInstance();
            EyouSoft.Model.TourStructure.RouteBasicInfo model = new EyouSoft.Model.TourStructure.RouteBasicInfo();
            model.AreaId          = AreaID;
            model.AreaType        = Areatype;
            model.CompanyID       = UserInfoModel.CompanyID;
            model.CompanyName     = UserInfoModel.CompanyName;
            model.ContactMQID     = ContactMQID;
            model.ContactName     = ContactName;
            model.ContactTel      = ContactTel;
            model.ContactUserName = UserInfoModel.UserName;
            model.IsAccept        = false;
            model.IssueTime       = DateTime.Now;
            model.LeaveCityId     = int.Parse(LeaveCity);
            model.OperatorID      = UserInfoModel.ID;
            model.PriceDetails    = InsertPriceDetail();
            model.QuickPlan       = QuickPlan;
            model.ReleaseType     = EyouSoft.Model.TourStructure.ReleaseType.Quick;
            model.RouteName       = RouteName;
            model.RouteTheme      = RouteThemeList;
            model.SaleCity        = SaleCityList;
            model.ServiceStandard = null;
            model.StandardPlans   = null;
            model.TourDays        = int.Parse(TourDays);

            if (!String.IsNullOrEmpty(hidRouteID))   // 修改
            {
                model.ID = hidRouteID;
                IsResult = bll.UpdateRouteInfo(model);
            }
            else
            {
                model.ID = Guid.NewGuid().ToString();
                IsResult = bll.InsertRouteInfo(model);
            }
            return(IsResult);
        }
Exemple #16
0
        /// <summary>
        /// 添加线路信息
        /// </summary>
        /// <returns></returns>
        private bool InsertRouteInfo()
        {
            bool   IsResult = false;
            string strErr   = string.Empty;
            // 线路基本信息
            string hidRouteID = Utils.GetFormValue(this.AddStandardRoute_hidRouteID.UniqueID);    // 用于判断是添加还是修改

            string RouteArea  = Utils.GetFormValue(this.AddStandardRoute_RouteArea.UniqueID);
            string RouteName  = Utils.GetFormValue(this.AddStandardRoute_RouteName.UniqueID);
            string TourDays   = Utils.GetFormValue(this.AddStandardRoute_txtTourDays.UniqueID);
            string RouteTopic = Utils.GetFormValue("AddStandardRoute_chkRouteTopic");
            string LeaveCity  = Utils.GetFormValue("AddStandardRoute_radPortCity");
            string SaleCity   = Utils.GetFormValue("AddStandardRoute_chkSaleCity");
            string Service    = Utils.GetFormValue(this.AddStandardRoute_Service.UniqueID);
            string Remark     = Utils.GetFormValue(this.AddStandardRoute_Remark.UniqueID);

            // 标准发布线路行程信息
            string StandardPlan = Utils.GetFormValue(this.AddStandardRoute_Remark.UniqueID);

            // 服务标准
            string ResideContent       = Utils.GetFormValue("AddStandardRouteResideContent");
            string DinnerContent       = Utils.GetFormValue("AddStandardRouteDinnerContent");
            string SightContent        = Utils.GetFormValue("AddStandardRouteSightContent");
            string CarContent          = Utils.GetFormValue("AddStandardRouteCarContent");
            string GuideContent        = Utils.GetFormValue("AddStandardRouteGuideContent");
            string TrafficContent      = Utils.GetFormValue("AddStandardRouteTrafficContent");
            string IncludeOtherContent = Utils.GetFormValue("AddStandardRouteIncludeOtherContent");

            // 线路负责人
            string ContactName     = Utils.GetFormValue("AddStandardRoute_TourContact");
            string ContactTel      = Utils.GetFormValue("AddStandardRoute_TourContactTel");
            string ContactMQID     = Utils.GetFormValue("AddStandardRoute_TourContacMQ");
            string ContactUserName = Utils.GetFormValue("AddStandardRoute_TourContactUserName");

            if (LeaveCity == null || LeaveCity == string.Empty)
            {
                LeaveCity = "0";
            }
            #region 线路区域处理
            string AreaName = string.Empty;
            int    AreaID   = 0;
            EyouSoft.Model.SystemStructure.AreaType Areatype = EyouSoft.Model.SystemStructure.AreaType.国内短线;
            if (!String.IsNullOrEmpty(RouteArea) && StringValidate.IsInteger(RouteArea))
            {
                EyouSoft.IBLL.SystemStructure.ISysArea AreaBll   = EyouSoft.BLL.SystemStructure.SysArea.CreateInstance();
                EyouSoft.Model.SystemStructure.SysArea AreaModel = AreaBll.GetSysAreaModel(int.Parse(RouteArea));
                if (AreaModel != null)
                {
                    AreaID   = AreaModel.AreaId;
                    AreaName = AreaModel.AreaName;
                    Areatype = AreaModel.RouteType;
                }
                AreaModel = null;
                AreaBll   = null;
            }
            #endregion

            #region 线路主题
            IList <int> RouteThemeList = new List <int>();
            if (!String.IsNullOrEmpty(RouteTopic))
            {
                string[] strRouteTopic = RouteTopic.Split(',');
                //string[] strRouteTopic = new string[] { "1","2","3"};
                foreach (string str in strRouteTopic)
                {
                    RouteThemeList.Add(int.Parse(str));
                }
            }
            #endregion

            #region 销售城市
            IList <int> SaleCityList = new List <int>();
            if (!String.IsNullOrEmpty(SaleCity))
            {
                string[] strSaleCity = SaleCity.Split(',');
                foreach (string str in strSaleCity)
                {
                    SaleCityList.Add(int.Parse(str));
                }
            }
            #endregion

            // 写入线路信息
            EyouSoft.IBLL.TourStructure.IRouteBasicInfo bll   = EyouSoft.BLL.TourStructure.RouteBasicInfo.CreateInstance();
            EyouSoft.Model.TourStructure.RouteBasicInfo model = new EyouSoft.Model.TourStructure.RouteBasicInfo();
            model.AreaId          = AreaID;
            model.AreaType        = Areatype;
            model.CompanyID       = UserInfoModel.CompanyID;
            model.CompanyName     = UserInfoModel.CompanyName;
            model.ContactMQID     = ContactMQID;
            model.ContactName     = ContactName;
            model.ContactTel      = ContactTel;
            model.ContactUserName = ContactUserName;
            model.IsAccept        = false;
            model.IssueTime       = DateTime.Now;
            model.LeaveCityId     = int.Parse(LeaveCity);
            model.OperatorID      = UserInfoModel.ID;
            model.PriceDetails    = InsertRoutePriceDetail();
            model.QuickPlan       = string.Empty;
            model.ReleaseType     = EyouSoft.Model.TourStructure.ReleaseType.Standard;
            model.RouteName       = RouteName;
            model.RouteTheme      = RouteThemeList;
            model.SaleCity        = SaleCityList;
            model.StandardPlans   = InsertRouteStandardPlan();
            model.TourDays        = int.Parse(TourDays);
            // 服务标准
            EyouSoft.Model.TourStructure.RouteServiceStandard RouteServiceModel = new EyouSoft.Model.TourStructure.RouteServiceStandard();
            if (!String.IsNullOrEmpty(ResideContent))
            {
                RouteServiceModel.ResideContent = ResideContent;
            }
            if (!String.IsNullOrEmpty(DinnerContent))
            {
                RouteServiceModel.DinnerContent = DinnerContent;
            }
            if (!String.IsNullOrEmpty(CarContent))
            {
                RouteServiceModel.CarContent = CarContent;
            }
            if (!String.IsNullOrEmpty(SightContent))
            {
                RouteServiceModel.SightContent = SightContent;
            }
            if (!String.IsNullOrEmpty(GuideContent))
            {
                RouteServiceModel.GuideContent = GuideContent;
            }
            if (!String.IsNullOrEmpty(TrafficContent))
            {
                RouteServiceModel.TrafficContent = TrafficContent;
            }
            if (!String.IsNullOrEmpty(IncludeOtherContent))
            {
                RouteServiceModel.IncludeOtherContent = IncludeOtherContent;
            }
            if (!String.IsNullOrEmpty(Service))
            {
                RouteServiceModel.NotContainService = Service;
            }
            if (!String.IsNullOrEmpty(Remark))
            {
                RouteServiceModel.SpeciallyNotice = Remark;
            }
            model.ServiceStandard = RouteServiceModel;

            if (!String.IsNullOrEmpty(hidRouteID))   // 修改
            {
                model.ID = hidRouteID;
                IsResult = bll.UpdateRouteInfo(model);
            }
            else
            {
                model.ID = Guid.NewGuid().ToString();
                IsResult = bll.InsertRouteInfo(model);
            }

            return(IsResult);
        }
Exemple #17
0
        protected void btnsave_Click(object sender, EventArgs e)
        {
            EyouSoft.Model.SystemStructure.SysArea AreaModel = new EyouSoft.Model.SystemStructure.SysArea();
            //区域名称
            AreaModel.AreaName = this.txtAreaName.Text;
            //区域所属类型
            AreaModel.RouteType = (EyouSoft.Model.SystemStructure.AreaType)Enum.Parse(typeof(EyouSoft.Model.SystemStructure.AreaType), Utils.GetQueryStringValue("routeType"));
            //浏览城市
            AreaModel.VisitCity = new List <EyouSoft.Model.SystemStructure.SysAreaVisitCity>();

            string[] cbxCountyIdlist = Utils.GetFormValues("cbxCounty");
            if (cbxCountyIdlist.Length > 0)
            {
                for (int i = 0; i < cbxCountyIdlist.Length; i++)
                {
                    EyouSoft.Model.SystemStructure.SysAreaVisitCity VisitCity = new EyouSoft.Model.SystemStructure.SysAreaVisitCity();
                    VisitCity.ProvinceId = Convert.ToInt32(cbxCountyIdlist[i].Split(',')[0]);
                    VisitCity.CityId     = Convert.ToInt32(cbxCountyIdlist[i].Split(',')[1]);
                    VisitCity.CountyId   = Convert.ToInt32(cbxCountyIdlist[i].Split(',')[2]);
                    AreaModel.VisitCity.Add(VisitCity);
                }
            }

            string[] cbxCityIdlist = Utils.GetFormValues("cbxCity");
            if (cbxCityIdlist.Length > 0)
            {
                for (int i = 0; i < cbxCityIdlist.Length; i++)
                {
                    EyouSoft.Model.SystemStructure.SysAreaVisitCity VisitCity = new EyouSoft.Model.SystemStructure.SysAreaVisitCity();
                    if (Utils.GetQueryStringValue("routeType") == "1")
                    {
                        VisitCity.CountryId = Convert.ToInt32(cbxCityIdlist[i].Split(',')[1]);
                    }
                    else
                    {
                        VisitCity.ProvinceId = Convert.ToInt32(cbxCityIdlist[i].Split(',')[0]);
                        VisitCity.CityId     = Convert.ToInt32(cbxCityIdlist[i].Split(',')[1]);
                    }
                    AreaModel.VisitCity.Add(VisitCity);
                }
            }

            if (Utils.GetQueryStringValue("AreaID") != null && !string.IsNullOrEmpty(Utils.GetQueryStringValue("AreaID")))
            {
                //修改
                AreaModel.AreaId = Convert.ToInt32(Utils.GetQueryStringValue("AreaID"));
                int result = new EyouSoft.BLL.SystemStructure.SysArea().UpdateSysArea(AreaModel);
                if (result > 0)
                {
                    Response.Write("<script>alert('修改成功!');location.href=location.href;parent.location.href='UniversalLineManage.aspx';</script>");
                }
                else
                {
                    Response.Write("<script>alert('修改失败!');location.href=location.href;parent.location.href='UniversalLineManage.aspx';</script>");
                }
            }
            else
            {
                //添加
                int message = new EyouSoft.BLL.SystemStructure.SysArea().AddSysArea(AreaModel);
                if (message > 0)
                {
                    Response.Write("<script>alert('添加成功!');location.href=location.href;parent.location.href='UniversalLineManage.aspx';</script>");
                }
                else
                {
                    Response.Write("<script>alert('线路区域已存在!');location.href=location.href;parent.location.href='UniversalLineManage.aspx';</script>");
                }
            }
        }
Exemple #18
0
        protected bool IsTour  = false;                //非组团社登录
        protected void Page_Load(object sender, EventArgs e)
        {
            TourAreaId = EyouSoft.Common.Function.StringValidate.GetIntValue(Request.QueryString["TourAreaId"]);
            if (TourAreaId != 0 || Request.QueryString["RouteType"] != null)
            {
                EyouSoft.Model.SystemStructure.SysArea SysAreamodel = EyouSoft.BLL.SystemStructure.SysArea.CreateInstance().GetSysAreaModel(TourAreaId);
                int routetype = TourAreaId == 0 ? 3 : (int)SysAreamodel.RouteType;
                if (Request.QueryString["RouteType"] != null)
                {
                    routetype = Request.QueryString["RouteType"] == null ? 3 : Utils.GetInt(Request.QueryString["RouteType"].ToString());
                }
                switch (routetype)
                {
                case 0:
                    RouteTypeName = "国内";
                    break;

                case 1:
                    RouteTypeName = "国际";
                    break;

                case 2:
                    RouteTypeName = "周边";
                    break;

                default:
                    RouteTypeName = "";
                    break;
                }
                if (SysAreamodel != null)
                {
                    strRourListName = SysAreamodel.AreaName;
                }
                else
                {
                    strRourListName = RouteTypeName + "线路";
                }
            }
            UCRightList1.IsPinpai          = true;
            UCRightList1.IsToolbar         = false;
            UCRightList1.TourAreaId        = TourAreaId.ToString();
            UCRightList1.CityID            = CityId;
            this.TourSearchKeys1.IsDefault = false;
            //TourAreaId  KeyWord  Days   ThemeName  StartDate   EndDate   Price  City
            string startDate = EyouSoft.Common.Utils.GetQueryStringValue("StartDate");
            string endDate   = EyouSoft.Common.Utils.GetQueryStringValue("EndDate");
            string keyword   = EyouSoft.Common.Utils.GetQueryStringValue("keyWord");
            string Days      = EyouSoft.Common.Utils.GetQueryStringValue("Days");
            string Price     = EyouSoft.Common.Utils.GetQueryStringValue("Price");
            string City      = EyouSoft.Common.Utils.GetQueryStringValue("City");

            if (startDate != "" || endDate != "")
            {
                IsDate = true;
            }

            if (EyouSoft.Common.Utils.GetInt(Request.QueryString["Page"]) > 1)
            {
                PageIndex = EyouSoft.Common.Utils.GetInt(Request.QueryString["Page"]);
            }
            if (!Page.IsPostBack)
            {
                NewPublicCenter master = (this.Master as NewPublicCenter);
                master.HeadMenuIndex = 2;
                if (!string.IsNullOrEmpty(keyword) && keyword != null)
                {
                    master.SearchKeyWord = keyword;
                }
                this.TourSearchKeys1.IsDefault = false;
                BindCompanyAndTour();
                GetUserRole();
            }

            string tourAreaName = this.hidRourName.Value;

            this.Page.Title = string.Format(PageTitle.RouteList_Title, CityModel.CityName, tourAreaName, tourAreaName, tourAreaName);
            AddMetaTag("description", string.Format(PageTitle.RouteList_Des, CityModel.CityName, tourAreaName, tourAreaName, tourAreaName));
            AddMetaTag("keywords", string.Format(PageTitle.RouteList_Keywords, tourAreaName, tourAreaName, tourAreaName));
        }
Exemple #19
0
        /// <summary>
        /// 添加团队信息
        /// </summary>
        /// <returns></returns>
        private bool InsertTourInfo()
        {
            bool IsResult = false;
            // 团队基本信息
            string hidTourID        = Utils.GetFormValue(this.AddQuickTour_hidTourID.UniqueID);      // 用于判断是添加还是修改
            string TemplateTourID   = Utils.GetFormValue(this.AddQuickTour_TemplateTourID.UniqueID); // 需要修改的模板团ID
            string hidTourLeaveDate = Utils.GetFormValue(this.hidTourLeaveDate.UniqueID);

            string RouteArea    = Utils.GetFormValue(this.AddQuickTour_RouteArea.UniqueID);
            string RouteName    = Utils.GetFormValue(this.AddQuickTour_RouteName.UniqueID);
            string TourDays     = Utils.GetFormValue(this.AddQuickTour_TourDays.UniqueID);
            string PeopleNumber = Utils.GetFormValue(this.AddQuickTour_PeopleNumber.UniqueID);
            string RouteTopic   = Utils.GetFormValue("AddQuickTour_chkRouteTopic");
            string LeaveCity    = Utils.GetFormValue("AddQuickTour_radPortCity");
            string SaleCity     = Utils.GetFormValue("AddQuickTour_chkSaleCity");

            if (LeaveCity == null || LeaveCity == string.Empty)
            {
                LeaveCity = "0";
            }
            // 快速发布团队行程信息
            string QuickPlan = Utils.EditInputText(Server.UrlDecode(Request.Form["AddQuickTour_divFCK"]));

            if (QuickPlan == string.Empty || QuickPlan == "点击添加行程信息")
            {
                QuickPlan = string.Empty;
            }
            // 自动停收时间
            string AutoOffDays = Utils.GetFormValue(this.AddQuickTour_AutoOffDays.UniqueID);

            #region 线路区域处理
            string AreaName = string.Empty;
            int    AreaID   = 0;
            EyouSoft.Model.SystemStructure.AreaType Areatype = EyouSoft.Model.SystemStructure.AreaType.国内短线;
            if (!String.IsNullOrEmpty(RouteArea))
            {
                EyouSoft.IBLL.SystemStructure.ISysArea AreaBll   = EyouSoft.BLL.SystemStructure.SysArea.CreateInstance();
                EyouSoft.Model.SystemStructure.SysArea AreaModel = AreaBll.GetSysAreaModel(int.Parse(RouteArea.Split('|')[0]));
                if (AreaModel != null)
                {
                    AreaID   = AreaModel.AreaId;
                    AreaName = AreaModel.AreaName;
                    Areatype = AreaModel.RouteType;
                }
                AreaModel = null;
                AreaBll   = null;
            }
            #endregion

            #region 线路主题
            IList <int> RouteThemeList = new List <int>();
            if (!String.IsNullOrEmpty(RouteTopic))
            {
                string[] strRouteTopic = RouteTopic.Split(',');
                foreach (string str in strRouteTopic)
                {
                    RouteThemeList.Add(int.Parse(str));
                }
            }
            #endregion

            #region 销售城市
            IList <int> SaleCityList = new List <int>();
            if (!String.IsNullOrEmpty(SaleCity))
            {
                string[] strSaleCity = SaleCity.Split(',');
                foreach (string str in strSaleCity)
                {
                    SaleCityList.Add(int.Parse(str));
                }
            }
            #endregion

            if (this.AddQuickTour_AddToRoute.Checked)
            {
                #region 回写线路信息
                try
                {
                    EyouSoft.Model.TourStructure.RouteBasicInfo RouteModel = new EyouSoft.Model.TourStructure.RouteBasicInfo();
                    RouteModel.ID              = Guid.NewGuid().ToString();
                    RouteModel.AreaId          = AreaID;
                    RouteModel.AreaType        = Areatype;
                    RouteModel.CompanyID       = UserInfoModel.CompanyID;
                    RouteModel.CompanyName     = UserInfoModel.CompanyName;
                    RouteModel.ContactMQID     = ContactMQID;
                    RouteModel.ContactName     = ContactName;
                    RouteModel.ContactTel      = ContactTel;
                    RouteModel.ContactUserName = UserInfoModel.UserName;
                    RouteModel.IsAccept        = false;
                    RouteModel.IssueTime       = DateTime.Now;
                    RouteModel.LeaveCityId     = int.Parse(LeaveCity);
                    RouteModel.OperatorID      = UserInfoModel.ID;
                    RouteModel.PriceDetails    = InsertRoutePriceDetail();
                    RouteModel.QuickPlan       = QuickPlan;
                    RouteModel.ReleaseType     = EyouSoft.Model.TourStructure.ReleaseType.Quick;
                    RouteModel.RouteName       = RouteName;
                    RouteModel.RouteTheme      = RouteThemeList;
                    RouteModel.SaleCity        = SaleCityList;
                    RouteModel.ServiceStandard = null;
                    RouteModel.StandardPlans   = null;
                    RouteModel.TourDays        = int.Parse(TourDays);
                    EyouSoft.IBLL.TourStructure.IRouteBasicInfo RouteBll = EyouSoft.BLL.TourStructure.RouteBasicInfo.CreateInstance();
                    RouteBll.InsertRouteInfo(RouteModel);
                    RouteModel = null;
                    RouteBll   = null;
                }
                catch
                {
                    return(false);
                }
                #endregion
            }
            EyouSoft.IBLL.TourStructure.ITour TourBll = EyouSoft.BLL.TourStructure.Tour.CreateInstance();

            #region 写入团队信息
            if (!String.IsNullOrEmpty(hidTourID) || !String.IsNullOrEmpty(TemplateTourID)) // 修改
            {
                if (!String.IsNullOrEmpty(TemplateTourID))                                 // 修改模板团
                {
                    EyouSoft.Model.TourStructure.TourInfo TourModel = new EyouSoft.Model.TourStructure.TourInfo();
                    TourModel.ID              = TemplateTourID;
                    TourModel.AreaId          = AreaID;
                    TourModel.AreaName        = AreaName;
                    TourModel.AreaType        = Areatype;
                    TourModel.AutoOffDays     = int.Parse(AutoOffDays);
                    TourModel.CompanyID       = CompanyId;
                    TourModel.CompanyName     = UserInfoModel.CompanyName;
                    TourModel.LeaveCity       = int.Parse(LeaveCity);
                    TourModel.OperatorID      = UserID;
                    TourModel.PlanPeopleCount = int.Parse(PeopleNumber);
                    TourModel.QuickPlan       = QuickPlan;
                    TourModel.ReleaseType     = EyouSoft.Model.TourStructure.ReleaseType.Quick;
                    TourModel.RouteName       = RouteName;
                    TourModel.RouteTheme      = RouteThemeList;
                    TourModel.SaleCity        = SaleCityList;
                    // 服务标准
                    TourModel.ServiceStandard    = null;
                    TourModel.StandardPlan       = null;
                    TourModel.TourContacMQ       = ContactMQID;
                    TourModel.TourContact        = ContactName;
                    TourModel.TourContactTel     = ContactTel;
                    TourModel.TourContacUserName = UserInfoModel.UserName;
                    TourModel.TourDays           = int.Parse(TourDays);
                    TourModel.TourNo             = string.Empty;
                    TourModel.TourPriceDetail    = InsertTourPriceDetail();
                    TourModel.TourState          = EyouSoft.Model.TourStructure.TourState.收客;
                    TourModel.TourType           = EyouSoft.Model.TourStructure.TourType.组团散拼;
                    if (TourBll.UpdateTemplateTourInfo(TourModel) > 0)
                    {
                        IsResult = true;
                    }
                    TourModel = null;
                }
                else
                {    // 修改子团
                    #region
                    EyouSoft.Model.TourStructure.TourInfo TourModel = new EyouSoft.Model.TourStructure.TourInfo();
                    TourModel.ID              = hidTourID;
                    TourModel.AreaId          = AreaID;
                    TourModel.AreaName        = AreaName;
                    TourModel.AreaType        = Areatype;
                    TourModel.AutoOffDays     = int.Parse(AutoOffDays);
                    TourModel.CompanyID       = CompanyId;
                    TourModel.CompanyName     = UserInfoModel.CompanyName;
                    TourModel.LeaveCity       = int.Parse(LeaveCity);
                    TourModel.OperatorID      = UserID;
                    TourModel.ParentTourID    = TemplateTourID;
                    TourModel.PlanPeopleCount = int.Parse(PeopleNumber);
                    TourModel.QuickPlan       = QuickPlan;
                    TourModel.ReleaseType     = EyouSoft.Model.TourStructure.ReleaseType.Quick;
                    TourModel.RouteName       = RouteName;
                    TourModel.RouteTheme      = RouteThemeList;
                    TourModel.SaleCity        = SaleCityList;
                    // 服务标准
                    TourModel.ServiceStandard    = null;
                    TourModel.StandardPlan       = null;
                    TourModel.TourContacMQ       = ContactMQID;
                    TourModel.TourContact        = ContactName;
                    TourModel.TourContactTel     = ContactTel;
                    TourModel.TourContacUserName = UserInfoModel.UserName;
                    TourModel.TourDays           = int.Parse(TourDays);
                    TourModel.TourNo             = string.Empty;
                    TourModel.TourPriceDetail    = InsertTourPriceDetail();
                    TourModel.TourState          = EyouSoft.Model.TourStructure.TourState.收客;
                    TourModel.TourType           = EyouSoft.Model.TourStructure.TourType.组团散拼;
                    if (TourBll.UpdateTourInfo(TourModel) > 0)
                    {
                        IsResult = true;
                    }
                    TourModel = null;
                    #endregion
                }
            }
            else
            {   // 添加
                #region 添加团队

                #region 子团信息
                IList <EyouSoft.Model.TourStructure.ChildrenTourInfo> ChildrensTourList = new List <EyouSoft.Model.TourStructure.ChildrenTourInfo>();
                if (!String.IsNullOrEmpty(hidTourLeaveDate))
                {
                    string[] tmpLeaveDate = hidTourLeaveDate.Split(',');

                    for (int i = 0; i < tmpLeaveDate.Length; i++)
                    {
                        if (!String.IsNullOrEmpty(tmpLeaveDate[i]))
                        {
                            EyouSoft.Model.TourStructure.ChildrenTourInfo ChildTour = new EyouSoft.Model.TourStructure.ChildrenTourInfo();
                            ChildTour.ChildrenId = Guid.NewGuid().ToString();
                            ChildTour.LeaveDate  = Utils.GetDateTime(tmpLeaveDate[i]);
                            ChildTour.TourState  = EyouSoft.Model.TourStructure.TourState.收客;
                            ChildrensTourList.Add(ChildTour);
                            ChildTour = null;
                        }
                    }
                }
                #endregion

                EyouSoft.Model.TourStructure.TourInfo TourModel = new EyouSoft.Model.TourStructure.TourInfo();
                TourModel.ID              = Guid.NewGuid().ToString();
                TourModel.AreaId          = AreaID;
                TourModel.AreaName        = AreaName;
                TourModel.AreaType        = Areatype;
                TourModel.AutoOffDays     = int.Parse(AutoOffDays);
                TourModel.Childrens       = ChildrensTourList;
                TourModel.CompanyID       = CompanyId;
                TourModel.CompanyName     = UserInfoModel.CompanyName;
                TourModel.LeaveCity       = int.Parse(LeaveCity);
                TourModel.OperatorID      = UserID;
                TourModel.PlanPeopleCount = int.Parse(PeopleNumber);
                TourModel.QuickPlan       = QuickPlan;
                TourModel.ReleaseType     = EyouSoft.Model.TourStructure.ReleaseType.Quick;
                TourModel.RouteName       = RouteName;
                TourModel.RouteTheme      = RouteThemeList;
                TourModel.SaleCity        = SaleCityList;
                // 服务标准
                TourModel.ServiceStandard    = null;
                TourModel.StandardPlan       = null;
                TourModel.TourContacMQ       = ContactMQID;
                TourModel.TourContact        = ContactName;
                TourModel.TourContactTel     = ContactTel;
                TourModel.TourContacUserName = UserInfoModel.UserName;
                TourModel.TourDays           = int.Parse(TourDays);
                TourModel.TourNo             = string.Empty;
                TourModel.TourPriceDetail    = InsertTourPriceDetail();
                TourModel.TourState          = EyouSoft.Model.TourStructure.TourState.收客;
                TourModel.TourType           = EyouSoft.Model.TourStructure.TourType.组团散拼;
                if (TourBll.InsertTemplateTourInfo(TourModel) > 0)
                {
                    IsResult = true;
                }
                TourModel = null;
                #endregion
            }
            #endregion
            return(IsResult);
        }