Пример #1
0
 protected string GetOperaterInfo(string tourid)
 {
     System.Text.StringBuilder sb = new System.Text.StringBuilder();
     EyouSoft.Model.TourStructure.MTourBaoInfo info = new EyouSoft.BLL.TourStructure.BTour().GetTourBaoInfo(tourid);
     if (info != null)
     {
         sb.Append("<b>" + info.TourCode + "</b><br />发布人:" + info.Operator + "<br />发布时间:" + EyouSoft.Common.UtilsCommons.GetDateString(info.IssueTime, ProviderToDate) + "");
     }
     info = null;
     return(sb.ToString());
 }
Пример #2
0
        /// <summary>
        /// 获得报价标准
        /// </summary>
        /// <param name="tourID"></param>
        /// <returns></returns>
        protected string GetPriceByTour(string tourID)
        {
            string str = string.Empty;
            IList <EyouSoft.Model.TourStructure.MTourPriceStandard> list = new EyouSoft.BLL.TourStructure.BTour().GetTourSanPinPrice(tourID);

            if (list != null && list.Count > 0)
            {
                str = UtilsCommons.GetPriceStandardTable(list, this.ProviderToMoney);
            }
            return(str);
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            EyouSoft.BLL.ComStructure.BComSetting comSettingBll = new EyouSoft.BLL.ComStructure.BComSetting();
            PrintPageSp = comSettingBll.GetPrintUri(SiteUserInfo.CompanyId, EyouSoft.Model.EnumType.ComStructure.PrintTemplateType.分销商平台散拼线路行程单);
            PrintPageDd = comSettingBll.GetPrintUri(SiteUserInfo.CompanyId, EyouSoft.Model.EnumType.ComStructure.PrintTemplateType.分销商平台订单信息汇总单);
            PrintPageYk = comSettingBll.GetPrintUri(SiteUserInfo.CompanyId, EyouSoft.Model.EnumType.ComStructure.PrintTemplateType.分销商平台游客信息打印单);



            //ajax
            string type = Request.Params["Type"];

            if (!string.IsNullOrEmpty(type))
            {
                if (type.Equals("Cancle"))
                {
                    Response.Clear();
                    Response.Write(Cancle());
                    Response.End();
                }
            }
            queryID      = Utils.GetQueryStringValue("id");
            queryTourId  = Utils.GetQueryStringValue("tourid");
            queryOrderID = Utils.GetQueryStringValue("orderId");
            if (!IsPostBack)
            {
                //公告
                this.HeadDistributorControl1.CompanyId = SiteUserInfo.CompanyId;
                BindSource();
            }

            //将获取订单信息改为已读状态

            if (queryID != "")
            {
                EyouSoft.BLL.TourStructure.BTour bll = new EyouSoft.BLL.TourStructure.BTour();
                bll.IsReadCarTypeSeatChange(queryID);
            }

            string getdate = Utils.GetQueryStringValue("getdate");

            if (!string.IsNullOrEmpty(getdate))
            {
                Response.Clear();
                Response.Write(GetShortLine());
                Response.End();
            }
        }
Пример #4
0
        /// <summary>
        /// 获得发布人或供应商联系人的电话,手机
        /// </summary>
        /// <returns></returns>
        protected string GetContactInfo()
        {
            string sourceId = Utils.GetQueryStringValue("sourceId");
            string operId   = Utils.GetQueryStringValue("operId");
            string str      = string.Empty;

            EyouSoft.Model.TourStructure.MPersonInfo infoModel = new EyouSoft.BLL.TourStructure.BTour().GetPersonInfo(sourceId, operId);
            if (infoModel != null)
            {
                str = "<span style='display:none'>联系电话:" + infoModel.Phone + "<br> 联系手机:" + infoModel.Mobile + "</span>";
            }
            else
            {
                str = string.Format(str, "", "");
            }
            return(str);
        }
Пример #5
0
 /// <summary>
 /// 是否显示查看链接
 /// </summary>
 /// <param name="orderid"></param>
 /// <param name="tourid"></param>
 /// <returns></returns>
 protected string GetIsShow(object orderid, object tourid)
 {
     EyouSoft.BLL.TourStructure.BTour           bll   = new EyouSoft.BLL.TourStructure.BTour();
     EyouSoft.Model.TourStructure.MTourBaseInfo model = bll.GetTourInfo(Convert.ToString(tourid));
     System.Text.StringBuilder str = new System.Text.StringBuilder();
     if (model != null)
     {
         if (model.TourType == EyouSoft.Model.EnumType.TourStructure.TourType.组团散拼短线)
         {
             EyouSoft.BLL.TourStructure.BTourOrder bllorder = new EyouSoft.BLL.TourStructure.BTourOrder();
             IList <EyouSoft.Model.TourStructure.MTourOrderSeatInfo> list = bllorder.GetTourOrderSeatInfo(tourid.ToString());
             if (list != null && list.Count > 0)
             {
                 str.AppendFormat("<a href='javascript:void(0);' data-class='showCarModel' data-peonum='{0}' data-tourid='{1}' data-orderid='{2}'>查看</a>", GetPeopleNum(Convert.ToString(orderid)), Convert.ToString(tourid), Convert.ToString(orderid));
             }
         }
     }
     return(str.ToString());
 }
Пример #6
0
        /// <summary>
        /// 判断是否可以导游报账
        /// </summary>
        /// <returns></returns>
        private bool Privs_DaoYouBaoZhang()
        {
            var tourinfo = new EyouSoft.BLL.TourStructure.BTour().GetTourInfo(Utils.GetQueryStringValue("tourId"));

            if (tourinfo == null)
            {
                return(false);
            }
            if (tourinfo.SaleInfo == null)
            {
                return(false);
            }
            if (tourinfo.TourPlaner == null || tourinfo.TourPlaner.Count == 0)
            {
                return(false);
            }

            //已安排导游 非安排导游不可报账
            if (tourinfo.GuideList != null && tourinfo.GuideList.Count > 0)
            {
                var daoyou = tourinfo.GuideList.FirstOrDefault(item => item.GuidId == SiteUserInfo.UserId);
                if (daoyou == null)
                {
                    return(false);
                }
            }
            else//未安排导游,团队销售员、计调员均可操作导游报账
            {
                var jidiao = tourinfo.TourPlaner.FirstOrDefault(item => item.PlanerId == SiteUserInfo.UserId);
                if (tourinfo.SaleInfo.SellerId != SiteUserInfo.UserId && jidiao == null)
                {
                    return(false);
                }
            }
            //团队状态判断
            TourStatus[] status = { TourStatus.导游带团, TourStatus.导游报帐 };
            if (!status.Contains(tourinfo.TourStatus))
            {
                return(false);
            }

            return(true);
        }
Пример #7
0
        /// <summary>
        /// 获取散拼计划报价标准
        /// </summary>
        /// <returns></returns>
        private string GetMTourPriceStandard()
        {
            //返回的信息
            string result = "";
            //计划编号
            string TourId = Utils.GetQueryStringValue("argument");
            //拼接数据
            string strb = string.Empty;
            IList <MTourPriceStandard> list = new EyouSoft.BLL.TourStructure.BTour().GetTourSanPinPrice(TourId);

            if (list != null && list.Count > 0)
            {
                strb   = UtilsCommons.GetPriceStandardTable(list, ProviderToMoney);
                result = UtilsCommons.AjaxReturnJson("true", strb.ToString());
            }
            else
            {
                result = UtilsCommons.AjaxReturnJson("false", "数据为空");
            }
            return(result);
        }
Пример #8
0
        /// <summary>
        /// 保存新的报价
        /// </summary>
        /// <returns></returns>
        private string PageSave()
        {
            string msg  = string.Empty;
            int    type = Utils.GetInt(Utils.GetQueryStringValue("type"));

            #region 获取表单
            //线路区域编号
            int areaID = Utils.GetInt(Utils.GetFormValue("sltArea"));
            //线路编号
            string routeID = Utils.GetFormValue(this.hideRouteID.UniqueID);
            //线路名称
            string routeName = Utils.GetFormValue(this.txt_RouteName.UniqueID);
            //天数
            int days = Utils.GetInt(Utils.GetFormValue(this.txt_Days.UniqueID));
            //客源地 国家
            int contryID = Utils.GetInt(Utils.GetFormValue("sltCountry"));
            //客源地 省份
            int provinceID = Utils.GetInt(Utils.GetFormValue("sltProvince"));
            //询价单位 编号
            string buyCompanyID = Utils.GetFormValue(this.UC_CustomerUnitSelect.ClientNameKHBH);
            //询价单位 名称
            string buyCompanyName = Utils.GetFormValue(this.UC_CustomerUnitSelect.ClientNameKHMC);
            //联系人
            string contactName = Utils.GetFormValue(this.txt_Contact.UniqueID);
            //联系电话
            string contactTel = Utils.GetFormValue(this.txt_ConTel.UniqueID);
            //联系人部门编号
            string contactDepartId = Utils.GetFormValue(this.hideContactDeptId.UniqueID);
            //销售员编号
            string sellsID = Utils.GetFormValue(this.SellsSelect1.SellsIDClient);
            //销售员名称
            string sellsName = Utils.GetFormValue(this.SellsSelect1.SellsNameClient);
            //报价员 取当前登录用户
            EyouSoft.Model.TourStructure.MOperatorInfo operatorModel = new EyouSoft.Model.TourStructure.MOperatorInfo();
            operatorModel.OperatorId = this.SiteUserInfo.UserId;
            operatorModel.Name       = this.SiteUserInfo.Name;
            operatorModel.Phone      = this.SiteUserInfo.Telephone;
            //成人数
            int adultCount = Utils.GetInt(Utils.GetFormValue(this.txt_Adult.UniqueID));
            //成人价格
            decimal adultPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtAdultPrice.UniqueID));
            //儿童数
            int childCount = Utils.GetInt(Utils.GetFormValue(this.txt_Child.UniqueID));
            //儿童价格
            decimal childPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtChildPrice.UniqueID));
            //其它价格
            decimal otherPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtOtherPrice.UniqueID));
            //行程特色
            string planContent = Utils.EditInputText(Request.Form[this.txtPlanContent.UniqueID]);
            //价格备注
            string quoteRemark = Utils.GetFormValue(this.txtQuoteRemark.UniqueID);
            //合计金额
            decimal sumPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtSumPrice.UniqueID));
            //签字资料(附件)


            #region 表单获取
            //出团时间
            DateTime successDateBegin = Utils.GetDateTime(Utils.GetFormValue(this.txtLDate.UniqueID), DateTime.Now);
            //出发交通
            string successsStraffBegin = Utils.GetFormValue(this.txtSuccesssStraffBegin.UniqueID);
            //返回交通
            string successsStraffEnd = Utils.GetFormValue(this.txtSuccesssStraffEnd.UniqueID);
            //集合方式
            string successGather = Utils.GetFormValue(this.txtSuccessGather.UniqueID);
            //增加费用
            decimal successAddPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtSuccessAddPrice.UniqueID), 0);
            //增加费用备注
            string successAddPriceRemark = Utils.GetFormValue(this.txtSuccessAddPriceRemark.UniqueID);
            //减少费用
            decimal successReducePrice = Utils.GetDecimal(Utils.GetFormValue(this.txtSuccessReducePrice.UniqueID));
            //减少费用备注
            string successReducePriceRemark = Utils.GetFormValue(this.txtSuccessReducePriceRemark.UniqueID);
            //导游现收
            decimal successGuideIncome = Utils.GetDecimal(Utils.GetFormValue(this.txtSuccessGuideIncome.UniqueID));
            //订单备注
            string successOrderRemark = Utils.GetFormValue(this.txtSuccessOrderRemark.UniqueID);
            #region 超限申请表单获取
            //垫付金额
            decimal applyPrice = Utils.GetDecimal(Utils.GetFormValue(this.txtApplyPrice.UniqueID));
            //超限备注
            string applyRemarks = Utils.GetFormValue(this.txtApplyRemarks.UniqueID);
            //申请人编号
            string applyManID = this.SiteUserInfo.UserId;
            //申请日期
            DateTime applyDateTime = DateTime.Now;
            #endregion

            //变更标题
            string changeTitle = Utils.GetFormValue("txt_ChangeTitle");
            //变更备注
            string changeRemark = Utils.GetFormValue("txt_ChangeRemark");
            //签证附件(新)
            string[] visaUpload    = Utils.GetFormValues(this.UploadControl1.ClientHideID);
            string[] oldVisaUpload = Utils.GetFormValues("hideVisaFile");
            #endregion

            #endregion
            //1=保存
            string saveType = Utils.GetQueryStringValue("saveType");

            #region 表单后台验证
            if (areaID == 0)
            {
                msg = "请选择线路区域!";
            }
            if (routeName == "")
            {
                msg += "<br />请输入线路名称!";
            }
            if (days == 0)
            {
                msg += "<br />请输入天数!";
            }
            if (buyCompanyID == "")
            {
                msg += "<br />请选择客户单位!";
            }
            if (sellsID == "")
            {
                msg += "<br />请输入销售员!";
            }
            if (adultCount == 0)
            {
                msg += "<br />请输入成人数!";
            }
            if (adultPrice == 0)
            {
                msg += "<br />请输入成人价!";
            }

            if (msg != "")
            {
                return("{\"result\":\"0\",\"msg\":\"" + msg + "\"}");
            }

            #endregion


            EyouSoft.BLL.TourStructure.BTour           bll   = new EyouSoft.BLL.TourStructure.BTour();
            EyouSoft.Model.TourStructure.MTourTeamInfo model = new EyouSoft.Model.TourStructure.MTourTeamInfo();
            act = Utils.GetQueryStringValue("act");
            if (act == "update")
            {
                model.TourId = Utils.GetQueryStringValue("id");
            }
            model.AddCostRemark = successAddPriceRemark;
            model.AdultPrice    = adultPrice;
            model.Adults        = adultCount;
            model.AdvanceApp    = null;
            model.AreaId        = areaID;
            //model.AreaName = "";
            model.ChildPrice              = childPrice;
            model.Childs                  = childCount;
            model.CompanyId               = this.SiteUserInfo.CompanyId;
            model.CompanyInfo             = new MCompanyInfo();
            model.CompanyInfo.CompanyId   = buyCompanyID;
            model.CompanyInfo.CompanyName = buyCompanyName;
            model.CompanyInfo.Contact     = contactName;
            model.CompanyInfo.Phone       = contactTel;
            model.ContactDepartId         = contactDepartId;
            string costCalculation = string.Empty;
            EyouSoft.Model.TourStructure.MTourService tourService = UtilsCommons.GetTourService(out costCalculation);
            model.CostCalculation = costCalculation;
            model.CountryId       = contryID;
            model.Gather          = successGather;
            model.GuideIncome     = successGuideIncome;

            model.LDate = successDateBegin;

            #region 签证附件
            IList <EyouSoft.Model.ComStructure.MComAttach> visaList = null;
            if (visaUpload.Length > 0)
            {
                visaList = new List <EyouSoft.Model.ComStructure.MComAttach>();
                for (int i = 0; i < visaUpload.Length; i++)
                {
                    if (visaUpload[i].Trim() != "")
                    {
                        if (visaUpload[i].Split('|').Length > 1)
                        {
                            EyouSoft.Model.ComStructure.MComAttach visaModel = new EyouSoft.Model.ComStructure.MComAttach();
                            visaModel.Downloads = 0;
                            visaModel.FilePath  = visaUpload[i].Split('|')[1];
                            visaModel.ItemType  = EyouSoft.Model.EnumType.ComStructure.AttachItemType.报价签证资料;
                            visaModel.Name      = visaUpload[i].Split('|')[0];
                            visaModel.Size      = 0;
                            visaList.Add(visaModel);
                        }
                    }
                }
            }
            if (oldVisaUpload.Length > 0)
            {
                if (visaList == null)
                {
                    visaList = new List <EyouSoft.Model.ComStructure.MComAttach>();
                }
                for (int i = 0; i < oldVisaUpload.Length; i++)
                {
                    EyouSoft.Model.ComStructure.MComAttach visaModel = new EyouSoft.Model.ComStructure.MComAttach();
                    visaModel.Downloads = Utils.GetInt(oldVisaUpload[i].Split('|')[2]);
                    visaModel.FilePath  = oldVisaUpload[i].Split('|')[1];
                    visaModel.ItemType  = EyouSoft.Model.EnumType.ComStructure.AttachItemType.计划签证资料;
                    visaModel.Name      = oldVisaUpload[i].Split('|')[0];
                    visaModel.Size      = 0;
                    visaList.Add(visaModel);
                }
            }
            model.VisaFileList = visaList;
            #endregion

            model.LTraffic                = successsStraffBegin;
            model.OperatorInfo            = new EyouSoft.Model.TourStructure.MOperatorInfo();
            model.OperatorInfo.OperatorId = this.SiteUserInfo.UserId;
            model.OperatorInfo.Name       = this.SiteUserInfo.Name;
            model.OperatorInfo.Phone      = this.SiteUserInfo.Telephone;
            model.OrderRemark             = successOrderRemark;
            model.OtherCost               = otherPrice;
            Dictionary <string, object> quoteType = UtilsCommons.GetServiceType();
            bool IsTourOrSubentry = (bool)quoteType["IsTourOrSubentry"];
            if (IsTourOrSubentry)
            {
                //整团
                tourService.ServiceStandard = quoteType["Service"].ToString();
                model.OutQuoteType          = EyouSoft.Model.EnumType.TourStructure.TourQuoteType.整团;
            }
            else
            {
                //分项
                model.TourTeamPrice = (IList <EyouSoft.Model.TourStructure.MTourTeamPrice>)quoteType["Service"];
                model.OutQuoteType  = EyouSoft.Model.EnumType.TourStructure.TourQuoteType.分项;
            }

            model.PlanFeature       = planContent;
            model.ProvinceId        = provinceID;
            model.QuoteRemark       = quoteRemark;
            model.ReduceCostRemark  = successReducePriceRemark;
            model.RouteId           = routeID;
            model.RouteName         = routeName;
            model.RTraffic          = successsStraffEnd;
            model.SaleAddCost       = successAddPrice;
            model.TourChangeTitle   = changeTitle;
            model.TourChangeContent = changeRemark;

            //获得销售员信息实体
            EyouSoft.Model.ComStructure.MComUser sellsModel = new EyouSoft.BLL.ComStructure.BComUser().GetModel(sellsID, SiteUserInfo.CompanyId);
            if (sellsModel != null)
            {
                model.SaleInfo          = new EyouSoft.Model.TourStructure.MSaleInfo();
                model.SaleInfo.SellerId = sellsID;
                model.SaleInfo.Name     = sellsName;
                model.SaleInfo.Phone    = sellsModel.ContactMobile;
                model.SaleInfo.DeptId   = sellsModel.DeptId;
            }

            model.SaleReduceCost = successReducePrice;
            model.SalerIncome    = sumPrice - successGuideIncome;
            model.AdvanceApp     = null;
            model.SumPrice       = sumPrice;

            model.TourDays    = days;
            model.TourPlan    = UtilsCommons.GetPlanList();
            model.TourService = tourService;
            #region 无需赋值
            //model.PlanPeopleNumber
            //model.QuoteRemark
            //model.RealPeopleNumber
            //model.Review
            //model.ReviewTime
            //model.TourPlaner
            //model.TourPlanItem
            //model.TourPlanStatus
            //model.PeopleNumberLast
            //model.GuideList = null;
            //model.IsChange = false;
            //model.IsReview
            //model.IsSubmit
            //model.IsSure 列表
            //model.LeavePeopleNumber
            #endregion

            model.HeTongCode = Utils.GetFormValue(txtHeTongHao.HeTongCodeClientID);
            model.HeTongId   = Utils.GetFormValue(txtHeTongHao.HeTongIdClientID);

            //超限赋值
            if (saveType == "2")
            {
                model.AdvanceApp                = new EyouSoft.Model.TourStructure.MAdvanceApp();
                model.AdvanceApp.Applier        = this.SiteUserInfo.Name;
                model.AdvanceApp.ApplierId      = this.SiteUserInfo.UserId;
                model.AdvanceApp.DisburseAmount = applyPrice;
                model.AdvanceApp.ApplyTime      = applyDateTime;
                model.AdvanceApp.DeptId         = this.SiteUserInfo.DeptId;
                model.AdvanceApp.Remark         = applyRemarks;
            }
            //变更明细

            switch (type)
            {
            case 1:
                model.TourType  = EyouSoft.Model.EnumType.TourStructure.TourType.组团团队;
                model.Traveller = UtilsCommons.GetTravelList();
                break;

            case 2:
                model.TourType  = EyouSoft.Model.EnumType.TourStructure.TourType.地接团队;
                model.Traveller = UtilsCommons.GetTravelList();
                break;

            case 3:
                model.TourType  = EyouSoft.Model.EnumType.TourStructure.TourType.出境团队;
                model.Traveller = UtilsCommons.GetTravelListS();
                break;
            }
            if (act == "add" || act == "copy")
            {
                model.TourStatus = EyouSoft.Model.EnumType.TourStructure.TourStatus.销售未派计划;
                int r = bll.AddTourTeam(model);
                switch (r)
                {
                case 0: msg = UtilsCommons.AjaxReturnJson("0", "新增计划 失败,请稍后再试!"); break;

                case 1: msg = UtilsCommons.AjaxReturnJson("1", "新增计划 成功,正在跳转.."); break;

                case 2: msg = UtilsCommons.AjaxReturnJson("1", "新增计划 成功,已提交垫付申请!"); break;

                case 3:
                    msg = UtilsCommons.AjaxReturnJson("2", "操作成功! 销售员已超限,请收款或超限申请!", model.TourId);
                    break;

                case 4:
                    msg = UtilsCommons.AjaxReturnJson("2", "操作成功! 客户单位已超限,请收款或超限申请!", model.TourId);
                    break;

                case 5:
                    msg = UtilsCommons.AjaxReturnJson("2", "操作成功! 销售员和客户单位已超限,请收款或超限申请!", model.TourId);
                    break;
                }
            }
            if (act == "update" && model.TourId != "")
            {
                model.UpdateTime = DateTime.Now;
                if (bll.UpdateTourTeam(model))
                {
                    msg = UtilsCommons.AjaxReturnJson("1", "修改计划 成功,正在跳转..", model.TourId);
                }
                else
                {
                    msg = UtilsCommons.AjaxReturnJson("0", "修改计划 失败,请稍后再试!", model.TourId);
                }
            }
            return(msg);
        }
Пример #9
0
        /// <summary>
        /// 页面初始化
        /// </summary>
        /// <param name="id">操作ID</param>
        protected void PageInit(string id)
        {
            EyouSoft.BLL.TourStructure.BTour           bll       = new EyouSoft.BLL.TourStructure.BTour();
            EyouSoft.Model.TourStructure.MTourBaseInfo baseModel = bll.GetTourInfo(id);

            if (baseModel != null && (baseModel.TourType == EyouSoft.Model.EnumType.TourStructure.TourType.出境团队 || baseModel.TourType == EyouSoft.Model.EnumType.TourStructure.TourType.地接团队 || baseModel.TourType == EyouSoft.Model.EnumType.TourStructure.TourType.组团团队))
            {
                EyouSoft.Model.TourStructure.MTourTeamInfo model = (EyouSoft.Model.TourStructure.MTourTeamInfo)baseModel;
                if (model.TourCode.Trim() != "")
                {
                    this.lblTourCode.Text = model.TourCode;
                }
                BindAreaList(model.AreaId);
                this.hideRouteID.Value  = model.RouteId;
                this.txt_RouteName.Text = model.RouteName;
                this.txt_Days.Text      = model.TourDays.ToString();
                this.UC_CustomerUnitSelect.CustomerUnitId   = model.CompanyInfo != null ? model.CompanyInfo.CompanyId : "";
                this.UC_CustomerUnitSelect.CustomerUnitName = model.CompanyInfo != null ? model.CompanyInfo.CompanyName : "";
                this.txt_Contact.Text        = model.CompanyInfo != null ? model.CompanyInfo.Contact : "";
                this.txt_ConTel.Text         = model.CompanyInfo != null ? model.CompanyInfo.Phone : "";
                this.hideContactDeptId.Value = model.ContactDepartId;
                if (act == "copy")
                {
                    this.SellsSelect1.SellsID   = SiteUserInfo.UserId;
                    this.SellsSelect1.SellsName = SiteUserInfo.Name;
                    lblTourCode.Text            = "";
                }
                else
                {
                    this.SellsSelect1.SellsID   = model.SaleInfo.SellerId;
                    this.SellsSelect1.SellsName = model.SaleInfo.Name;
                }
                this.txt_Adult.Text      = model.Adults.ToString();
                this.txt_Child.Text      = model.Childs.ToString();
                this.txtPlanContent.Text = model.PlanFeature;
                this.txtAdultPrice.Text  = Utils.FilterEndOfTheZeroDecimal(model.AdultPrice);
                this.txtChildPrice.Text  = Utils.FilterEndOfTheZeroDecimal(model.ChildPrice);
                this.txtOtherPrice.Text  = Utils.FilterEndOfTheZeroDecimal(model.OtherCost);
                this.txtSumPrice.Text    = Utils.FilterEndOfTheZeroDecimal(model.SumPrice);
                this.txtQuoteRemark.Text = model.QuoteRemark;
                this.CountryID           = model.CountryId.ToString();
                this.ProvinceID          = model.ProvinceId.ToString();
                if (model.OutQuoteType == EyouSoft.Model.EnumType.TourStructure.TourQuoteType.分项)
                {
                    this.ForeignQuote1.IsTourOrSubentry = false;
                    this.ForeignQuote1.StandardTourList = model.TourTeamPrice;
                }
                else
                {
                    this.ForeignQuote1.IsTourOrSubentry = true;
                    this.ForeignQuote1.GroupService     = model.TourService != null ? model.TourService.ServiceStandard : "";
                }
                this.Journey1.SetPlanList       = model.TourPlan;
                CostAccounting1.CostCalculation = model.CostCalculation;
                if (model.TourService != null)
                {
                    CostAccounting1.NoNeedItem       = model.TourService.NoNeedItem;
                    CostAccounting1.ShoppingItem     = model.TourService.ShoppingItem;
                    CostAccounting1.ChildServiceItem = model.TourService.ChildServiceItem;
                    CostAccounting1.OwnExpense       = model.TourService.OwnExpense;
                    CostAccounting1.NeedAttention    = model.TourService.NeedAttention;
                    CostAccounting1.WarmRemind       = model.TourService.WarmRemind;
                    CostAccounting1.InsiderInfor     = model.TourService.InsiderInfor;
                }
                this.txtLDate.Text = model.LDate.HasValue ? model.LDate.Value.ToString("yyyy-MM-dd") : "";
                this.txtSuccesssStraffBegin.Text      = model.LTraffic;
                this.txtSuccesssStraffEnd.Text        = model.RTraffic;
                this.txtSuccessGather.Text            = model.Gather;
                this.txtSuccessAddPrice.Text          = Utils.FilterEndOfTheZeroDecimal(model.SaleAddCost);
                this.txtSuccessAddPriceRemark.Text    = model.AddCostRemark;
                this.txtSuccessReducePrice.Text       = Utils.FilterEndOfTheZeroDecimal(model.SaleReduceCost);
                this.txtSuccessReducePriceRemark.Text = model.ReduceCostRemark;
                this.txtSuccessGuideIncome.Text       = Utils.FilterEndOfTheZeroDecimal(model.GuideIncome);
                this.lblSuccessSalerIncome.Text       = Utils.FilterEndOfTheZeroDecimal(model.SalerIncome);
                this.txtSuccessOrderRemark.Text       = model.OrderRemark;

                if (act != "copy")
                {
                    txtHeTongHao.HeTongId   = model.HeTongId;
                    txtHeTongHao.HeTongCode = model.HeTongCode;
                }

                //签证附件
                if (model.VisaFileList != null && model.VisaFileList.Count > 0)
                {
                    string visaStr = string.Empty;
                    for (int i = 0; i < model.VisaFileList.Count; i++)
                    {
                        visaStr += "<span class='upload_filename'>&nbsp;<a href='" + model.VisaFileList[i].FilePath + "' target='_blank'>" + model.VisaFileList[i].Name + "</a><a href='javascript:void(0);' onclick='AddTeamPlan.RemoveVisaFile(this);return false;'> <img style='vertical-align:middle' src='/images/cha.gif'></a><input type='hidden' name='hideVisaFile' value='" + model.VisaFileList[i].Name + "|" + model.VisaFileList[i].FilePath + "|" + model.VisaFileList[i].Downloads.ToString() + "'>;</span>";
                    }
                    this.lblVisaFiles.Text = visaStr;
                }

                switch (model.TourType)
                {
                case EyouSoft.Model.EnumType.TourStructure.TourType.地接团队:
                case EyouSoft.Model.EnumType.TourStructure.TourType.组团团队:
                    this.phdTravelControlS.Visible    = false;
                    this.TravelControl1.SetTravelList = model.Traveller;
                    break;

                case EyouSoft.Model.EnumType.TourStructure.TourType.出境团队:
                    this.phdTravelControl.Visible      = false;
                    this.TravelControlS1.SetTravelList = model.Traveller;
                    break;
                }


                #region 修改控制
                this.phdSave.Visible = false;
                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.计调配置完毕 ||
                    model.TourStatus == EyouSoft.Model.EnumType.TourStructure.TourStatus.资金超限
                    )
                {
                    this.phdSave.Visible = true;
                }

                if (act == "copy")
                {
                    this.phdSave.Visible = true;
                }

                //按钮权限控制
                BtnPowerControl();

                //是否可以操作该数据
                if (!SiteUserInfo.IsHandleElse && act != "copy")
                {
                    if (model.OperatorInfo != null && model.OperatorInfo.OperatorId != SiteUserInfo.UserId && model.SaleInfo != null && model.SaleInfo.SellerId != SiteUserInfo.UserId)
                    {
                        this.phdSave.Visible = false;
                    }
                }



                #endregion

                #region 变更控制
                if (model.TourStatus != EyouSoft.Model.EnumType.TourStructure.TourStatus.销售未派计划)
                {
                    this.hideIsChangeInput.Value = "true";
                }
                else
                {
                    this.hideIsChangeInput.Value = "false";
                }
                #endregion

                switch (model.TourStatus)
                {
                case EyouSoft.Model.EnumType.TourStructure.TourStatus.垫付申请: this.hideOverrunState.Value = "3"; break;

                case EyouSoft.Model.EnumType.TourStructure.TourStatus.审核失败: this.hideOverrunState.Value = "4"; break;
                }
            }
            else
            {
                Utils.ResponseGoBack();
            }
        }
Пример #10
0
        /// <summary>
        /// 保存按钮点击事件执行方法
        /// </summary>
        protected string PageSave()
        {
            string msg = string.Empty;

            #region 获取表单
            //线路区域编号
            int areaID = Utils.GetInt(Utils.GetFormValue("sltArea"));
            //线路编号
            string routeID = Utils.GetFormValue(this.hideRouteID.UniqueID);
            //线路名称
            string routeName = Utils.GetFormValue(this.txt_RouteName.UniqueID);
            //天数
            int days = Utils.GetInt(Utils.GetFormValue(this.txt_Days.UniqueID));
            //销售员编号
            string sellsID = Utils.GetFormValue(this.SellsSelect1.SellsIDClient);
            //销售员名称
            string sellsName = Utils.GetFormValue(this.SellsSelect1.SellsNameClient);
            //报价员 取当前登录用户
            EyouSoft.Model.TourStructure.MOperatorInfo operatorModel = new EyouSoft.Model.TourStructure.MOperatorInfo();
            operatorModel.OperatorId = this.SiteUserInfo.UserId;
            operatorModel.Name       = this.SiteUserInfo.Name;
            operatorModel.Phone      = this.SiteUserInfo.Telephone;
            //出发交通
            string successsStraffBegin = Utils.GetFormValue(this.txtSuccesssStraffBegin.UniqueID);
            //返回交通
            string successsStraffEnd = Utils.GetFormValue(this.txtSuccesssStraffEnd.UniqueID);
            //集合方式
            string successGather = Utils.GetFormValue(this.txtSuccessGather.UniqueID);
            //出团时间
            string[] successDateBegin = Utils.GetFormValue(this.hideLeaveDate.UniqueID).Split(',');
            //预控人数
            int planPeopleNumber = Utils.GetInt(Utils.GetFormValue(this.txtPeopleCount.UniqueID));
            //行程特色
            string planContent = Utils.EditInputText(Request.Form[this.txtPlanContent.UniqueID]);
            //停收时间
            int stopDate = Utils.GetIntSign(Utils.GetFormValue(this.txtStopDate.UniqueID));
            //是否同业分销
            bool isShowDistribution = Utils.GetFormValue(this.cbxDistribution.UniqueID) == "on" ? true : false;
            //变更标题
            string changeTitle = Utils.GetFormValue("txt_ChangeTitle");
            //变更备注
            string changeRemark = Utils.GetFormValue("txt_ChangeRemark");
            //附件
            string filsPath = Utils.GetFormValue(this.UploadControl2.ClientHideID);
            if (filsPath == "")
            {
                filsPath = Utils.GetFormValue("hideOtherFile");
            }
            //签证附件(新)
            string[] visaUpload    = Utils.GetFormValues(this.UploadControl1.ClientHideID);
            string[] oldVisaUpload = Utils.GetFormValues("hideVisaFile");
            //关键字
            string searchKey = Utils.GetFormValue(this.txtSearchKey.UniqueID);
            #endregion

            #region 表单后台验证
            if (areaID == 0)
            {
                msg = "请选择线路区域!";
            }
            if (routeName == "")
            {
                msg += "<br />请输入线路名称!";
            }
            if (days == 0)
            {
                msg += "<br />请输入天数!";
            }
            if (planPeopleNumber == 0)
            {
                msg += "<br />请输入预控人数!";
            }

            if (sellsID == "")
            {
                msg += "<br />请输入销售员!";
            }
            if (successDateBegin.Length == 0)
            {
                msg += "<br />请选择出团日期!";
            }
            if (msg != "")
            {
                return(UtilsCommons.AjaxReturnJson("0", msg));
            }
            #endregion


            EyouSoft.BLL.TourStructure.BTour             bll   = new EyouSoft.BLL.TourStructure.BTour();
            EyouSoft.Model.TourStructure.MTourSanPinInfo model = new EyouSoft.Model.TourStructure.MTourSanPinInfo();
            string act = Utils.GetQueryStringValue("act");
            if (act == "update")
            {
                model.TourId = Utils.GetQueryStringValue("id");
            }

            model.CompanyId = this.SiteUserInfo.CompanyId;
            model.AreaId    = areaID;
            string costCalculation = string.Empty;
            EyouSoft.Model.TourStructure.MTourService tourService = UtilsCommons.GetTourService(out costCalculation);
            model.CostCalculation         = costCalculation;
            model.Gather                  = successGather;
            model.PlanPeopleNumber        = planPeopleNumber;
            model.LTraffic                = successsStraffBegin;
            model.OperatorInfo            = new EyouSoft.Model.TourStructure.MOperatorInfo();
            model.OperatorInfo.OperatorId = this.SiteUserInfo.UserId;
            model.OperatorInfo.Name       = this.SiteUserInfo.Name;
            model.OperatorInfo.Phone      = this.SiteUserInfo.Telephone;
            model.PlanFeature             = planContent;
            model.RouteId                 = routeID;
            model.RouteName               = routeName;
            model.RTraffic                = successsStraffEnd;
            model.StopDays                = stopDate;
            model.IsShowDistribution      = isShowDistribution;
            model.TourChangeTitle         = changeTitle;
            model.TourChangeContent       = changeRemark;
            model.KeyName                 = searchKey;

            #region 附件
            if (filsPath != "")
            {
                string[] filesArray = filsPath.Split('|');
                if (filesArray.Length > 1)
                {
                    model.FilePath = filesArray[1];
                }
            }
            #endregion

            #region 签证附件
            IList <EyouSoft.Model.ComStructure.MComAttach> visaList = null;
            if (visaUpload.Length > 0)
            {
                visaList = new List <EyouSoft.Model.ComStructure.MComAttach>();
                for (int i = 0; i < visaUpload.Length; i++)
                {
                    if (visaUpload[i].Trim() != "")
                    {
                        if (visaUpload[i].Split('|').Length > 1)
                        {
                            EyouSoft.Model.ComStructure.MComAttach visaModel = new EyouSoft.Model.ComStructure.MComAttach();
                            visaModel.Downloads = 0;
                            visaModel.FilePath  = visaUpload[i].Split('|')[1];
                            visaModel.ItemType  = EyouSoft.Model.EnumType.ComStructure.AttachItemType.计划签证资料;
                            visaModel.Name      = visaUpload[i].Split('|')[0];
                            visaModel.Size      = 0;
                            visaList.Add(visaModel);
                        }
                    }
                }
            }
            if (oldVisaUpload.Length > 0)
            {
                if (visaList == null)
                {
                    visaList = new List <EyouSoft.Model.ComStructure.MComAttach>();
                }
                for (int i = 0; i < oldVisaUpload.Length; i++)
                {
                    EyouSoft.Model.ComStructure.MComAttach visaModel = new EyouSoft.Model.ComStructure.MComAttach();
                    visaModel.Downloads = Utils.GetInt(oldVisaUpload[i].Split('|')[2]);
                    visaModel.FilePath  = oldVisaUpload[i].Split('|')[1];
                    visaModel.ItemType  = EyouSoft.Model.EnumType.ComStructure.AttachItemType.计划签证资料;
                    visaModel.Name      = oldVisaUpload[i].Split('|')[0];
                    visaModel.Size      = 0;
                    visaList.Add(visaModel);
                }
            }
            model.VisaFileList = visaList;
            #endregion


            //获得销售员信息实体
            EyouSoft.Model.ComStructure.MComUser sellsModel = new EyouSoft.BLL.ComStructure.BComUser().GetModel(sellsID, SiteUserInfo.CompanyId);
            if (sellsModel != null)
            {
                model.SaleInfo          = new EyouSoft.Model.TourStructure.MSaleInfo();
                model.SaleInfo.SellerId = sellsID;
                model.SaleInfo.Name     = sellsName;
                model.SaleInfo.Phone    = sellsModel.ContactMobile;
                model.SaleInfo.DeptId   = sellsModel.DeptId;
            }
            model.TourDays    = days;
            model.TourPlan    = UtilsCommons.GetPlanList();
            model.TourService = tourService;

            model.MTourPriceStandard = UtilsCommons.GetPriceStandard();

            model.LDate = null;
            model.RDate = null;

            #region 无需赋值
            //model.QuoteRemark
            //model.RealPeopleNumber
            //model.Review
            //model.ReviewTime
            //model.TourPlaner
            //model.TourPlanItem
            //model.TourPlanStatus
            //model.PeopleNumberLast
            //model.GuideList = null;
            //model.IsChange = false;
            //model.IsReview
            //model.IsSubmit
            //model.IsSure 列表
            //model.LeavePeopleNumber
            #endregion
            //超限赋值
            switch (type)
            {
            case 1:
                model.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.组团散拼; break;

            case 2:
                model.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.地接散拼; break;

            case 3:
                model.TourType = EyouSoft.Model.EnumType.TourStructure.TourType.出境散拼; break;
            }
            if (act == "add" || act == "copy")
            {
                bool result = false;
                model.TourStatus = EyouSoft.Model.EnumType.TourStructure.TourStatus.销售未派计划;

                model.TourChildrenInfo = new List <MTourChildrenInfo>();
                for (int i = 0; i < successDateBegin.Length; i++)
                {
                    MTourChildrenInfo childModel = new MTourChildrenInfo();
                    childModel.LDate = Utils.GetDateTime(successDateBegin[i]);
                    model.TourChildrenInfo.Add(childModel);
                }
                result = bll.AddTourSanPin(model);
                if (result)
                {
                    msg = UtilsCommons.AjaxReturnJson("1", "新增散拼计划 成功,正在跳转");
                }
                else
                {
                    msg = UtilsCommons.AjaxReturnJson("0", "新增散拼计划 失败,请稍后再试!");
                }
            }
            if (act == "update" && model.TourId != "")
            {
                model.UpdateTime = DateTime.Now;
                model.LDate      = Utils.GetDateTime(successDateBegin[0]);
                if (bll.UpdateTourSanPin(model))
                {
                    msg = UtilsCommons.AjaxReturnJson("1", "修改散拼计划 成功,正在跳转..");
                }
                else
                {
                    msg = UtilsCommons.AjaxReturnJson("0", "修改散拼计划 失败,请稍后再试!");
                }
            }
            return(msg);
        }
Пример #11
0
        /// <summary>
        /// 页面初始化
        /// </summary>
        /// <param name="id">操作ID</param>
        protected void PageInit(string id)
        {
            #region 用户控件初始化

            #endregion
            EyouSoft.BLL.TourStructure.BTour bll = new EyouSoft.BLL.TourStructure.BTour();

            EyouSoft.Model.TourStructure.MTourBaseInfo baseModel = bll.GetTourInfo(id);
            if (baseModel != null && (baseModel.TourType == EyouSoft.Model.EnumType.TourStructure.TourType.出境散拼 || baseModel.TourType == EyouSoft.Model.EnumType.TourStructure.TourType.地接散拼 || baseModel.TourType == EyouSoft.Model.EnumType.TourStructure.TourType.组团散拼))
            {
                EyouSoft.Model.TourStructure.MTourSanPinInfo model = (EyouSoft.Model.TourStructure.MTourSanPinInfo)baseModel;
                #region 表单控件赋值
                this.lblLeaveDateMore.Text = "出团日期:";
                BindAreaList(model.AreaId);
                this.cbxDistribution.Checked     = model.IsShowDistribution;
                this.hideRouteID.Value           = model.RouteId;
                this.txt_RouteName.Text          = model.RouteName;
                this.txt_Days.Text               = model.TourDays.ToString();
                this.txtPeopleCount.Text         = model.PlanPeopleNumber.ToString();
                this.lblLeaveDate.Text           = UtilsCommons.GetDateString(model.LDate, this.ProviderToDate);
                this.hideLeaveDate.Value         = model.LDate.HasValue ? model.LDate.Value.ToString("yyyy-MM-dd") : "";
                this.txtSuccesssStraffBegin.Text = model.LTraffic;
                this.txtSuccesssStraffEnd.Text   = model.RTraffic;
                this.txtSuccessGather.Text       = model.Gather;
                this.txtStopDate.Text            = model.StopDays.ToString();

                if (act == "copy")
                {
                    this.SellsSelect1.SellsID   = SiteUserInfo.UserId;
                    this.SellsSelect1.SellsName = SiteUserInfo.Name;
                }
                else
                {
                    this.SellsSelect1.SellsID   = model.SaleInfo.SellerId;
                    this.SellsSelect1.SellsName = model.SaleInfo.Name;
                }
                this.txtPlanContent.Text = model.PlanFeature;
                this.txtSearchKey.Text   = model.KeyName;
                // 报价标准
                this.PriceStand1.InitMode         = false;
                this.PriceStand1.InitTour         = true;
                this.PriceStand1.SetPriceStandard = model.MTourPriceStandard;
                //行程安排
                this.Journey1.SetPlanList = model.TourPlan;
                //散拼 服务
                if (model.TourService != null)
                {
                    CostAccounting1.ServiceStandard  = model.TourService.ServiceStandard;
                    CostAccounting1.NoNeedItem       = model.TourService.NoNeedItem;
                    CostAccounting1.ShoppingItem     = model.TourService.ShoppingItem;
                    CostAccounting1.ChildServiceItem = model.TourService.ChildServiceItem;
                    CostAccounting1.OwnExpense       = model.TourService.OwnExpense;
                    CostAccounting1.NeedAttention    = model.TourService.NeedAttention;
                    CostAccounting1.WarmRemind       = model.TourService.WarmRemind;
                    CostAccounting1.InsiderInfor     = model.TourService.InsiderInfor;
                }
                #endregion

                #region 附件
                //附件
                if (model.FilePath.Trim() != "")
                {
                    this.lblFiles.Text = "<span class='upload_filename'>&nbsp;<a href='" + model.FilePath + "' target='_blank'>查看附件</a><a href='javascript:void(0);' onclick='AddSanPlan.RemoveVisaFile(this);return false;'> <img style='vertical-align:middle' src='/images/cha.gif'></a><input type='hidden' name='hideOtherFile' value='|" + model.FilePath + "'></span>";
                }

                //签证附件
                if (model.VisaFileList != null && model.VisaFileList.Count > 0)
                {
                    string visaStr = string.Empty;
                    for (int i = 0; i < model.VisaFileList.Count; i++)
                    {
                        visaStr += "<span class='upload_filename'>&nbsp;<a href='" + model.VisaFileList[i].FilePath + "' target='_blank'>" + model.VisaFileList[i].Name + "</a><a href='javascript:void(0);' onclick='AddSanPlan.RemoveVisaFile(this);return false;'> <img style='vertical-align:middle' src='/images/cha.gif'></a><input type='hidden' name='hideVisaFile' value='" + model.VisaFileList[i].Name + "|" + model.VisaFileList[i].FilePath + "|" + model.VisaFileList[i].Downloads.ToString() + "'></span>";
                    }
                    this.lblVisaFiles.Text = visaStr;
                }
                #endregion

                #region 修改控制
                this.phdSave.Visible = false;
                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.计调配置完毕
                    )
                {
                    //供应商发布的散拼计划不能修改
                    if (model.SourceId.Trim() != "")
                    {
                        this.phdSave.Visible = false;
                    }
                    else
                    {
                        this.phdSave.Visible = true;
                    }
                }

                if (act == "copy")
                {
                    this.phdSave.Visible = true;
                }

                //按钮权限控制
                BtnPowerControl();

                //是否可以操作该数据
                if (!SiteUserInfo.IsHandleElse && act != "copy")
                {
                    if (model.OperatorInfo != null && model.OperatorInfo.OperatorId != SiteUserInfo.UserId && model.SaleInfo != null && model.SaleInfo.SellerId != SiteUserInfo.UserId)
                    {
                        this.phdSave.Visible = false;
                    }
                }
                #endregion

                #region 变更控制
                if (model.TourStatus != EyouSoft.Model.EnumType.TourStructure.TourStatus.销售未派计划)
                {
                    this.hideIsChangeInput.Value = "true";
                }
                else
                {
                    this.hideIsChangeInput.Value = "false";
                }
                #endregion
            }
            else
            {
                Utils.ResponseGoBack();
            }
        }
Пример #12
0
        /// <summary>
        /// 销售报账报账权限控制,返回是否允许销售报账
        /// </summary>
        /// <param name="caoZuoDaoYouShouZhi">是否允许操作导游收入、支出</param>
        bool Privs_XiaoShouBaoZhang(out bool caoZuoDaoYouShouZhi)
        {
            caoZuoDaoYouShouZhi = false;

            //无权限 不可报账
            if (!CheckGrant(Privs.销售中心_销售报账_销售报账操作))
            {
                return(false);
            }

            var tourinfo = new EyouSoft.BLL.TourStructure.BTour().GetTourInfo(Utils.GetQueryStringValue("tourId"));

            if (tourinfo == null)
            {
                return(false);
            }
            if (tourinfo.SaleInfo == null)
            {
                return(false);
            }

            //非本团销售员 不可报账
            if (tourinfo.SaleInfo.SellerId != SiteUserInfo.UserId)
            {
                return(false);
            }

            //合同金额未确认 不可报账
            if (!new EyouSoft.BLL.TourStructure.BTour().GetConfirmMoneyStatus(Utils.GetQueryStringValue("tourId")))
            {
                return(false);
            }

            bool tiaoGuoDaoYouBaoZhang = false;
            var  setting = new EyouSoft.BLL.ComStructure.BComSetting().GetModel(SiteUserInfo.CompanyId);

            if (setting != null)
            {
                tiaoGuoDaoYouBaoZhang = setting.SkipGuide;
            }

            TourStatus[] status = { TourStatus.销售待审 };
            if (tiaoGuoDaoYouBaoZhang)
            {
                status = new TourStatus[] { TourStatus.导游带团, TourStatus.导游报帐, TourStatus.销售待审 }
            }
            ;

            //团队状态判断
            if (!status.Contains(tourinfo.TourStatus))
            {
                return(false);
            }

            if (tiaoGuoDaoYouBaoZhang)
            {
                caoZuoDaoYouShouZhi = true;
            }

            return(true);
        }

        /// <summary>
        /// 计调报账报账权限控制,返回是否允许计调报账
        /// </summary>
        /// <param name="caoZuoDaoYouShouZhi">是否允许操作导游收入、支出</param>
        bool Privs_JiDiaoBaoZhang(out bool caoZuoDaoYouShouZhi)
        {
            caoZuoDaoYouShouZhi = false;

            //无权限 不可报账
            if (!CheckGrant(Privs.计调中心_计调报账_计调报账操作))
            {
                return(false);
            }

            var tourinfo = new EyouSoft.BLL.TourStructure.BTour().GetTourInfo(Utils.GetQueryStringValue("tourId"));

            if (tourinfo == null)
            {
                return(false);
            }
            if (tourinfo.TourPlaner == null || tourinfo.TourPlaner.Count == 0)
            {
                return(false);
            }

            //非本团计调不可报账
            var jidiao = tourinfo.TourPlaner.FirstOrDefault(item => item.PlanerId == SiteUserInfo.UserId);

            if (jidiao == null)
            {
                return(false);
            }

            //合同金额未确认 不可报账
            if (!new EyouSoft.BLL.TourStructure.BTour().GetConfirmMoneyStatus(Utils.GetQueryStringValue("tourId")))
            {
                return(false);
            }

            bool tiaoGuoDaoYouBaoZhang   = false;
            bool tiaoGuoXiaoShouBaoZhang = false;
            var  setting = new EyouSoft.BLL.ComStructure.BComSetting().GetModel(SiteUserInfo.CompanyId);

            if (setting != null)
            {
                tiaoGuoDaoYouBaoZhang   = setting.SkipGuide;
                tiaoGuoXiaoShouBaoZhang = setting.SkipGuide;
            }

            TourStatus[] status = { TourStatus.计调待审 };

            if (tiaoGuoDaoYouBaoZhang)
            {
                if (tiaoGuoXiaoShouBaoZhang)
                {
                    status = new TourStatus[] { TourStatus.导游带团, TourStatus.导游报帐, TourStatus.销售待审, TourStatus.计调待审 };
                }
                else
                {
                    //status = new TourStatus[] { TourStatus.计调待审 };
                }
            }
            else
            {
                if (tiaoGuoXiaoShouBaoZhang)
                {
                    status = new TourStatus[] { TourStatus.销售待审, TourStatus.计调待审 };
                }
                else
                {
                    //status = new TourStatus[] { TourStatus.计调待审 };
                }
            }

            //团队状态判断
            if (!status.Contains(tourinfo.TourStatus))
            {
                return(false);
            }

            //if (tiaoGuoDaoYouBaoZhang && tiaoGuoXiaoShouBaoZhang) caoZuoDaoYouShouZhi = true;
            if (tiaoGuoDaoYouBaoZhang)
            {
                caoZuoDaoYouShouZhi = true;
            }

            return(true);
        }
Пример #13
0
        /// <summary>
        /// 导游报账权限控制,返回是否允许导游报账
        /// </summary>
        /// <returns></returns>
        bool Privs_DaoYouBaoZhang()
        {
            //无权限 不可报账
            if (!CheckGrant(Privs.导游中心_导游报账_导游报账操作))
            {
                return(false);
            }

            var tourinfo = new EyouSoft.BLL.TourStructure.BTour().GetTourInfo(Utils.GetQueryStringValue("tourId"));

            if (tourinfo == null)
            {
                return(false);
            }
            if (tourinfo.SaleInfo == null)
            {
                return(false);
            }
            if (tourinfo.TourPlaner == null || tourinfo.TourPlaner.Count == 0)
            {
                return(false);
            }

            //已安排导游 非安排导游不可报账
            if (tourinfo.GuideList != null && tourinfo.GuideList.Count > 0)
            {
                /*bool isexists = false;
                 * foreach (var daoyou1 in tourinfo.GuideList)
                 * {
                 *  if (daoyou.GuidId == SiteUserInfo.UserId) { isexists = true; break; }
                 * }
                 *
                 * if (!isexists) return false;*/

                var daoyou = tourinfo.GuideList.FirstOrDefault(item => item.GuidId == SiteUserInfo.UserId);
                if (daoyou == null)
                {
                    return(false);
                }
            }
            else//未安排导游,团队销售员、计调员均可操作导游报账
            {
                var jidiao = tourinfo.TourPlaner.FirstOrDefault(item => item.PlanerId == SiteUserInfo.UserId);

                //if (!(tourinfo.SaleInfo.SellerId == SiteUserInfo.UserId || jidiao != null)) return false;

                if (tourinfo.SaleInfo.SellerId == SiteUserInfo.UserId || jidiao != null)
                {
                }
                else
                {
                    return(false);
                }
            }

            //团队状态判断
            TourStatus[] status = { TourStatus.导游带团, TourStatus.导游报帐 };
            if (!status.Contains(tourinfo.TourStatus))
            {
                return(false);
            }

            return(true);
        }
Пример #14
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void DataInit()
        {
            //获取分页参数并强转
            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1);
            EyouSoft.Model.TourStructure.MTourSanPinSearch searchModel = new EyouSoft.Model.TourStructure.MTourSanPinSearch();
            #region 搜索条件
            //团号
            string teamNum = Utils.GetQueryStringValue("txtTourID");
            //线路名称
            string lineName = Utils.GetQueryStringValue("txtAreaName");
            //线路区域
            string areaLine = Utils.GetQueryStringValue("dropAreaID");
            //天数
            string txtday = Utils.GetQueryStringValue("txtday");
            //销售员
            string salesMan = Utils.GetQueryStringValue(this.SellsSelect1.SellsNameClient);
            this.SellsSelect1.SellsName = salesMan;
            //出团时间
            DateTime?leaveTime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtstardate"));
            //回团时间
            DateTime?backTime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtenddate"));
            //线路区域ID
            int areaID = Utils.GetInt(Utils.GetQueryStringValue("dropAreaID"));
            ///关键字编号
            int keyid = Utils.GetInt(Utils.GetQueryStringValue("KeyId"));
            #endregion
            searchModel.AreaId     = areaID;
            searchModel.LLDate     = backTime;
            searchModel.SLDate     = leaveTime;
            searchModel.TourCode   = teamNum;
            searchModel.RouteName  = lineName;
            searchModel.TourDays   = Utils.GetInt(txtday);
            searchModel.SellerName = salesMan;
            searchModel.KeyId      = keyid;
            //声明list对象保存收客列表数据
            IList <MTourTongHanInfo> list = new EyouSoft.BLL.TourStructure.BTour().GetTYFXTourSanPinList(SiteUserInfo.CompanyId, pageSize, pageIndex, ref recordCount, searchModel);
            if (list != null && list.Count > 0)
            {
                this.rptList.DataSource = list;
                this.rptList.DataBind();
                //绑定分页
                BindPage();
                this.litMsg.Visible = false;
            }
            else
            {
                this.litMsg.Visible = true;
                this.ExporPageInfoSelect1.Visible = false;
                this.ExporPageInfoSelect2.Visible = false;
            }

            //IList<EyouSoft.Model.ComStructure.MComArea> keyList = new EyouSoft.BLL.ComStructure.BComArea().GetAreaByCID(SiteUserInfo.CompanyId);

            IList <MKeyTour> keyList = new EyouSoft.BLL.TourStructure.BTour().GetKeyTour(SiteUserInfo.CompanyId);
            if (keyList != null && keyList.Count > 0)
            {
                this.rptKsy.DataSource = keyList;
                this.rptKsy.DataBind();
            }
            else
            {
                this.licMsg.Text = "";
            }
        }