Exemple #1
0
        private string CheckData(string id)
        {
            //审核操作
            bool result = false;

            EyouSoft.BLL.TourStructure.BTour bll = new EyouSoft.BLL.TourStructure.BTour();
            EyouSoft.Model.EnumType.TourStructure.ShowPublisher showPuEmue = Utils.GetFormValue("rdo_CheckTour") == "1" ? EyouSoft.Model.EnumType.TourStructure.ShowPublisher.审核人 : EyouSoft.Model.EnumType.TourStructure.ShowPublisher.供应商;
            EyouSoft.Model.TourStructure.MSaleInfo saleInfo = new EyouSoft.Model.TourStructure.MSaleInfo();
            saleInfo.DeptId   = SiteUserInfo.DeptId;
            saleInfo.Mobile   = SiteUserInfo.Mobile;
            saleInfo.Name     = SiteUserInfo.Name;
            saleInfo.Phone    = SiteUserInfo.Telephone;
            saleInfo.SellerId = SiteUserInfo.UserId;
            result            = bll.Review(id, showPuEmue, saleInfo, UtilsCommons.GetPriceStandard());
            if (result == false)
            {
                return(UtilsCommons.AjaxReturnJson("0", "审核失败!"));
            }
            else
            {
                return(UtilsCommons.AjaxReturnJson("1", "审核成功,正在刷新页面"));
            }
        }
        /// <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(Utils.GetFormValue(this.txtPlanContent.UniqueID));
            //停收时间
            int stopDate = Utils.GetInt(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.TourCarLocation = GetTourCarLocationList();
            model.TourCarType     = GetTourCarTypeList();
            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);
        }