Example #1
0
        public void DoSend()
        {
            // 以下代码是从 MyFlow.aspx Send 方法copy 过来的,需要保持业务逻辑的一致性,所以代码需要保持一致.

            BP.WF.Node nd = new BP.WF.Node(this.FK_Node);
            Work       wk = nd.HisWork;

            wk.OID = this.WorkID;
            wk.Retrieve();

            WorkNode firstwn = new WorkNode(wk, nd);
            string   msg     = "";

            try
            {
                msg = firstwn.NodeSend().ToMsgOfHtml();
            }
            catch (Exception exSend)
            {
                this.Pub1.AddFieldSetGreen("错误");
                this.Pub1.Add(exSend.Message.Replace("@@", "@").Replace("@", "<BR>@"));
                this.Pub1.AddFieldSetEnd();
                return;
            }

            #region 处理通用的发送成功后的业务逻辑方法,此方法可能会抛出异常.
            try
            {
                //处理通用的发送成功后的业务逻辑方法,此方法可能会抛出异常.
                BP.WF.Glo.DealBuinessAfterSendWork(this.FK_Flow, this.WorkID, this.DoFunc, WorkIDs);
            }
            catch (Exception ex)
            {
                this.ToMsg(msg, ex.Message);
                return;
            }
            #endregion 处理通用的发送成功后的业务逻辑方法,此方法可能会抛出异常.


            /*处理转向问题.*/
            switch (firstwn.HisNode.HisTurnToDeal)
            {
            case TurnToDeal.SpecUrl:
                string myurl = firstwn.HisNode.TurnToDealDoc.Clone().ToString();
                if (myurl.Contains("?") == false)
                {
                    myurl += "?1=1";
                }
                Attrs myattrs = firstwn.HisWork.EnMap.Attrs;
                Work  hisWK   = firstwn.HisWork;
                foreach (Attr attr in myattrs)
                {
                    if (myurl.Contains("@") == false)
                    {
                        break;
                    }
                    myurl = myurl.Replace("@" + attr.Key, hisWK.GetValStrByKey(attr.Key));
                }
                if (myurl.Contains("@"))
                {
                    throw new Exception("流程设计错误,在节点转向url中参数没有被替换下来。Url:" + myurl);
                }

                myurl += "&FromFlow=" + this.FK_Flow + "&FromNode=" + this.FK_Node + "&PWorkID=" + this.WorkID + "&UserNo=" + WebUser.No + "&SID=" + WebUser.SID;
                this.Response.Redirect(myurl, true);
                return;

            case TurnToDeal.TurnToByCond:
                TurnTos tts = new TurnTos(this.FK_Flow);
                if (tts.Count == 0)
                {
                    throw new Exception("@您没有设置节点完成后的转向条件。");
                }
                foreach (TurnTo tt in tts)
                {
                    tt.HisWork = firstwn.HisWork;
                    if (tt.IsPassed == true)
                    {
                        string url = tt.TurnToURL.Clone().ToString();
                        if (url.Contains("?s") == false)
                        {
                            url += "?1=1";
                        }
                        Attrs attrs  = firstwn.HisWork.EnMap.Attrs;
                        Work  hisWK1 = firstwn.HisWork;
                        foreach (Attr attr in attrs)
                        {
                            if (url.Contains("@") == false)
                            {
                                break;
                            }
                            url = url.Replace("@" + attr.Key, hisWK1.GetValStrByKey(attr.Key));
                        }
                        if (url.Contains("@"))
                        {
                            throw new Exception("流程设计错误,在节点转向url中参数没有被替换下来。Url:" + url);
                        }

                        url += "&PFlowNo=" + this.FK_Flow + "&FromNode=" + this.FK_Node + "&PWorkID=" + this.WorkID + "&UserNo=" + WebUser.No + "&SID=" + WebUser.SID;
                        this.Response.Redirect(url, true);
                        return;
                    }
                }
#warning 为上海修改了如果找不到路径就让它按系统的信息提示。
                this.ToMsg(msg, "info");
                //throw new Exception("您定义的转向条件不成立,没有出口。");
                break;

            default:
                this.ToMsg(msg, "info");
                break;
            }
            return;
        }
        /// <summary>
        /// 绑定节点
        /// </summary>
        public void BindNode()
        {
            if (this.DoType == "Del")
            {
                TurnTo condDel = new TurnTo();
                condDel.MyPK = this.MyPK;
                condDel.Delete();
                this.Response.Redirect("TurnTo.aspx?FK_Node=" + this.FK_Node, true);
                return;
            }

            BP.WF.Node nd    = new BP.WF.Node(this.FK_NodeInt);
            TurnTos    conds = new TurnTos();

            conds.Retrieve(TurnToAttr.FK_Node, this.FK_Node);

            TurnTo cond = new TurnTo();

            if (this.MyPK != null)
            {
                cond.MyPK = this.MyPK;
                cond.RetrieveFromDBSources();
                if (this.FK_Attr != null)
                {
                    cond.FK_Attr = this.FK_Attr;
                }
            }
            if (this.FK_Attr != null)
            {
                cond.FK_Attr = this.FK_Attr;
            }

            this.Title = "节点完成后转向条件";
            this.Pub1.AddTable("align=center");
            this.Pub1.AddCaptionLeft("节点完成后转向条件" + nd.Name);
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("项目");
            this.Pub1.AddTDTitle("采集");
            this.Pub1.AddTDTitle("描述");
            this.Pub1.AddTREnd();

            // 属性/字段
            MapAttrs attrs  = new MapAttrs("ND" + this.FK_Node);
            MapAttrs attrNs = new MapAttrs();

            foreach (MapAttr attr in attrs)
            {
                if (attr.IsBigDoc)
                {
                    continue;
                }

                switch (attr.KeyOfEn)
                {
                case "Title":
                case "FK_Emp":
                case "MyNum":
                case "FK_NY":
                case WorkAttr.Emps:
                case WorkAttr.OID:
                case StartWorkAttr.Rec:
                case StartWorkAttr.FID:
                    continue;

                default:
                    break;
                }
                attrNs.AddEntity(attr);
            }

            DDL ddl = new DDL();

            ddl.ID = "DDL_Attr";
            ddl.BindEntities(attrNs, MapAttrAttr.MyPK, MapAttrAttr.Name);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_Node_SelectedIndexChanged);
            ddl.SetSelectItem(cond.FK_Attr);
            if (attrNs.Count == 0)
            {
                BP.WF.Node tempND = new BP.WF.Node(cond.FK_Node);
                nd.CreateMap();
                this.Pub1.AddTR();
                this.Pub1.AddTD("");
                this.Pub1.AddTD("colspan=2", "节点没有找到合适的条件");
                this.Pub1.AddTREnd();
                return;
            }
            this.Pub1.AddTR();
            this.Pub1.AddTD("属性/字段");
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("请选择节点表单字段。");
            this.Pub1.AddTREnd();

            MapAttr attrS = new MapAttr(this.DDL_Attr.SelectedItemStringVal);

            this.Pub1.AddTR();
            this.Pub1.AddTD("操作符");
            ddl    = new DDL();
            ddl.ID = "DDL_Oper";
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
            case BP.En.FieldTypeS.FK:
                ddl.Items.Add(new ListItem("=", "="));
                break;

            case BP.En.FieldTypeS.Normal:
                switch (attrS.MyDataType)
                {
                case BP.DA.DataType.AppString:
                case BP.DA.DataType.AppDate:
                case BP.DA.DataType.AppDateTime:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem("LIKE", "LIKE"));
                    break;

                case BP.DA.DataType.AppBoolean:
                    ddl.Items.Add(new ListItem("=", "="));
                    break;

                default:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem(">", ">"));
                    ddl.Items.Add(new ListItem(">=", ">="));
                    ddl.Items.Add(new ListItem("<", "<"));
                    ddl.Items.Add(new ListItem("<=", "<="));
                    break;
                }
                break;

            default:
                break;
            }
            ddl.SetSelectItem(cond.FK_Operator.ToString());
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTD("操作符号");
            this.Pub1.AddTREnd();
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
                this.Pub1.AddTR();
                this.Pub1.AddTD("值");
                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindSysEnum(attrS.KeyOfEn);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueInt);
                    }
                    catch
                    {
                    }
                }
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTD("");
                this.Pub1.AddTREnd();
                break;

            case BP.En.FieldTypeS.FK:
                this.Pub1.AddTR();
                this.Pub1.AddTD("值");
                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindEntities(attrS.HisEntitiesNoName);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueStr);
                    }
                    catch
                    {
                    }
                }
                this.Pub1.AddTD(ddl);
                this.Pub1.AddTD("");
                this.Pub1.AddTREnd();
                break;

            default:
                if (attrS.MyDataType == BP.DA.DataType.AppBoolean)
                {
                    this.Pub1.AddTR();
                    this.Pub1.AddTD("值");
                    ddl    = new DDL();
                    ddl.ID = "DDL_Val";
                    ddl.BindAppYesOrNo(0);
                    if (cond != null)
                    {
                        try
                        {
                            ddl.SetSelectItem(cond.OperatorValueInt);
                        }
                        catch
                        {
                        }
                    }
                    this.Pub1.AddTD(ddl);
                    this.Pub1.AddTD();
                    this.Pub1.AddTREnd();
                }
                else
                {
                    this.Pub1.AddTR();
                    this.Pub1.AddTD("值");
                    TB tb = new TB();
                    tb.ID = "TB_Val";
                    if (cond != null)
                    {
                        tb.Text = cond.OperatorValueStr;
                    }
                    this.Pub1.AddTD(tb);
                    this.Pub1.AddTD();
                    this.Pub1.AddTREnd();
                }
                break;
            }

            this.Pub1.AddTR();
            this.Pub1.AddTD("转向Url");
            TextBox mytb = new TextBox();

            mytb.ID      = "TB_TurnToUrl";
            mytb.Text    = cond.TurnToURL;
            mytb.Columns = 90;
            this.Pub1.AddTD("colspan=3", mytb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTRSum();
            this.Pub1.Add("<TD class=TD colspan=3 align=center>");
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " 保 存 ";
            btn.Click   += new EventHandler(btn_Save_Node_Click);
            this.Pub1.Add(btn);

            if (cond.IsExits == true)
            {
                Btn btnN = new Btn();
                btnN.ShowType = BP.Web.Controls.BtnType.Confirm;
                btnN.ID       = "Btn_Del";
                btnN.Text     = " 删 除 ";
                btnN.Click   += new EventHandler(btn_Del_Node_Click);
                this.Pub1.Add(btnN);
            }

            this.Pub1.AddBR();
            this.Pub1.AddBR("提示:Url中除系统的参数(FromFlow,FromNode,SID,WebUser.No)外,您还可以增加约定的变量。");
            this.Pub1.AddBR("&nbsp;&nbsp;&nbsp;例如: ../EIP/aaa.aspx?Jiner=@jiner,@jiner为表单字段");
            this.Pub1.AddBR("&nbsp;&nbsp;&nbsp;系统处理后的转向url为: <br>../EIP/aaa.aspx?Jiner=123&UserNo=abc&SID=xxxx&FromFlow=010&FromNode=108。");

            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEndWithHR();

            if (conds.Count > 0)
            {
                this.Pub1.AddTable();
                this.Pub1.AddCaption("方向条件列表");

                this.Pub1.AddTR();
                this.Pub1.AddTDTitle("IDX");
                this.Pub1.AddTDTitle("属性键");
                this.Pub1.AddTDTitle("名称");
                this.Pub1.AddTDTitle("操作符号");
                this.Pub1.AddTDTitle("值");
                this.Pub1.AddTDTitle("值描述");
                this.Pub1.AddTDTitle("Url");
                this.Pub1.AddTDTitle("编辑");
                this.Pub1.AddTDTitle("删除");
                this.Pub1.AddTREnd();

                int idx = 0;
                foreach (TurnTo tt in conds)
                {
                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);
                    this.Pub1.AddTD(tt.AttrKey);
                    this.Pub1.AddTD(tt.AttrT);

                    this.Pub1.AddTD(tt.FK_Operator);
                    this.Pub1.AddTD(tt.OperatorValueStr);
                    this.Pub1.AddTD(tt.OperatorValueT);
                    this.Pub1.AddTDBigDoc(tt.TurnToURL);

                    this.Pub1.AddTDA("TurnTo.aspx?MyPK=" + tt.MyPK + "&FK_Node=" + tt.FK_Node, "<img src='../Img/Btn/Edit.gif' />");
                    this.Pub1.AddTDA("TurnTo.aspx?MyPK=" + tt.MyPK + "&FK_Node=" + tt.FK_Node + "&DoType=Del", "<img src='../Img/Btn/Delete.gif' />");

                    this.Pub1.AddTREnd();
                }
                this.Pub1.AddTableEnd();
            }
        }
Example #3
0
        void btn_Click(object sender, EventArgs e)
        {
            Button btn = (Button)sender;

            if (btn.ID == "Btn_Cancel")
            {
                string url = "../MyFlow.aspx?FK_Flow=" + this.FK_Flow + "&FK_Node=" + this.FK_Node + "&WorkID=" + this.WorkID + "&FID=" + this.FID;
                this.Response.Redirect(url, true);
                return;
            }

            #region 计算出来到达的节点.


            //获得当前节点到达的节点.
            Nodes nds = new Nodes();
            if (this.ToNodes != null)
            {
                /*解决跳转问题.*/
                string[] mytoNodes = this.ToNodes.Split(',');
                foreach (string str in mytoNodes)
                {
                    if (string.IsNullOrEmpty(str) == true)
                    {
                        continue;
                    }
                    nds.AddEntity(new Node(int.Parse(str)));
                }
            }
            else
            {
                nds = BP.WF.Dev2Interface.WorkOpt_GetToNodes(this.FK_Flow, this.FK_Node, this.WorkID, this.FID);
            }


            //  首先到非异表单去找.
            string toNodes = "";
            foreach (Node mynd in nds)
            {
                if (mynd.HisRunModel == RunModel.SubThread &&
                    mynd.HisSubThreadType == SubThreadType.UnSameSheet)
                {
                    continue; //如果是子线程节点.
                }
                if (mynd.NodeID == 0)
                {
                    continue;
                }

                BP.Web.Controls.RadioBtn rb = this.Pub1.GetRadioBtnByID("RB_" + mynd.NodeID);
                if (rb.Checked == false)
                {
                    continue;
                }

                toNodes = mynd.NodeID.ToString();
                break;
            }

            if (toNodes == "")
            {
                // 如果在非异表单没有找到,就到异表单集合去找。 检查是否具有异表单的子线程.
                bool isHave = false;
                foreach (Node mynd in nds)
                {
                    if (mynd.NodeID == 0)
                    {
                        isHave = true;
                    }
                }

                if (isHave)
                {
                    /*增加异表单的子线程*/
                    foreach (Node mynd in nds)
                    {
                        if (mynd.HisSubThreadType != SubThreadType.UnSameSheet)
                        {
                            continue;
                        }

                        CheckBox cb = this.Pub1.GetCBByID("CB_" + mynd.NodeID);
                        if (cb == null)
                        {
                            continue;
                        }

                        if (cb.Checked == true)
                        {
                            toNodes += "," + mynd.NodeID;
                        }
                    }
                }
            }
            #endregion 计算出来选择的到达节点.

            if (toNodes == "")
            {
                this.Pub1.AddFieldSetRed("发送出现错误", "您没有选择到达的节点。");
                return;
            }

            // 执行发送.
            string msg = "";
            Node   nd  = new Node(this.FK_Node);
            Work   wk  = nd.HisWork;
            wk.OID = this.WorkID;
            wk.Retrieve();

            try
            {
                string toNodeStr = int.Parse(FK_Flow) + "01";
                //如果为开始节点
                if (toNodeStr == toNodes)
                {
                    //把参数更新到数据库里面.
                    GenerWorkFlow gwf = new GenerWorkFlow();
                    gwf.WorkID = this.WorkID;
                    gwf.RetrieveFromDBSources();
                    gwf.Paras_ToNodes = toNodes;
                    gwf.Save();

                    WorkNode firstwn = new WorkNode(wk, nd);

                    Node toNode = new Node(toNodeStr);
                    msg = firstwn.NodeSend(toNode, gwf.Starter).ToMsgOfHtml();
                }
                else
                {
                    msg = BP.WF.Dev2Interface.WorkOpt_SendToNodes(this.FK_Flow,
                                                                  this.FK_Node, this.WorkID, this.FID, toNodes).ToMsgOfHtml();
                }
            }
            catch (Exception ex)
            {
                this.Pub1.AddFieldSetRed("发送出现错误", ex.Message);
                return;
            }

            #region 处理通用的发送成功后的业务逻辑方法,此方法可能会抛出异常.
            try
            {
                //处理通用的发送成功后的业务逻辑方法,此方法可能会抛出异常.
                Glo.DealBuinessAfterSendWork(this.FK_Flow, this.WorkID, this.DoFunc, WorkIDs, this.CFlowNo, 0, null);
            }
            catch (Exception ex)
            {
                this.ToMsg(msg, ex.Message);
                return;
            }
            #endregion 处理通用的发送成功后的业务逻辑方法,此方法可能会抛出异常.


            /*处理转向问题.*/
            switch (nd.HisTurnToDeal)
            {
            case TurnToDeal.SpecUrl:
                string myurl = nd.TurnToDealDoc.Clone().ToString();
                if (myurl.Contains("&") == false)
                {
                    myurl += "?1=1";
                }
                myurl  = BP.WF.Glo.DealExp(myurl, wk, null);
                myurl += "&FromFlow=" + this.FK_Flow + "&FromNode=" + this.FK_Node + "&PWorkID=" + this.WorkID + "&UserNo=" + WebUser.No + "&SID=" + WebUser.SID;
                this.Response.Redirect(myurl, true);
                return;

            case TurnToDeal.TurnToByCond:
                TurnTos tts = new TurnTos(this.FK_Flow);
                if (tts.Count == 0)
                {
                    throw new Exception("@您没有设置节点完成后的转向条件。");
                }
                foreach (TurnTo tt in tts)
                {
                    tt.HisWork = wk;
                    if (tt.IsPassed == true)
                    {
                        string url = tt.TurnToURL.Clone().ToString();
                        if (url.Contains("&") == false)
                        {
                            url += "?1=1";
                        }
                        url  = BP.WF.Glo.DealExp(url, wk, null);
                        url += "&PFlowNo=" + this.FK_Flow + "&FromNode=" + this.FK_Node + "&PWorkID=" + this.WorkID + "&UserNo=" + WebUser.No + "&SID=" + WebUser.SID;
                        this.Response.Redirect(url, true);
                        return;
                    }
                }
#warning 为上海修改了如果找不到路径就让它按系统的信息提示。
                this.ToMsg(msg, "info");
                //throw new Exception("您定义的转向条件不成立,没有出口。");
                break;

            default:
                this.ToMsg(msg, "info");
                break;
            }
            return;
        }
        public void DoSend()
        {
            // 以下代码是从 MyFlow.aspx Send 方法copy 过来的,需要保持业务逻辑的一致性,所以代码需要保持一致.

            Nodes nds = new Nodes();

            nds = BP.WF.Dev2Interface.WorkOpt_GetToNodes(this.FK_Flow, this.FK_Node, this.WorkID, this.FID);
            int toNodes = this.ToNodes;

            if (this.ToNodes == 0)
            {
                foreach (Node mynd in nds)
                {
                    toNodes = mynd.NodeID;
                }
            }

            BP.WF.Node nd = new BP.WF.Node(this.FK_Node);
            Work       wk = nd.HisWork;

            wk.OID = this.WorkID;
            wk.Retrieve();

            string msg = "";

            try
            {
                msg = BP.WF.Dev2Interface.WorkOpt_SendToNodes(this.FK_Flow,
                                                              this.FK_Node, this.WorkID, this.FID, toNodes.ToString()).ToMsgOfHtml();
            }
            catch (Exception exSend)
            {
                this.Pub1.AddFieldSetGreen("错误");
                this.Pub1.Add(exSend.Message.Replace("@@", "@").Replace("@", "<BR>@"));
                this.Pub1.AddFieldSetEnd();
                return;
            }

            #region 处理通用的发送成功后的业务逻辑方法,此方法可能会抛出异常.
            try
            {
                //处理通用的发送成功后的业务逻辑方法,此方法可能会抛出异常.
                BP.WF.Glo.DealBuinessAfterSendWork(this.FK_Flow, this.WorkID, this.DoFunc, WorkIDs, this.CFlowNo, 0, null);
            }
            catch (Exception ex)
            {
                this.ToMsg(msg, ex.Message);
                return;
            }
            #endregion 处理通用的发送成功后的业务逻辑方法,此方法可能会抛出异常.


            /*处理转向问题.*/
            switch (nd.HisTurnToDeal)
            {
            case TurnToDeal.SpecUrl:
                string myurl = nd.TurnToDealDoc.Clone().ToString();
                if (myurl.Contains("&") == false)
                {
                    myurl += "?1=1";
                }
                myurl  = BP.WF.Glo.DealExp(myurl, wk, null);
                myurl += "&FromFlow=" + this.FK_Flow + "&FromNode=" + this.FK_Node + "&PWorkID=" + this.WorkID + "&UserNo=" + WebUser.No + "&SID=" + WebUser.SID;
                this.Response.Redirect(myurl, true);
                return;

            case TurnToDeal.TurnToByCond:
                TurnTos tts = new TurnTos(this.FK_Flow);
                if (tts.Count == 0)
                {
                    throw new Exception("@您没有设置节点完成后的转向条件。");
                }
                foreach (TurnTo tt in tts)
                {
                    tt.HisWork = wk;
                    if (tt.IsPassed == true)
                    {
                        string url = tt.TurnToURL.Clone().ToString();
                        if (url.Contains("&") == false)
                        {
                            url += "?1=1";
                        }
                        url  = BP.WF.Glo.DealExp(url, wk, null);
                        url += "&PFlowNo=" + this.FK_Flow + "&FromNode=" + this.FK_Node + "&PWorkID=" + this.WorkID + "&UserNo=" + WebUser.No + "&SID=" + WebUser.SID;
                        this.Response.Redirect(url, true);
                        return;
                    }
                }
#warning 为上海修改了如果找不到路径就让它按系统的信息提示。
                this.ToMsg(msg, "info");
                //throw new Exception("您定义的转向条件不成立,没有出口。");
                break;

            default:
                this.ToMsg(msg, "info");
                break;
            }
            //附件数据的流转
            //先去附件数据表查询,当前节点有没有上传附件
            string    fuSql = "select * from sys_frmattachmentdb where REFPKVAL='" + this.WorkID + "' and FK_MAPDATA='ND" + this.FK_Node + "'";
            DataTable fuDt  = BP.DA.DBAccess.RunSQLReturnTable(fuSql);
            if (fuDt.Rows.Count > 0)
            {
                //如果有,就去轨迹图中查询已经到达的节点
                string    fuTrack = "select NDTO from ND" + int.Parse(this.FK_Flow) + "Track where WORKID='" + this.WorkID + "' and NDFROM='" + this.FK_Node + "'";
                DataTable tk      = BP.DA.DBAccess.RunSQLReturnTable(fuTrack);

                //再查询附件表中,有没有到达节点的信息
                string    toSql = "select * from sys_frmattachmentdb where REFPKVAL='" + this.WorkID + "' and FK_MAPDATA='ND" + tk.Rows[0]["NDTO"] + "'";
                DataTable ndt   = BP.DA.DBAccess.RunSQLReturnTable(toSql);

                //如果存在,就将附件二进制copy到到达节点
                if (ndt.Rows.Count > 0)
                {
                    for (int i = 0; i < fuDt.Rows.Count; i++)
                    {
                        for (int j = 0; j < ndt.Rows.Count; j++)
                        {
                            //单附件
                            if (ndt.Rows[j]["MyPK"].ToString().Contains("DanFuJian") && fuDt.Rows[i]["MyPK"].ToString().Contains("DanFuJian"))
                            {
                                string sql = "select * from Sys_FrmAttachmentDB where MyPK='" + ndt.Rows[j]["MyPK"] + "'";
                                //DataSet ds = LbqOA.DBAccess.GetSingleDataSet("file", sql);
                                //ds.Tables["file"].Rows[0]["FDB"] = fuDt.Rows[i]["FDB"];
                                //LbqOA.DBAccess.SaveSingleDataSet(ds, "file", sql);
                            }
                            //多附件
                            if (ndt.Rows[j]["MyPK"].ToString().Contains("DanFuJian") == false && fuDt.Rows[i]["MyPK"].ToString().Contains("DanFuJian") == false)
                            {
                                if (fuDt.Rows[i]["FILENAME"].ToString() == ndt.Rows[j]["FILENAME"].ToString())
                                {
                                    string sql = "select * from Sys_FrmAttachmentDB where MyPK='" + ndt.Rows[j]["MyPK"] + "'";
                                    //DataSet ds = LbqOA.DBAccess.GetSingleDataSet("file", sql);
                                    //ds.Tables["file"].Rows[0]["FDB"] = fuDt.Rows[i]["FDB"];
                                    //LbqOA.DBAccess.SaveSingleDataSet(ds, "file", sql);
                                }
                            }
                        }
                    }
                }
            }
            return;
        }