Exemple #1
0
        protected void OnSave()
        {
            bool result = true;

            //线路区域编号
            int LineTypeID = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(ddlLineType.UniqueID), ""));

            if (LineTypeID == 0)
            {
                result = false;
                MessageBox.Show(this, "请选择线路区域!");
                return;
            }
            //线路名称
            string LineName = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.txt_LineName.Name), "");

            if (LineName == "")
            {
                result = false;
                MessageBox.Show(this, "请填写线路名称!");
                return;
            }
            //线路描述
            string LineDesCription = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(txt_Description.UniqueID), "");
            //旅游天数
            int txtDays = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(txt_Days.UniqueID), ""));

            if (txtDays == 0)
            {
                result = false;
                MessageBox.Show(this, "请填写旅游天数!");
                return;
            }
            //行程安排
            string Arrange = EyouSoft.Common.Utils.EditInputText(Request.Form[txt_Travel.UniqueID]);
            //服务标准
            string Standard = EyouSoft.Common.Utils.EditInputText(Request.Form[txt_Services.UniqueID]);
            //备注
            string Remarks = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(txt_Remarks.UniqueID), "");

            //线路库业务逻辑类
            EyouSoft.BLL.RouteStructure.Route Route = new EyouSoft.BLL.RouteStructure.Route();

            //线路信息实体类
            EyouSoft.Model.RouteStructure.RouteInfo Routeinfo = new EyouSoft.Model.RouteStructure.RouteInfo();
            Routeinfo.AreaId    = LineTypeID;
            Routeinfo.RouteName = LineName;


            //快速发布团队专有信息实体类
            EyouSoft.Model.TourStructure.TourQuickPrivateInfo TourQuickPrivateInfo = new EyouSoft.Model.TourStructure.TourQuickPrivateInfo();
            TourQuickPrivateInfo.QuickPlan = Arrange;
            TourQuickPrivateInfo.Remark    = Remarks;
            TourQuickPrivateInfo.Service   = Standard;

            Routeinfo.RouteQuickInfo = TourQuickPrivateInfo;
            Routeinfo.RouteDepict    = LineDesCription;
            Routeinfo.RouteDays      = txtDays;

            //设置线路的发布类型
            Routeinfo.ReleaseType = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Quick;

            //公司编号
            Routeinfo.CompanyId = SiteUserInfo.CompanyID;
            //当前登录人编号
            Routeinfo.OperatorId = SiteUserInfo.ID;
            //当前登录人姓名
            if (SiteUserInfo.ContactInfo != null)
            {
                Routeinfo.OperatorName = SiteUserInfo.ContactInfo.ContactName;
            }

            if (EyouSoft.Common.Utils.GetFormValue("filehid") == "dele")
            {
                Routeinfo.Attachs = new List <EyouSoft.Model.TourStructure.TourAttachInfo>();
                //线路附件实体
                EyouSoft.Model.TourStructure.TourAttachInfo TourAttachInfo = new EyouSoft.Model.TourStructure.TourAttachInfo();
                TourAttachInfo.FilePath = "";
                TourAttachInfo.Name     = "";
                Routeinfo.Attachs.Add(TourAttachInfo);
            }

            //附件
            if (Request.Files.Count > 0)
            {
                Routeinfo.Attachs = new List <EyouSoft.Model.TourStructure.TourAttachInfo>();
                //线路附件实体
                EyouSoft.Model.TourStructure.TourAttachInfo TourAttachInfo = new EyouSoft.Model.TourStructure.TourAttachInfo();
                //文件路径
                string filePath = string.Empty;
                //文件名
                string fileName = string.Empty;
                //文件上传
                if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["fileUpLoad"], "LineListFile", out filePath, out fileName))
                {
                    if (filePath.Trim() != "" && fileName.Trim() != "")
                    {
                        //设置文件上传后的虚拟路劲
                        TourAttachInfo.FilePath = filePath;
                        //保存原文件名
                        TourAttachInfo.Name = fileName;
                        Routeinfo.Attachs.Add(TourAttachInfo);
                    }
                    else
                    {
                        //设置文件上传后的虚拟路劲
                        TourAttachInfo.FilePath = "";
                        //保存原文件名
                        TourAttachInfo.Name = "";
                        Routeinfo.Attachs.Add(TourAttachInfo);
                    }
                }
            }

            string hidType = EyouSoft.Common.Utils.GetFormValue(this.hideType.UniqueID);

            #region 列表线路数据修改
            if (hidType == "update")
            {
                //线路编号
                int RouteId = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hidRouteid.UniqueID));
                Routeinfo.RouteId = RouteId;
            }
            #endregion

            #region 导航菜单线路数据修改
            if (hidType == "UpdateT")
            {
                //线路编号
                int RouteID = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hidRouteid.UniqueID));
                Routeinfo.RouteId = RouteID;
            }
            #endregion

            #region  制线路信息
            if (hidType == "Copy")
            {
                //线路编号
                int RouteID = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hidRouteid.UniqueID));
                Routeinfo.RouteId = RouteID;
            }
            #endregion

            if (hidType == "Copy")
            {
                if (result)
                {
                    if (Route.InsertRouteInfo(Routeinfo) > 0)
                    {
                        MessageBox.ShowAndRedirect(this, "线路信息添加成功!", "/xianlu/LineProducts.aspx");
                    }
                    else
                    {
                        MessageBox.ShowAndRedirect(this, "线路信息添加失败!", "/xianlu/LineProducts.aspx");
                    }
                }
            }

            if (hidType == "update" || hidType == "UpdateT")
            {
                if (result)
                {
                    if (Route.UpdateRouteInfo(Routeinfo) > 0)
                    {
                        MessageBox.ShowAndRedirect(this, "线路信息修改成功!", "/xianlu/LineProducts.aspx");
                    }
                    else
                    {
                        MessageBox.ShowAndRedirect(this, "线路信息修改失败!", "/xianlu/LineProducts.aspx");
                    }
                }
            }
            #region 释放资源
            Route                = null;
            Routeinfo            = null;
            TourQuickPrivateInfo = null;
            #endregion
        }
        protected void InitBindLinePro()
        {
            //线路区域编号
            int LineTypeID = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.ddlLineType.UniqueID), ""));

            if (LineTypeID == 0)
            {
                SetErrorMsg(false, "请选择线路区域!");
                return;
            }
            //线路名称
            string LineName = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.txt_LineName.UniqueID.Trim()), "");

            if (LineName == "")
            {
                SetErrorMsg(false, "请填写线路名称!");
                return;
            }
            //线路描述
            string Desriptoin = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_XianlDescript.UniqueID.Trim()), "");
            //旅游天数
            int Days = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.Txt_Days.UniqueID.Trim()));

            if (Days == 0)
            {
                SetErrorMsg(false, "请填写旅游天数!");
                return;
            }

            //不包含项目
            string ProjectNo = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_XianlProjectNo.UniqueID.Trim()), "");
            //购物安排
            string ShoppPlan = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_ShoppPlan.UniqueID.Trim()), "");
            //儿童安排
            string ChildPlan = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_ChildPlan.UniqueID.Trim()), "");
            //自费项目
            string Expensce = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_expensce.UniqueID.Trim()), "");
            //注意事项
            string Notes = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_Notes.UniqueID.Trim()), "");
            //温馨提醒
            string Remind = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_Remind.UniqueID.Trim()), "");
            //内部信息
            string Reception = EyouSoft.Common.Utils.GetString(EyouSoft.Common.Utils.GetFormValue(this.Txt_Reception.UniqueID.Trim()), "");

            //线路库业务逻辑类
            EyouSoft.BLL.RouteStructure.Route Route = new EyouSoft.BLL.RouteStructure.Route();
            //线路基本信息实体类
            EyouSoft.Model.RouteStructure.RouteInfo Routeinfo = new EyouSoft.Model.RouteStructure.RouteInfo();
            Routeinfo.AreaId      = LineTypeID;
            Routeinfo.RouteName   = LineName;
            Routeinfo.RouteDepict = Desriptoin;
            Routeinfo.RouteDays   = Days;
            Routeinfo.Attachs     = new List <EyouSoft.Model.TourStructure.TourAttachInfo>();

            //标准发布团队行程信息业务实体
            Routeinfo.RouteNormalInfo = new EyouSoft.Model.TourStructure.TourNormalPrivateInfo();
            #region 包含项目
            Routeinfo.RouteNormalInfo.Services      = this.ProjectControl1.GetDataList();
            Routeinfo.RouteNormalInfo.WenXinTiXing  = Remind;
            Routeinfo.RouteNormalInfo.ZhuYiShiXiang = Notes;
            Routeinfo.RouteNormalInfo.ZiFeiXIangMu  = Expensce;
            #endregion

            #region 获取行程信息
            List <EyouSoft.Model.TourStructure.TourPlanInfo> PlanInfo = this.xingcheng1.GetValues();
            Routeinfo.RouteNormalInfo.Plans        = PlanInfo;
            Routeinfo.RouteNormalInfo.BuHanXiangMu = ProjectNo;
            Routeinfo.RouteNormalInfo.ErTongAnPai  = ChildPlan;
            Routeinfo.RouteNormalInfo.GouWuAnPai   = ShoppPlan;
            Routeinfo.RouteNormalInfo.NeiBuXingXi  = Reception;
            #endregion

            #region   附件
            //线路附件实体
            EyouSoft.Model.TourStructure.TourAttachInfo TourAttachInfo = new EyouSoft.Model.TourStructure.TourAttachInfo();
            //文件路径
            string filePath = string.Empty;
            //文件名
            string fileName = string.Empty;

            HttpPostedFile FileUpload = Request.Files["fileUpLoad"];
            if (!string.IsNullOrEmpty(FileUpload.FileName) && FileUpload.ContentLength > 0)
            {
                //文件上传
                if (EyouSoft.Common.Function.UploadFile.FileUpLoad(FileUpload, "LineListFile", out filePath, out fileName))
                {
                    if (filePath.Trim() != "" && fileName.Trim() != "")
                    {
                        //设置文件上传后的虚拟路劲
                        TourAttachInfo.FilePath = filePath;
                        //保存原文件名
                        TourAttachInfo.Name = fileName;
                        Routeinfo.Attachs.Add(TourAttachInfo);
                    }
                }
                else
                {
                    //上传失败提示
                    this.litMsg.Text = EyouSoft.Common.Utils.ShowMsg("文件上传失败!");
                    return;
                }
            }
            else
            {
                TourAttachInfo.FilePath = hidOldFilePath.Value;
                TourAttachInfo.Name     = hidOldName.Value;
                Routeinfo.Attachs.Add(TourAttachInfo);
            }
            #endregion

            //公司编号
            Routeinfo.CompanyId = SiteUserInfo.CompanyID;
            //当前操作员编号
            Routeinfo.OperatorId = SiteUserInfo.ID;
            //当前操作员姓名
            if (SiteUserInfo.ContactInfo != null)
            {
                Routeinfo.OperatorName = SiteUserInfo.ContactInfo.ContactName;
            }

            string hidType = EyouSoft.Common.Utils.GetFormValue(this.hideType.UniqueID);
            #region 列表线路数据修改
            if (hidType == "update")
            {
                //线路编号
                int RouteId = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hidRouteid.UniqueID));
                Routeinfo.RouteId = RouteId;
            }
            #endregion

            #region 导航菜单线路数据修改
            if (hidType == "UpdateT")
            {
                //线路编号
                int RouteID = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hidRouteid.UniqueID));
                Routeinfo.RouteId = RouteID;
            }
            #endregion

            #region  制线路信息
            if (hidType == "Copy")
            {
                //线路编号
                int RouteID = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetFormValue(this.hidRouteid.UniqueID));
                Routeinfo.RouteId = RouteID;
            }
            #endregion


            if (hidType == "Copy")
            {
                if (Route.InsertRouteInfo(Routeinfo) > 0)
                {
                    SetErrorMsg(true, "线路信息添加成功!");
                }
                else
                {
                    SetErrorMsg(false, "线路信息添加失败!");
                }
            }

            if (hidType == "update" || hidType == "UpdateT")
            {
                if (Route.UpdateRouteInfo(Routeinfo) > 0)
                {
                    SetErrorMsg(true, "线路信息修改成功!");
                }
                else
                {
                    SetErrorMsg(false, "线路信息修改失败!");
                }
            }
        }
Exemple #3
0
        protected void OnSave()
        {
            bool result = true;

            //线路区域
            int lineTypeID = Utils.GetInt(Utils.GetString(Utils.GetFormValue(ddlLineType.UniqueID), ""));

            if (lineTypeID == 0)
            {
                result = false;
                MessageBox.Show(this, "请选择线路区域!");
                return;
            }
            //线路名称
            string lineName = Utils.GetString(Utils.GetFormValue(this.txt_LineName.Name), "");

            if (lineName == "")
            {
                result = false;
                MessageBox.Show(this, "请填写线路名称!");
                return;
            }
            //线路描述
            string Description = Utils.GetString(Utils.GetFormValue(this.txt_Description.UniqueID), "");
            //旅游天数
            int Days = Utils.GetInt(Utils.GetString(Utils.GetFormValue(this.txt_Days.UniqueID), ""));

            if (Days == 0)
            {
                result = false;
                MessageBox.Show(this, "请填写旅游天数!");
                return;
            }
            //不包含项目
            string ProjectNo = Utils.GetString(Utils.GetFormValue(this.txt_ProjectNo.UniqueID), "");
            //购物安排
            string ShoppingPlan = Utils.GetString(Utils.GetFormValue(this.txt_ShoppingPlan.UniqueID), "");
            //儿童安排
            string ChildrenPlan = Utils.GetString(Utils.GetFormValue(this.txt_ChildrenPlan.UniqueID), "");
            //自费项目
            string ExpenseProject = Utils.GetString(Utils.GetFormValue(this.txt_ExpenseProject.UniqueID), "");
            //注意事项
            string Notes = Utils.GetString(Utils.GetFormValue(this.txt_Notes.UniqueID), "");
            //温馨提示
            string reminder = Utils.GetString(Utils.GetFormValue(this.Txt_Reminder.UniqueID), "");
            //内部信息
            string Infromation = Utils.GetString(Utils.GetFormValue(this.Txt_Infromation.UniqueID), "");

            //线路库业务逻辑类
            EyouSoft.BLL.RouteStructure.Route Route = new EyouSoft.BLL.RouteStructure.Route();
            //线路基本信息实体类
            EyouSoft.Model.RouteStructure.RouteInfo Routeinfo = new EyouSoft.Model.RouteStructure.RouteInfo();
            Routeinfo.AreaId      = lineTypeID;
            Routeinfo.RouteName   = lineName;
            Routeinfo.RouteDepict = Description;
            Routeinfo.RouteDays   = Days;
            Routeinfo.Attachs     = new List <EyouSoft.Model.TourStructure.TourAttachInfo>();

            //标准发布团队行程信息业务实体
            Routeinfo.RouteNormalInfo = new EyouSoft.Model.TourStructure.TourNormalPrivateInfo();
            #region 获取行程信息
            Routeinfo.RouteNormalInfo.Plans        = this.xingcheng1.GetValues();
            Routeinfo.RouteNormalInfo.BuHanXiangMu = ProjectNo;
            Routeinfo.RouteNormalInfo.ErTongAnPai  = ChildrenPlan;
            Routeinfo.RouteNormalInfo.GouWuAnPai   = ShoppingPlan;
            Routeinfo.RouteNormalInfo.NeiBuXingXi  = Infromation;
            #endregion

            //包含项目
            Routeinfo.RouteNormalInfo.Services      = this.ConProjectControl1.GetDataList();
            Routeinfo.RouteNormalInfo.WenXinTiXing  = reminder;
            Routeinfo.RouteNormalInfo.ZhuYiShiXiang = Notes;
            Routeinfo.RouteNormalInfo.ZiFeiXIangMu  = ExpenseProject;

            //设置线路的发布类型
            Routeinfo.ReleaseType = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Normal;

            //公司编号
            Routeinfo.CompanyId = SiteUserInfo.CompanyID;
            //当前操作员编号
            Routeinfo.OperatorId = SiteUserInfo.ID;
            //当前操作员姓名
            if (SiteUserInfo.ContactInfo != null)
            {
                Routeinfo.OperatorName = SiteUserInfo.ContactInfo.ContactName;
            }

            #region   附件
            //线路附件实体
            EyouSoft.Model.TourStructure.TourAttachInfo TourAttachInfo = new EyouSoft.Model.TourStructure.TourAttachInfo();
            //文件路径
            string filePath = string.Empty;
            //文件名
            string fileName = string.Empty;
            //文件上传
            if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["fileUpLoad"], "LineListFile", out filePath, out fileName))
            {
                if (filePath.Trim() != "" && fileName.Trim() != "")
                {
                    //设置文件上传后的虚拟路劲
                    TourAttachInfo.FilePath = filePath;
                    //保存原文件名
                    TourAttachInfo.Name = fileName;
                    Routeinfo.Attachs.Add(TourAttachInfo);
                }
            }
            else
            {
                //上传失败提示
                this.litMsg.Text = Utils.ShowMsg("文件上传失败!");
                return;
            }
            #endregion

            if (result)
            {
                if (Route.InsertRouteInfo(Routeinfo) > 0)
                {
                    MessageBox.ShowAndRedirect(this, "线路信息添加成功!", "/xianlu/LineProducts.aspx");
                }
                else
                {
                    MessageBox.ShowAndRedirect(this, "线路信息添加成功!", "/xianlu/Add_xl_Standard.aspx");
                }
            }
            Route     = null;
            Routeinfo = null;
        }