Beispiel #1
0
        /// <summary>
        /// 添加单项业务
        /// </summary>
        /// <param name="single"></param>
        /// <returns>True or False</returns>
        public bool AddSingleService(MSingleServiceExtend single)
        {
            BTour tour = new BTour();

            var temp = tour.GenerateTourNo(single.OperatorDeptId, single.CompanyId, EyouSoft.Model.EnumType.TourStructure.TourType.单项服务, single.WeiTuoRiQi);

            single.TourCode = temp[0];
            single.XuHao    = EyouSoft.Toolkit.Utils.GetInt(temp[1]);

            single.OrderCode = single.TourCode + "-1";

            single.TourId  = Guid.NewGuid().ToString();
            single.OrderId = Guid.NewGuid().ToString();

            int flg = dal.AddSingleService(single);

            if (flg == 1)
            {
                StringBuilder query = new StringBuilder();
                query.AppendFormat("添加单项业务,订单编号:{0}。", single.OrderId);
                EyouSoft.BLL.SysStructure.BSysLogHandle.Insert(query.ToString());
                return(true);
            }
            return(false);
        }
Beispiel #2
0
        /// <summary>
        /// 修改单项业务
        /// </summary>
        /// <param name="single"></param>
        /// <returns>True or False</returns>
        public bool UpdateSingleService(MSingleServiceExtend single)
        {
            int flg = dal.UpdateSingleService(single);

            if (flg == 1)
            {
                System.Text.StringBuilder str = new System.Text.StringBuilder();
                str.AppendFormat("修改了单项业务,订单编号:{0}。", single.OrderId);
                EyouSoft.BLL.SysStructure.BSysLogHandle.Insert(str.ToString());
                return(true);
            }
            return(false);
        }
Beispiel #3
0
        /// <summary>
        /// 根据计划编号获取单项业务的拓展实体
        /// </summary>
        /// <param name="tourId"></param>
        /// <returns></returns>
        public MSingleServiceExtend GetSingleServiceExtendByTourId(string tourId)
        {
            MSingleServiceExtend single = null;
            StringBuilder        query  = new StringBuilder();

            query.Append(" select TourId,CompanyId,SellerName,SellerId,DeptId,TourPay,TourCode,");
            query.Append("TourIncome,TourProfit,TourStatus,OperatorId,Operator,TourType,IsDelete,");

            query.Append(" (SELECT TourId,Unit,Quote,ServiceStandard,ServiceType,ServiceName,ServiceId,Remark");
            query.Append(" from ");
            query.Append("tbl_TourTeamPrice");
            query.Append(" where ");
            query.Append(" tbl_TourTeamPrice.TourId=tbl_Tour.TourId ");
            query.Append(" for xml raw,root('Root'))");
            query.Append(" as TourTeamPrice,");

            query.Append("(select OrderId,OrderCode,BuyCompanyName,BuyCompanyId,ContactName,ContactTel,ContactDepartId,Adults,TravellerFile,");

            query.Append("(SELECT TravellerId,OrderId,CnName,EnName,CardId,VisitorType,CardType");
            query.Append(",CardNumber,CardValidDate,VisaStatus,IsCardTransact,Gender,Contact");
            query.Append(",LNotice,RNotice,Remark,Status,RAmount,RAmountRemark,RTime,RRemark,IsInsurance");
            query.Append(" FROM ");
            query.Append(" tbl_TourOrderTraveller ");
            query.Append(" where tbl_TourOrder.OrderId=tbl_TourOrderTraveller.OrderId");
            query.Append(" for xml path,elements)");
            query.Append("as TourOrderTraveller");
            query.Append(" ,ContractId,ContractCode ");

            query.Append(" from ");
            query.Append("tbl_TourOrder");
            query.Append(" where tbl_TourOrder.TourId=tbl_Tour.TourId");
            query.Append(" for xml path,elements,root('Root'))");
            query.Append("as TourOrder,");


            query.Append("(SELECT PlanId,CompanyId,TourId,Type,SourceId,SourceName,ContactName,ContactPhone");
            query.Append(",ContactFax,Num,ReceiveJourney,CostDetail,PlanCost,PaymentType,Status,GuideNotes");
            query.Append(",Remarks,SueId,CostId,CostName,CostStatus,CostTime,Confirmation,CostRemarks,DeptId");
            query.Append(",OperatorId,OperatorName,IssueTime,Prepaid,IsRebate,AddStatus,IsDelete,ServiceStandard");
            query.Append(",CustomerInfo,StartDate,StartTime,EndDate,EndTime");
            query.Append(" FROM ");
            query.Append("tbl_Plan");
            query.Append(" where ");
            query.Append("tbl_Tour.TourId=tbl_Plan.TourId and tbl_Plan.IsDelete=0 ");
            query.Append("for xml raw,root('Root'))");
            query.Append("as TourPlan,");


            query.Append("(SELECT TourId,PlanerId,Planer,DeptId ");
            query.Append(" FROM ");
            query.Append(" tbl_TourPlaner ");
            query.Append(" where ");
            query.Append("tbl_TourPlaner.TourId=tbl_Tour.TourId ");
            query.Append("for xml raw,root('Root') )");
            query.Append("as TourPlaner");
            query.Append(" ,LDate ");
            query.Append(" from tbl_Tour");

            query.Append(" Where ");
            query.AppendFormat(" TourType='{0}' ", 6);
            query.Append(" and ");
            query.AppendFormat(" TourId='{0}' ", tourId);

            DbCommand cmd = _db.GetSqlStringCommand(query.ToString());

            using (IDataReader dr = DbHelper.ExecuteReader(cmd, _db))
            {
                if (dr != null)
                {
                    single = new MSingleServiceExtend();
                    if (dr.Read())
                    {
                        single.TourId     = dr["TourId"].ToString();
                        single.CompanyId  = dr.GetString(dr.GetOrdinal("CompanyId"));
                        single.SellerName = !dr.IsDBNull(dr.GetOrdinal("SellerName")) ? dr.GetString(dr.GetOrdinal("SellerName")) : string.Empty;
                        single.SellerId   = dr.GetString(dr.GetOrdinal("SellerId"));
                        single.DeptId     = dr.GetInt32(dr.GetOrdinal("DeptId"));
                        single.TourPay    = dr.GetDecimal(dr.GetOrdinal("TourPay"));
                        single.TourIncome = dr.GetDecimal(dr.GetOrdinal("TourIncome"));
                        single.TourProfit = dr.GetDecimal(dr.GetOrdinal("TourProfit"));
                        single.TourStatus = (TourStatus)dr.GetByte(dr.GetOrdinal("TourStatus"));
                        single.OperatorId = dr.GetString(dr.GetOrdinal("OperatorId"));
                        single.Operator   = dr.GetString(dr.GetOrdinal("Operator"));
                        single.TourCode   = dr["TourCode"].ToString();

                        string TourOrder = !dr.IsDBNull(dr.GetOrdinal("TourOrder")) ? dr.GetString(dr.GetOrdinal("TourOrder")) : string.Empty;
                        if (!string.IsNullOrEmpty(TourOrder))
                        {
                            single.TourOrderTravellerList = new List <MTourOrderTraveller>();
                            MSingleService order = new MSingleService();
                            single.TourOrderTravellerList = GetOrderAndTravellerByXml(TourOrder, ref order);
                            single.OrderId         = order.OrderId;
                            single.OrderCode       = order.OrderCode;
                            single.BuyCompanyId    = order.BuyCompanyId;
                            single.BuyCompanyName  = order.BuyCompanyName;
                            single.ContactName     = order.ContactName;
                            single.ContactTel      = order.ContactTel;
                            single.ContactDepartId = order.ContactDepartId;
                            single.TravellerFile   = order.TravellerFile;
                            single.Adults          = order.Adults;
                            single.HeTongId        = order.HeTongId;
                            single.HeTongCode      = order.HeTongCode;
                        }

                        //计调员信息
                        string TourPlaner = !dr.IsDBNull(dr.GetOrdinal("TourPlaner")) ? dr.GetString(dr.GetOrdinal("TourPlaner")) : string.Empty;
                        if (!string.IsNullOrEmpty(TourPlaner))
                        {
                            single.TourPlanersList = new List <MTourPlaner>();
                            single.TourPlanersList = GetTourPlanerByXML(TourPlaner);
                        }

                        //客人要求(分项报价)
                        string TourTeamPrice = !dr.IsDBNull(dr.GetOrdinal("TourTeamPrice")) ? dr.GetString(dr.GetOrdinal("TourTeamPrice")) : string.Empty;
                        if (!string.IsNullOrEmpty(TourTeamPrice))
                        {
                            single.TourTeamPriceList = new List <MTourTeamPrice>();
                            single.TourTeamPriceList = GetTourTeamPriceByXML(TourTeamPrice);
                        }
                        //供应商安排(计调中心)
                        string TourPlan = !dr.IsDBNull(dr.GetOrdinal("TourPlan")) ? dr.GetString(dr.GetOrdinal("TourPlan")) : string.Empty;
                        if (!string.IsNullOrEmpty(TourPlan))
                        {
                            single.PlanBaseInfoList = new List <EyouSoft.Model.PlanStructure.MPlanBaseInfo>();
                            single.PlanBaseInfoList = GetPlanBaseInfoByXML(TourPlan);
                        }

                        single.WeiTuoRiQi = dr.GetDateTime(dr.GetOrdinal("LDate"));
                    }
                }
            }

            return(single);
        }
Beispiel #4
0
        /// <summary>
        ///1:更新成功
        ///2:更新失败
        /// </summary>
        /// <param name="single">单项业务的拓展实体</param>
        /// <returns></returns>
        public int UpdateSingleService(MSingleServiceExtend single)
        {
            string travellerXML = string.Empty;//订单游客信息

            if (single.TourOrderTravellerList != null)
            {
                travellerXML = CreateTourOrderTravellerXml(single.TourOrderTravellerList, single.OrderId);
            }

            string teamPriceXMl = string.Empty;//游客要求(分项报价)

            if (single.TourTeamPriceList != null)
            {
                teamPriceXMl = CreateTourTeamPriceXml(single.TourId, single.TourTeamPriceList);
            }
            string planXML = string.Empty;//供应商安排

            if (single.PlanBaseInfoList != null)
            {
                planXML = CreatePlanBaseInfoXml(single.TourId, single.CompanyId, single.OperatorDeptId, single.PlanBaseInfoList);
            }
            string planerXML = string.Empty;//计调员信息

            if (single.TourPlanersList != null)
            {
                planerXML = CreateTourPlanerXML(single.TourId, single.TourPlanersList);
            }

            DbCommand cmd = _db.GetStoredProcCommand("proc_TourOrder_Update_SingleService");

            _db.AddInParameter(cmd, "TourId", DbType.AnsiStringFixedLength, single.TourId);
            _db.AddInParameter(cmd, "OrderId", DbType.AnsiStringFixedLength, single.OrderId);
            _db.AddInParameter(cmd, "OrderCode", DbType.String, single.OrderCode);
            _db.AddInParameter(cmd, "CompanyId", DbType.AnsiStringFixedLength, single.CompanyId);
            _db.AddInParameter(cmd, "BuyCompanyName", DbType.String, single.BuyCompanyName);
            _db.AddInParameter(cmd, "BuyCompanyId", DbType.AnsiStringFixedLength, single.BuyCompanyId);
            _db.AddInParameter(cmd, "ContactName", DbType.String, single.ContactName);
            _db.AddInParameter(cmd, "ContactTel", DbType.String, single.ContactTel);
            _db.AddInParameter(cmd, "ContactDepartId", DbType.String, single.ContactDepartId);
            _db.AddInParameter(cmd, "SellerId", DbType.AnsiStringFixedLength, single.SellerId);
            _db.AddInParameter(cmd, "SellerName", DbType.String, single.SellerName);
            _db.AddInParameter(cmd, "DeptId", DbType.Int32, single.DeptId);//销售员部门编号
            _db.AddInParameter(cmd, "OperatorId", DbType.AnsiStringFixedLength, single.OperatorId);
            _db.AddInParameter(cmd, "Operator", DbType.String, single.Operator);
            _db.AddInParameter(cmd, "OperatorDeptId", DbType.Int32, single.OperatorDeptId);//操作员部门编号

            _db.AddInParameter(cmd, "Adults", DbType.Int32, single.Adults);
            _db.AddInParameter(cmd, "TourIncome", DbType.Currency, single.TourIncome);
            _db.AddInParameter(cmd, "TourPay", DbType.Currency, single.TourPay);//合计支出
            _db.AddInParameter(cmd, "TourProfit", DbType.Currency, single.TourProfit);
            _db.AddInParameter(cmd, "TravellerFile", DbType.String, single.TravellerFile);
            _db.AddInParameter(cmd, "TourStatus", DbType.Byte, (int)single.TourStatus);//计划状态

            _db.AddInParameter(cmd, "MTourOrderTraveller", DbType.String, travellerXML);
            _db.AddInParameter(cmd, "MTourTeamPrice", DbType.String, teamPriceXMl);
            _db.AddInParameter(cmd, "MPlanBaseInfo", DbType.String, planXML);
            _db.AddInParameter(cmd, "MTourPlaner", DbType.String, planerXML);


            _db.AddOutParameter(cmd, "Result", DbType.Int32, 4);
            _db.AddInParameter(cmd, "WeiTuoRiQi", DbType.DateTime, single.WeiTuoRiQi);
            _db.AddInParameter(cmd, "HeTongId", DbType.AnsiStringFixedLength, single.HeTongId);
            DbHelper.RunProcedureWithResult(cmd, _db);

            return(Utils.GetInt(_db.GetParameterValue(cmd, "Result").ToString(), 4));
        }
Beispiel #5
0
        /// <summary>
        /// 保存按钮点击事件执行方法
        /// </summary>
        void BaoCun()
        {
            string msg = string.Empty;

            EyouSoft.Model.SourceStructure.MSource    source    = new EyouSoft.Model.SourceStructure.MSource();
            EyouSoft.BLL.SourceStructure.BSource      bllsource = new EyouSoft.BLL.SourceStructure.BSource();
            EyouSoft.BLL.TourStructure.BSingleService bll       = new EyouSoft.BLL.TourStructure.BSingleService();
            MSingleServiceExtend model = new MSingleServiceExtend();

            if (!String.IsNullOrEmpty(DanXiangYeWuId))
            {
                model        = bll.GetSingleServiceExtendByTourId(DanXiangYeWuId);
                model.TourId = DanXiangYeWuId;
            }

            if (Utils.GetQueryStringValue("submitplan") == "submit")
            {
                model.TourStatus = EyouSoft.Model.EnumType.TourStructure.TourStatus.待终审;
                if (model.PlanBaseInfoList != null && model.PlanBaseInfoList.Count > 0)
                {
                    for (int i = 0; i < model.PlanBaseInfoList.Count; i++)
                    {
                        model.PlanBaseInfoList[i].Status = EyouSoft.Model.EnumType.PlanStructure.PlanState.已落实;
                    }
                }
            }
            else
            {
                //联系人
                string ContactName = Utils.GetFormValue(this.txtContactName.UniqueID);
                //订单编号
                //string ordercode = Utils.GetFormValue(this.txtOrdercode.UniqueID);
                //客户电话
                string ContactTel = Utils.GetFormValue(this.txtContactTel.UniqueID);
                //客户单位
                string CustomUnit = Utils.GetFormValue(this.CustomerUnitSelect1.ClientNameKHMC);
                //客户单位编号
                string CustomUnitID = Utils.GetFormValue(this.CustomerUnitSelect1.ClientNameKHBH);

                //毛利
                string Profit = Utils.GetFormValue(this.txtProfit.UniqueID);
                //总支出
                string TotalEx = Utils.GetFormValue(this.txtTotalEx.UniqueID);
                //总收入
                string TotalIn = Utils.GetFormValue(this.txtTotalIn.UniqueID);
                //人数
                string AdultCount = Utils.GetFormValue(this.txtAdultCount.UniqueID);
                //操作状态
                string opeateStatu = Utils.GetFormValue(this.ddlopeaterStatus.UniqueID);

                if (opeateStatu != "")
                {
                    model.TourStatus = (EyouSoft.Model.EnumType.TourStructure.TourStatus)EyouSoft.Common.Utils.GetInt(opeateStatu);
                }
                else
                {
                    RCWE(UtilsCommons.AjaxReturnJson("0", "无法修改已落实的数据!"));
                }

                #region 游客信息附件
                string[] agrUpload    = Utils.GetFormValues(this.UploadControl1.ClientHideID);
                string[] oldagrUpload = Utils.GetFormValues("hideagreement");
                string   agreement    = string.Empty;
                if (oldagrUpload.Length > 0)
                {
                    for (int i = 0; i < oldagrUpload.Length; i++)
                    {
                        agreement = oldagrUpload[i].Split('|')[1];
                    }
                }
                if (agrUpload.Length > 0)
                {
                    for (int i = 0; i < agrUpload.Length; i++)
                    {
                        if (agrUpload[i].Trim() != "")
                        {
                            if (agrUpload[i].Split('|').Length > 1)
                            {
                                if (agrUpload[i].Length > 1)
                                {
                                    agreement = agrUpload[i].Split('|')[1];
                                }
                            }
                        }
                    }
                }

                #endregion
                model.TravellerFile   = agreement;
                model.CompanyId       = this.SiteUserInfo.CompanyId;
                model.ContactName     = ContactName;
                model.ContactTel      = ContactTel;
                model.ContactDepartId = Utils.GetFormValue(this.CustomerUnitSelect1.ClientNameKHBH);
                model.Operator        = this.SiteUserInfo.Name;
                model.SellerName      = Utils.GetFormValue(SellsSelect1.SellsNameClient);
                model.SellerId        = Utils.GetFormValue(SellsSelect1.SellsIDClient);
                model.DeptId          = Utils.GetInt(Utils.GetFormValue(this.hideDeptID.ClientID));
                model.BuyCompanyId    = CustomUnitID;
                model.BuyCompanyName  = CustomUnit;
                model.OperatorId      = this.SiteUserInfo.UserId;

                IList <MTourPlaner> planerlist = new List <MTourPlaner>();
                MTourPlaner         planer     = null;
                string planernamestr           = Utils.GetFormValue(SellsSelect2.SellsNameClient);
                string planerIdstr             = Utils.GetFormValue(SellsSelect2.SellsIDClient);
                string planerptIdstr           = Utils.GetFormValue(this.hidePlanerDeptID.ClientID);

                for (int i = 0; i < planerIdstr.Split(',').Length; i++)
                {
                    planer          = new MTourPlaner();
                    planer.PlanerId = planerIdstr.Split(',')[i];
                    planer.Planer   = planernamestr.Split(',')[i];
                    planer.DeptId   = Utils.GetInt(planerptIdstr.Split(',')[i]);
                    planerlist.Add(planer);
                }
                model.TourPlanersList = planerlist;
                model.Adults          = Utils.GetInt(AdultCount);
                model.ContactDepartId = this.hdContactdepartid.Value;
                //客户要求
                model.TourTeamPriceList = GetCustomRequireList();
                //供应商安排
                model.PlanBaseInfoList = GetSourcePlanList();
                //客户信息
                model.TourOrderTravellerList = GetCustomList();
                model.TourPay    = Utils.GetDecimal(TotalEx);
                model.TourIncome = Utils.GetDecimal(TotalIn);
                model.TourProfit = Utils.GetDecimal(Profit);
                if (model.TourOrderTravellerList.Count == 0)
                {
                    msg = UtilsCommons.AjaxReturnJson("0", "请至少填写一条客户信息");
                    RCWE(msg);
                }
            }

            model.OperatorDeptId = this.SiteUserInfo.DeptId;
            model.WeiTuoRiQi     = Utils.GetDateTime(Utils.GetFormValue(txtWeiTuoRiQi.UniqueID), DateTime.Today);
            model.HeTongCode     = Utils.GetFormValue(txtHeTongHao.HeTongCodeClientID);
            model.HeTongId       = Utils.GetFormValue(txtHeTongHao.HeTongIdClientID);

            bool result = false;
            if (string.IsNullOrEmpty(DanXiangYeWuId))
            {
                lock (PaiTuanXuHaoLockHelper)
                {
                    result = bll.AddSingleService(model);
                }
            }
            else
            {
                result = bll.UpdateSingleService(model);
            }

            string type = string.IsNullOrEmpty(DanXiangYeWuId) ? "新增" : "修改";
            if (Utils.GetQueryStringValue("submitplan") == "submit")
            {
                type = "提交";
            }

            if (result)
            {
                msg = UtilsCommons.AjaxReturnJson("1", type + "成功!");
            }
            else
            {
                msg = UtilsCommons.AjaxReturnJson("0", type + "失败!");
            }

            RCWE(msg);
        }
Beispiel #6
0
        /// <summary>
        /// 页面初始化
        /// </summary>
        protected void InitInfo()
        {
            this.UploadControl1.CompanyID = this.SiteUserInfo.CompanyId;
            if (string.IsNullOrEmpty(DanXiangYeWuId))
            {
                this.txtOpeator.Text     = this.SiteUserInfo.Name;
                this.txtTotalIn.ReadOnly = true;
                this.txtTotalEx.ReadOnly = true;
                this.txtProfit.ReadOnly  = true;

                return;
            }

            EyouSoft.BLL.TourStructure.BSingleService bll = new EyouSoft.BLL.TourStructure.BSingleService();
            MSingleServiceExtend model = bll.GetSingleServiceExtendByTourId(DanXiangYeWuId);

            if (model == null)
            {
                RCWE("异常请求");
            }

            this.status.Value        = ((int)model.TourStatus).ToString();
            this.txtContactName.Text = model.ContactName;
            this.txtContactTel.Text  = model.ContactTel;
            this.CustomerUnitSelect1.CustomerUnitName = model.BuyCompanyName;
            this.CustomerUnitSelect1.CustomerUnitId   = model.BuyCompanyId;
            this.SellsSelect1.SellsName = model.SellerName;
            this.SellsSelect1.SellsID   = model.SellerId;
            this.SellsSelect2.SetTitle  = "计调员";
            if (model.TourPlanersList != null && model.TourPlanersList.Count > 0)
            {
                //this.SellsSelect2.SellsName = model.TourPlanersList[0].Planer;
                string planidlist   = string.Empty;
                string plannamelist = string.Empty;
                string plandeptlist = string.Empty;
                for (int i = 0; i < model.TourPlanersList.Count; i++)
                {
                    if (i == model.TourPlanersList.Count - 1)
                    {
                        planidlist   += model.TourPlanersList[i].PlanerId;
                        plannamelist += model.TourPlanersList[i].Planer;
                        plandeptlist += model.TourPlanersList[i].DeptId;
                    }
                    else
                    {
                        planidlist   += model.TourPlanersList[i].PlanerId + ",";
                        plannamelist += model.TourPlanersList[i].Planer + ",";
                        plandeptlist += model.TourPlanersList[i].DeptId + ",";
                    }
                }
                this.SellsSelect2.SellsID   = planidlist;
                this.SellsSelect2.SellsName = plannamelist;
                this.hidePlanerDeptID.Value = plandeptlist;
            }
            this.hideDeptID.Value = model.DeptId.ToString();
            if (model.TourStatus != EyouSoft.Model.EnumType.TourStructure.TourStatus.销售未派计划 &&
                model.TourStatus != EyouSoft.Model.EnumType.TourStructure.TourStatus.计调配置完毕)
            {
                this.ddlopeaterStatus.Items.Add(new ListItem {
                    Value = ((int)model.TourStatus).ToString(), Text = model.TourStatus.ToString(), Selected = true
                });
            }
            else
            {
                this.ddlopeaterStatus.Items.FindByValue(((int)model.TourStatus).ToString()).Selected = true;;
            }

            if (model.TourStatus == EyouSoft.Model.EnumType.TourStructure.TourStatus.计调配置完毕 ||
                model.TourStatus == EyouSoft.Model.EnumType.TourStructure.TourStatus.待终审 ||
                model.TourStatus == EyouSoft.Model.EnumType.TourStructure.TourStatus.封团 ||
                model.TourStatus == EyouSoft.Model.EnumType.TourStructure.TourStatus.财务核算)
            {
                this.ddlopeaterStatus.Enabled = false;
            }

            this.txtWeiTuoRiQi.Text  = model.WeiTuoRiQi.ToString("yyyy-MM-dd");
            this.txtOpeator.Text     = model.Operator;
            this.txtTotalIn.Text     = Utils.FilterEndOfTheZeroDecimal(model.TourIncome);
            this.txtTotalEx.Text     = Utils.FilterEndOfTheZeroDecimal(model.TourPay);
            this.txtAdultCount.Text  = model.Adults.ToString();
            this.txtProfit.Text      = Utils.FilterEndOfTheZeroDecimal((model.TourIncome - model.TourPay));
            this.txtTotalIn.ReadOnly = true;
            this.txtTotalEx.ReadOnly = true;
            this.txtProfit.ReadOnly  = true;

            if (model.TravellerFile != "")
            {
                StringBuilder agreement = new StringBuilder();
                agreement.AppendFormat("<span class='upload_filename'><a href='/CommonPage/FileDownLoad.aspx?doType=downLoad&filePath={0}' target='_blank'>游客附件</a><a href=\"javascript:void(0)\" onclick=\"SingleEditPage.DelFile(this)\" title='删除附件'><img style='vertical-align:middle' src='/images/cha.gif'></a><input type=\"hidden\" name=\"hideagreement\" value='附件|{0}'/></span>", model.TravellerFile);
                this.lbFiles.Text = agreement.ToString();
            }
            if (model.TourOrderTravellerList != null && model.TourOrderTravellerList.Count > 0)
            {
                this.SetCustomList = model.TourOrderTravellerList;
                CustomListCount    = SetCustomList.Count;
            }
            if (model.TourTeamPriceList != null && model.TourTeamPriceList.Count > 0)
            {
                this.SetCusttomrequire = model.TourTeamPriceList;
                CustomRequireCount     = SetCusttomrequire.Count;
            }

            if (model.PlanBaseInfoList != null && model.PlanBaseInfoList.Count > 0)
            {
                this.SetSourcePlan = model.PlanBaseInfoList;
                SourcePlanCount    = SetSourcePlan.Count;
            }

            hdContactdepartid.Value = model.ContactDepartId;
            ltrOrderCode.Text       = model.OrderCode;
            phOrderCode.Visible     = true;

            txtHeTongHao.HeTongId   = model.HeTongId;
            txtHeTongHao.HeTongCode = model.HeTongCode;

            string printPageHSD  = new EyouSoft.BLL.ComStructure.BComSetting().GetPrintUri(SiteUserInfo.CompanyId, EyouSoft.Model.EnumType.ComStructure.PrintTemplateType.核算单);
            string heSuanDanLink = string.Format("<a target='_blank' href='{0}?referertype=2&tourid={1}' class='unbtn'>查看核算单</a>", printPageHSD, model.TourId);

            switch (model.TourStatus)
            {
            case EyouSoft.Model.EnumType.TourStructure.TourStatus.待终审:
                ltrCaoZuoTiShi.Text = heSuanDanLink + "当前业务状态为<b>待终审</b>。";
                break;

            case EyouSoft.Model.EnumType.TourStructure.TourStatus.财务核算:
                ltrCaoZuoTiShi.Text = heSuanDanLink + "当前业务状态为<b>财务核算</b>。";
                break;

            case EyouSoft.Model.EnumType.TourStructure.TourStatus.封团:
                ltrCaoZuoTiShi.Text = heSuanDanLink + "当前业务状态为<b>核算结束</b>。";
                break;

            case EyouSoft.Model.EnumType.TourStructure.TourStatus.已取消:
                ltrCaoZuoTiShi.Text = "当前业务已取消。";
                break;

            default: break;
            }

            bool _isCaoZuo = model.OperatorId == SiteUserInfo.UserId || model.SellerId == SiteUserInfo.UserId;

            if (!_isCaoZuo && model.TourPlanersList != null && model.TourPlanersList.Count > 0)
            {
                foreach (var item in model.TourPlanersList)
                {
                    if (item.PlanerId == SiteUserInfo.UserId)
                    {
                        _isCaoZuo = true; break;
                    }
                }
            }

            if (!_isCaoZuo)
            {
                phCaoZuo.Visible = false;

                if (string.IsNullOrEmpty(ltrCaoZuoTiShi.Text))
                {
                    ltrCaoZuoTiShi.Text = "你没有当前业务的操作权限。";
                }
            }
        }