Exemplo n.º 1
0
        /// <summary>
        /// 根据xml获取计调员
        /// </summary>
        /// <param name="xml"></param>
        /// <returns></returns>
        private IList <MTourPlaner> GetTourPlanerByXML(string xml)
        {
            IList <MTourPlaner> list = null;

            XmlDocument doc = new XmlDocument();

            doc.LoadXml(xml);
            XmlNode root = doc.SelectSingleNode("Root");

            if (root.HasChildNodes)
            {
                list = new List <MTourPlaner>();
                for (int i = 0; i < root.ChildNodes.Count; i++)
                {
                    MTourPlaner planer = new MTourPlaner();
                    XmlNode     node   = root.ChildNodes[i];
                    planer.TourId   = node.Attributes["TourId"].Value;
                    planer.PlanerId = node.Attributes["PlanerId"].Value;
                    planer.Planer   = node.Attributes["Planer"] != null ? node.Attributes["Planer"].Value : string.Empty;
                    planer.DeptId   = Utils.GetInt(node.Attributes["DeptId"].Value);
                    list.Add(planer);
                }
            }

            return(list);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 保存按钮点击事件执行方法
        /// </summary>
        void BaoCun()
        {
            string msg = string.Empty;

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

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

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

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

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

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

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

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

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

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

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

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

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

            RCWE(msg);
        }