Ejemplo n.º 1
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(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);
        }
Ejemplo n.º 2
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.MTourSanPinInfo model = (EyouSoft.Model.TourStructure.MTourSanPinInfo)bll.GetTourInfo(id);
            if (model != null)
            {
                #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.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;
                }
                //上车地点设置
                if (model.TourCarLocation != null && model.TourCarLocation.Count > 0)
                {
                    StringBuilder sb = new StringBuilder();
                    string        strId = string.Empty, strText = string.Empty, strPriceJ = string.Empty,
                                  strPriceS = string.Empty, strDesc = string.Empty, strPickUpTourId = string.Empty;
                    foreach (var item in model.TourCarLocation)
                    {
                        sb.AppendFormat("<li><a href='javascript:void(0);' onclick='AddSanPlan.RemoveLi(this);return false;' data-isExist='{2}' class='car-close' data-id='{0}'></a><span>{1}</span></li>", item.CarLocationId, item.Location, item.isTourOrderExists ? 1 : 0);
                        strPickUpTourId += item.TourLocationId + ",";
                        strId           += item.CarLocationId + ",";
                        strText         += item.Location + ",";
                        strPriceJ       += item.OffPrice.ToString() + ",";
                        strPriceS       += item.OnPrice.ToString() + ",";
                        strDesc         += item.Desc + "&&&";
                    }
                    this.PickUpPoint1.PickUpOptions = sb.ToString();
                    this.PickUpPoint1.PickUpTourId  = model.TourId;
                    this.PickUpPoint1.PickUpID      = strId.Substring(0, strId.Length - 1);
                    this.PickUpPoint1.PickUpText    = strText.Substring(0, strText.Length - 1);
                    this.PickUpPoint1.PickUpPriceJ  = strPriceJ.Substring(0, strPriceJ.Length - 1);
                    this.PickUpPoint1.PickUpPriceS  = strPriceS.Substring(0, strPriceS.Length - 1);
                    this.PickUpPoint1.PickUpDesc    = strDesc.Substring(0, strDesc.Length - 3);
                }
                //预设车型
                this.PresetBusType1.TourId       = model.TourId;
                this.PresetBusType1.ContrloModel = act;
                if (model.TourCarType != null && model.TourCarType.Count > 0)
                {
                    this.PresetBusType1.PreSetTypeList = model.TourCarType;
                }
                else
                {
                    this.DivPrisetBus.Visible = false;
                }
                #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();
            }
        }
Ejemplo n.º 3
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();
            }
        }
Ejemplo n.º 4
0
        private void PageInit(string tourId)
        {
            this.PriceStand1.CompanyID = SiteUserInfo.CompanyId;
            this.PriceStand1.ShowModel = true;
            //  this.PriceStand1.IsDistribution = true;
            this.PriceStand1.InitMode = false;

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

            EyouSoft.Model.TourStructure.MTourSanPinInfo model = (EyouSoft.Model.TourStructure.MTourSanPinInfo)bll.GetTourInfo(tourId);
            if (model != null)
            {
                IList <EyouSoft.Model.TourStructure.MTourPriceStandard> MTourPriceStandard = model.MTourPriceStandard;
                List <EyouSoft.Model.TourStructure.MTourPriceLevel>     list = new List <EyouSoft.Model.TourStructure.MTourPriceLevel>();

                if (MTourPriceStandard != null && MTourPriceStandard.Count != 0)
                {
                    foreach (var standard in MTourPriceStandard)
                    {
                        list.AddRange(standard.PriceLevel);
                    }

                    var Leve = list.Where(c => c.LevelId == SiteUserInfo.TourCompanyInfo.LevelId).ToList();


                    IList <EyouSoft.Model.TourStructure.MTourPriceStandard> currentStand = new List <EyouSoft.Model.TourStructure.MTourPriceStandard>();
                    for (int i = 0; i < MTourPriceStandard.Count; i++)
                    {
                        var s = MTourPriceStandard[i];
                        EyouSoft.Model.TourStructure.MTourPriceStandard item = new EyouSoft.Model.TourStructure.MTourPriceStandard();
                        item.Id           = s.Id;
                        item.Standard     = s.Standard;
                        item.StandardName = s.StandardName;
                        item.TourId       = s.TourId;
                        item.PriceLevel   = new List <EyouSoft.Model.TourStructure.MTourPriceLevel>();


                        for (int j = 0; j < s.PriceLevel.Count; j++)
                        {
                            var p = s.PriceLevel[j];
                            for (int k = 0; k < Leve.Count; k++)
                            {
                                var l = Leve[k];
                                if (p.LevelId == Leve[k].LevelId && p.AdultPrice == l.AdultPrice && p.ChildPrice == l.ChildPrice)
                                {
                                    item.PriceLevel = new List <EyouSoft.Model.TourStructure.MTourPriceLevel>();
                                    item.PriceLevel.Add(Leve[k]);
                                    currentStand.Add(item);
                                    break;
                                }
                            }
                        }
                    }

                    this.PriceStand1.SetPriceStandard = currentStand;
                    this.hfTourType.Value             = ((int)model.TourType).ToString();

                    //游客控件的显示
                    switch (model.TourType)
                    {
                    case EyouSoft.Model.EnumType.TourStructure.TourType.组团散拼:
                    case EyouSoft.Model.EnumType.TourStructure.TourType.地接散拼:
                    case EyouSoft.Model.EnumType.TourStructure.TourType.组团散拼短线:
                        this.phdTravelControlS.Visible = false;
                        break;

                    case EyouSoft.Model.EnumType.TourStructure.TourType.出境散拼:
                        this.phdTravelControl.Visible = false;
                        break;
                    }
                }
                #region  车地点下拉框
                string IsShortRoute = Utils.GetQueryStringValue("IsShort");
                if (!string.IsNullOrEmpty(IsShortRoute))
                {
                    IList <EyouSoft.Model.TourStructure.MTourCarLocation> CarList = bll.GetTourCarLocation(tourId);
                    if (CarList != null && CarList.Count > 0)
                    {
                        StringBuilder sb = new StringBuilder();
                        sb.Append("<option value=''>请选择</option>");
                        for (int i = 0; i < CarList.Count; i++)
                        {
                            sb.AppendFormat("<option value='{0}' data-onprice='{2}' data-offprice='{3}' data-desc='{4}' data-location='{5}' >{1}</option>", CarList[i].TourLocationId, CarList[i].Location, CarList[i].OnPrice.ToString("f2"), CarList[i].OffPrice.ToString("f2"), CarList[i].Desc, CarList[i].Location);
                        }
                        strPickUpPosition = sb.ToString();
                        //this.SetSeat1.TourId = tourId;
                    }
                    else
                    {
                        this.ph_PickUpPostion.Visible = false;
                    }
                    if (model.TourCarType != null && model.TourCarType.Count > 0)
                    {
                        this.SetSeat1.TourId = tourId;
                    }
                    else
                    {
                        this.PhCarModel.Visible = false;
                    }
                }
                else
                {
                    this.ph_PickUpPostion.Visible = false;
                    this.PhCarModel.Visible       = false;
                }
                #endregion
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 页面验证
        /// </summary>
        /// <param name="order"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        private bool PageValidate(ref EyouSoft.Model.TourStructure.MTourOrderExpand order, ref string msg)
        {
            //验证的字段
            string DCompanyName = Utils.GetFormValue("txtDCompanyName");

            if (string.IsNullOrEmpty(DCompanyName))
            {
                msg += "客源单位 不能为空!</br>";
            }
            string DContactName = Utils.GetFormValue("txtDContactName");

            if (string.IsNullOrEmpty(DContactName))
            {
                msg += "联系人 不能为空!</br>";
            }

            string DContactTel = Utils.GetFormValue("txtDContactTel");

            if (string.IsNullOrEmpty(DContactTel))
            {
                msg += "联系定电话 不能为空!</br>";
            }

            int Adults = Utils.GetInt(Utils.GetFormValue("txtAdults"));

            if (Adults < 0)
            {
                msg += "成人数 格式不正确!</br>";
            }

            int Childs = Utils.GetInt(Utils.GetFormValue("txtChilds"));

            if (Childs < 0)
            {
                msg += "儿童数 格式不正确!</br>";
            }
            decimal SumPrice = Utils.GetDecimal(Utils.GetFormValue("txtSumPrice"));

            if (SumPrice <= 0)
            {
                msg += "合计金额 格式不正确!</br>";
            }
            string saveDate = Utils.GetFormValue("txtSaveSeatDate");

            if (!string.IsNullOrEmpty(saveDate))
            {
                DateTime?SaveSeatDate = Utils.GetDateTimeNullable(saveDate);
                if (!SaveSeatDate.HasValue)
                {
                    msg += "留位时间 格式不正确!</br>";
                }
            }
            string tourType = Utils.GetFormValue("hfTourType");

            if (msg.Length <= 0)
            {
                //短线
                if (!string.IsNullOrEmpty(Utils.GetQueryStringValue("IsShort")))
                {
                    string CarLocationID = Utils.GetFormValue("selPickUpPosition");
                    if (!string.IsNullOrEmpty(CarLocationID))
                    {
                        EyouSoft.Model.TourStructure.MTourOrderCarLocation modelcar = new EyouSoft.Model.TourStructure.MTourOrderCarLocation();
                        string location = this.hidlocation.Value;
                        string desc     = this.hidDesc.Value;
                        modelcar.Desc              = desc;
                        modelcar.Location          = location;
                        modelcar.OffPrice          = Utils.GetDecimal(this.hidOffPrice.Value);
                        modelcar.OnPrice           = Utils.GetDecimal(this.hidOnPrice.Value);
                        modelcar.TourLocationId    = CarLocationID;
                        order.TourOrderCarLocation = modelcar;
                    }
                    IList <EyouSoft.Model.TourStructure.MTourOrderCarTypeSeat> listSeat = new List <EyouSoft.Model.TourStructure.MTourOrderCarTypeSeat>();
                    listSeat = Newtonsoft.Json.JsonConvert.DeserializeObject <IList <MTourOrderCarTypeSeat> >(Utils.GetFormValue(this.SetSeat1.setSeatHidClientID));
                    order.TourOrderCarTypeSeatList = listSeat;
                }
                order.CompanyId      = SiteUserInfo.CompanyId;
                order.TourId         = Utils.GetQueryStringValue("TourId");
                order.BuyCompanyName = SiteUserInfo.TourCompanyInfo.CompanyName;
                order.BuyCompanyId   = SiteUserInfo.TourCompanyInfo.CompanyId;
                //客源单位联系人信息(当前分销商)
                string lxrId = SiteUserInfo.TourCompanyInfo.LxrId;
                order.ContactDepartId = lxrId;
                EyouSoft.BLL.CrmStructure.BCrmLinkMan   link    = new EyouSoft.BLL.CrmStructure.BCrmLinkMan();
                EyouSoft.Model.CrmStructure.MCrmLinkman linkMan = link.GetLinkManModel(lxrId);
                if (linkMan != null)
                {
                    order.ContactName = linkMan.Name;
                    order.ContactTel  = linkMan.Telephone;
                }


                order.OrderStatus = EyouSoft.Model.EnumType.TourStructure.OrderStatus.未处理;

                //联系人信息
                order.DCompanyName = DCompanyName;
                order.DContactName = DContactName;
                order.DContactTel  = DContactTel;



                //销售员信息
                order.SellerId   = SiteUserInfo.UserId;
                order.SellerName = SiteUserInfo.Name;
                order.DeptId     = SiteUserInfo.DeptId;

                //操作员信息
                order.Operator   = SiteUserInfo.Name;
                order.OperatorId = SiteUserInfo.UserId;

                order.Adults = Adults;
                order.Childs = Childs;

                //价格组成
                string strPrice = Utils.GetFormValue("txt_PriceStand_radio_price");
                if (!string.IsNullOrEmpty(strPrice))
                {
                    string[] price = strPrice.Split('|');
                    order.LevId      = Utils.GetInt(price[0]);
                    order.AdultPrice = Utils.GetDecimal(price[1]);
                    order.ChildPrice = Utils.GetDecimal(price[2]);
                }

                string strStandard = Utils.GetFormValue("_hstandard");
                if (!string.IsNullOrEmpty(strStandard))
                {
                    int Standard = Utils.GetInt(strStandard);
                    order.PriceStandId = Standard;
                    EyouSoft.BLL.TourStructure.BTour                        bll          = new EyouSoft.BLL.TourStructure.BTour();
                    EyouSoft.Model.TourStructure.MTourSanPinInfo            model        = (EyouSoft.Model.TourStructure.MTourSanPinInfo)bll.GetTourInfo(order.TourId);
                    IList <EyouSoft.Model.TourStructure.MTourPriceStandard> standardList = model.MTourPriceStandard.Where(c => c.Standard == Standard).ToList();

                    if (standardList != null && standardList.Count != 0)
                    {
                        List <EyouSoft.Model.TourStructure.MTourPriceLevel> levelList = new List <EyouSoft.Model.TourStructure.MTourPriceLevel>();
                        foreach (var a in standardList)
                        {
                            levelList.AddRange(a.PriceLevel);
                        }
                        if (levelList != null && levelList.Count != 0)
                        {
                            EyouSoft.Model.TourStructure.MTourPriceLevel item = levelList.SingleOrDefault(c => c.LevType == EyouSoft.Model.EnumType.ComStructure.LevType.内部结算价);
                            if (item != null)
                            {
                                order.PeerAdultPrice  = item.AdultPrice;
                                order.PeerChildPrice  = item.ChildPrice;
                                order.PeerLevId       = item.LevelId;
                                order.SettlementMoney = order.PeerAdultPrice * Adults + order.PeerChildPrice * Childs;
                            }
                        }
                    }
                }

                order.SaleAddCost          = Utils.GetDecimal(Utils.GetFormValue("txtSaleAddCost"));
                order.SaleAddCostRemark    = Utils.GetFormValue("txtSaleAddCostRemark");
                order.SaleReduceCost       = Utils.GetDecimal(Utils.GetFormValue("txtSaleReduceCost"));
                order.SaleReduceCostRemark = Utils.GetFormValue("txtSaleReduceCostRemark");

                order.SumPrice = Utils.GetDecimal(Utils.GetFormValue("txtSumPrice"));

                order.SaveSeatDate = Utils.GetDateTimeNullable(Utils.GetFormValue("txtSaveSeatDate"));
                order.OrderRemark  = Utils.GetFormValue("txtOrderRemark");



                order.OrderType = EyouSoft.Model.EnumType.TourStructure.OrderType.分销商下单;

                order.MTourOrderTravellerList = new List <EyouSoft.Model.TourStructure.MTourOrderTraveller>();
                order.TourType = (EyouSoft.Model.EnumType.TourStructure.TourType)Enum.Parse(typeof(EyouSoft.Model.EnumType.TourStructure.TourType), tourType);
                switch (order.TourType)
                {
                case EyouSoft.Model.EnumType.TourStructure.TourType.组团散拼:
                case TourType.组团散拼短线:
                case EyouSoft.Model.EnumType.TourStructure.TourType.地接散拼:
                    order.MTourOrderTravellerList = UtilsCommons.GetTravelList();
                    break;

                case EyouSoft.Model.EnumType.TourStructure.TourType.出境散拼:
                    order.MTourOrderTravellerList = UtilsCommons.GetTravelListS();
                    break;
                }
            }

            return(msg.Length <= 0);
        }
Ejemplo n.º 6
0
        private void PageInit(string tourid, string type)
        {
            this.txtsourcename.Text = SiteUserInfo.CompanyName;
            this.txtname.Text       = SiteUserInfo.Name;
            this.txttel.Text        = SiteUserInfo.Telephone;
            this.txtfax.Text        = SiteUserInfo.Fax;

            //团实体
            EyouSoft.BLL.TourStructure.BTour               bll      = new EyouSoft.BLL.TourStructure.BTour();
            EyouSoft.Model.TourStructure.MTourSanPinInfo   model    = null;
            EyouSoft.Model.EnumType.TourStructure.TourType tourtype = bll.GetTourType(tourid);
            switch (tourtype)
            {
            case EyouSoft.Model.EnumType.TourStructure.TourType.出境团队:
            case EyouSoft.Model.EnumType.TourStructure.TourType.地接团队:
            case EyouSoft.Model.EnumType.TourStructure.TourType.组团团队:
                //跳转到团队打印单
                EyouSoft.BLL.ComStructure.BComSetting bcom = new EyouSoft.BLL.ComStructure.BComSetting();
                Response.Redirect(bcom.GetPrintUri(this.SiteUserInfo.CompanyId, EyouSoft.Model.EnumType.ComStructure.PrintTemplateType.团队行程单) + "?tourId=" + tourid);
                break;

            case EyouSoft.Model.EnumType.TourStructure.TourType.单项服务:
                this.TSelfProject.Visible = false;
                this.TService.Visible     = false;
                this.TShopping.Visible    = false;
                this.TWarmRemind.Visible  = false;
                return;
            }
            if (type == "")
            {
                model = (EyouSoft.Model.TourStructure.MTourSanPinInfo)bll.GetTourInfo(tourid);
            }
            else
            {
                model = (EyouSoft.Model.TourStructure.MTourSanPinInfo)bll.GetOldTourInfo(tourid, this.SiteUserInfo.CompanyId);
            }
            this.lbTourCode.Text  = model.TourCode;
            this.lbRouteName.Text = model.RouteName;
            if (model != null)
            {
                #region 行程
                IList <EyouSoft.Model.TourStructure.MPlanBaseInfo> planinfo = model.TourPlan.OrderBy(m => m.Days).ToList();
                if (planinfo != null && planinfo.Count > 0)
                {
                    StringBuilder strAllDateInfo = new StringBuilder();
                    string        Dinner         = string.Empty;//包餐(早、中、晚)
                    foreach (EyouSoft.Model.TourStructure.MPlanBaseInfo Plan in planinfo)
                    {
                        if (Plan.Breakfast)
                        {
                            Dinner += "早、";
                        }
                        if (Plan.Lunch)
                        {
                            Dinner += "中、";
                        }
                        if (Plan.Supper)
                        {
                            Dinner += "晚、";
                        }

                        string riQi = "第" + Plan.Days + "天&nbsp;";
                        if (model.LDate.HasValue)
                        {
                            riQi += model.LDate.Value.AddDays(Plan.Days - 1).ToString("yyyy-MM-dd");
                        }

                        strAllDateInfo.AppendFormat("<table width='696' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td width='35%' class='small_title'><b class='font16'>{0}  {6}</b></td><td width='15%' class='small_title'><b class='font14'>交通:{1}</b></td><td width='20%' class='small_title'><b class='font14'>餐:{2}</b></td><td width='30%' class='small_title'><b class='font14'>住宿:{3}</b></td></tr></table><table width='696' border='0' align='center' cellpadding='0' cellspacing='0' class='list_2' style='margin-top:0px;'><tr><td class='td_text' style='border-top:none;' width='{7}'>{4}</td>{5}</tr></table>", riQi, Plan.Traffic, Dinner, Plan.Hotel, Plan.Content, string.IsNullOrEmpty(Plan.FilePath) ? "" : "<td style='border-top:none;'><img src='http://" + Request.Url.Authority + Plan.FilePath + "' width='202' height='163' /></td>", Plan.Section, string.IsNullOrEmpty(Plan.FilePath) ? "100%" : "480px");
                        Dinner = string.Empty;
                    }
                    this.lbtourplan.Text = strAllDateInfo.ToString();
                }
                #endregion

                #region 线路特色
                if (string.IsNullOrEmpty(model.PlanFeature))
                {
                    this.TPlanFeature.Visible = false;
                }
                else
                {
                    this.lbPlanFeature.Text = model.PlanFeature;
                }
                #endregion

                #region 计划服务
                if (model.TourService != null)
                {
                    #region  务标准
                    if (string.IsNullOrEmpty(model.TourService.ServiceStandard))
                    {
                        this.TService.Visible = false;
                    }
                    else
                    {
                        this.lbService.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourService.ServiceStandard);
                    }
                    #endregion

                    #region  务不含
                    if (string.IsNullOrEmpty(model.TourService.NoNeedItem))
                    {
                        this.TNoService.Visible = false;
                    }
                    else
                    {
                        this.lbnoService.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourService.NoNeedItem);
                    }
                    #endregion

                    #region 购物安排
                    if (string.IsNullOrEmpty(model.TourService.ShoppingItem))
                    {
                        this.TShopping.Visible = false;
                    }
                    else
                    {
                        this.lbshopping.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourService.ShoppingItem);
                    }
                    #endregion

                    #region 儿童安排
                    if (string.IsNullOrEmpty(model.TourService.ChildServiceItem))
                    {
                        this.TChildren.Visible = false;
                    }
                    else
                    {
                        this.lbchildren.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourService.ChildServiceItem);
                    }
                    #endregion

                    #region 自费项目
                    if (string.IsNullOrEmpty(model.TourService.OwnExpense))
                    {
                        this.TSelfProject.Visible = false;
                    }
                    else
                    {
                        this.lbselfproject.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourService.OwnExpense);
                    }
                    #endregion

                    #region 温馨提醒
                    if (string.IsNullOrEmpty(model.TourService.WarmRemind))
                    {
                        this.TWarmRemind.Visible = false;
                    }
                    else
                    {
                        this.lbwarmremind.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourService.WarmRemind);
                    }
                    #endregion

                    #region 注意事项
                    if (string.IsNullOrEmpty(model.TourService.NeedAttention))
                    {
                        this.TNeedAttention.Visible = false;
                    }
                    else
                    {
                        this.lbneedattention.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourService.NeedAttention);
                    }
                    #endregion
                }
                else
                {
                    this.TPlanService.Visible = false;
                }
                #endregion

                #region 价格组成
                if (model.MTourPriceStandard != null && model.MTourPriceStandard.Count > 0)
                {
                    this.lbPriceStand.Text = GetPriceStandardTable(model.MTourPriceStandard);
                }
                #endregion
            }
        }