public void Devolve(out string sResult)
        {
            sResult = "";
            string sPath = HttpContext.Current.Server.MapPath((@"~\Config\DevolveConfig.xml"));
            FounderSoftware.ADIM.OA.OA2DC.HN_OA2DC dcDev = new HN_OA2DC(sPath);
            FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP dpDev = new HN_OA2DP(sPath);

            // 开始发送归档
            /*
             * 根据DevoleConfig.xml配置文件的中相应流程的<Object>DC</Object>节点来判断归档到哪个系统中
             * 若配置中为DC则表明调用OA2DC.DLL接口进行归档,若为DP则表明调用OA2DP.DLL接口进行归档
             */
            string xml = "";
            string objDevolve = dcDev.GetCfgNodeValues("/Devolve/Process[@Name='" + base.TemplateName + "']/Object");
            string s = "";

            //B_LetterReceive l_busWorkItems = new B_LetterReceive();
            //PopulateEntity(l_busWorkItems, base.ViewIDorName, base.WorkItemID);
            B_LetterReceive l_busWorkItems = this.ControlToEntity(false) as B_LetterReceive;
            l_busWorkItems.FormsData = XmlUtility.SerializeXml(l_busWorkItems);
            if (objDevolve.ToUpper() == "DC" || objDevolve.ToUpper() == "FC")
            {
                FounderSoftware.ADIM.OA.OA2DC.OA2DC oa2dc = new FounderSoftware.ADIM.OA.OA2DC.OA2DC();
                xml = Devolve2DC2(dcDev);

                s = oa2dc.SendDevolve(xml, l_busWorkItems.FormsData, "函件收文");
                sResult += (s + @"\r\n");
                try
                {
                    Convert.ToInt32(s);
                }
                catch
                {
                    throw new Exception(s);
                }
            }

            if (objDevolve.ToUpper() == "DP")
            {
                FounderSoftware.ADIM.OA.OA2DP.OA2DP oa2dp = new FounderSoftware.ADIM.OA.OA2DP.OA2DP();
                xml = Devolve2DP(dpDev);

                s = oa2dp.SendDevolve(xml, l_busWorkItems.FormsData, "函件收文");
                sResult += (s + @"\r\n");
                try
                {
                    Convert.ToInt32(s);
                }
                catch
                {
                    throw new Exception(s);
                }
            }
            //string rest = oa2dc.CallBack(Convert.ToInt32(s), true, s);

            //IMessage ms = new WebFormMessage(Page, s);
            //ms.Show();
        }
        private void Devolve(out string sResult)
        {
            sResult = "";
            string sPath = HttpContext.Current.Server.MapPath((@"~\Config\DevolveConfig.xml"));
            FounderSoftware.ADIM.OA.OA2DC.HN_OA2DC dcDev = new HN_OA2DC(sPath);
            FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP dpDev = new HN_OA2DP(sPath);

            // 开始发送归档
            /*
             * 根据DevoleConfig.xml配置文件的中相应流程的<Object>DC</Object>节点来判断归档到哪个系统中
             * 若配置中为DC则表明调用OA2DC.DLL接口进行归档,若为DP则表明调用OA2DP.DLL接口进行归档
             */
            string xml = "";
            string objDevolve = dcDev.GetCfgNodeValues("/Devolve/Process[@Name='" + base.TemplateName + "']/Object");
            string s = "";

            //EntityLetterSend entity = new EntityLetterSend(base.tableName);
            //SetEntity(entity, true);
            B_DJGTSend entity = this.ControlToEntity(false) as B_DJGTSend;

            entity.FormsData = XmlUtility.SerializeXml(entity);
            if (objDevolve.ToUpper() == "DC" || objDevolve.ToUpper() == "FC")
            {
                FounderSoftware.ADIM.OA.OA2DC.OA2DC oa2dc = new FounderSoftware.ADIM.OA.OA2DC.OA2DC();
                xml = Devolve2DC(dcDev);

                s = oa2dc.SendDevolve(xml, entity.FormsData, base.TemplateName);
                sResult += (s + @"\r\n");
                try
                {
                    Convert.ToInt32(s);
                }
                catch
                {
                    throw new Exception(s);
                }
                //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
            }

            if (objDevolve.ToUpper() == "DP")
            {
                FounderSoftware.ADIM.OA.OA2DP.OA2DP oa2dp = new FounderSoftware.ADIM.OA.OA2DP.OA2DP();
                string sOADPIDs = dpDev.GetCfgNodeValues("/Devolve/Process[@Name='" + base.TemplateName + "']/DPID");
                // 若DevolveConifg.xml配置文件中未配置CategID则根据流程实体中的处室ID归档

                string[] arrDPID = sOADPIDs.Split(new char[] { ',', ';' });
                for (int i = 0; i < arrDPID.Length; i++)
                {
                    try
                    {
                        Convert.ToInt32(arrDPID[i]);
                    }
                    catch
                    {
                        continue;
                    }
                    xml = Devovle2DP2(dpDev, arrDPID[i]);
                    s = oa2dp.SendDevolve(xml, entity.FormsData, base.TemplateName);
                    sResult += (s + @"\r\n");
                    try
                    {
                        Convert.ToInt32(s);
                    }
                    catch
                    {
                        throw new Exception(s);
                    }
                    //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
                }

                string sOptionDPID = dpDev.GetCfgNodeValues("/Devolve/Process[@Name='" + base.TemplateName + "']/OptionDPID");
                string[] arrOpDPID = sOptionDPID.Split(new char[] { ',' });
                for (int i = 0; i < arrOpDPID.Length; i++)
                {
                    if (entity.GetVal(arrOpDPID[i]) == null) continue;
                    string sDPID = entity.GetVal(arrOpDPID[i]).ToString();
                    string[] IDs = sDPID.Split(new char[] { ';', ',' });
                    for (int j = 0; j < IDs.Length; j++)
                    {
                        try
                        {
                            Convert.ToInt32(IDs[j]);
                        }
                        catch
                        {
                            continue;
                        }
                        xml = Devovle2DP2(dpDev, IDs[j]);
                        s = oa2dp.SendDevolve(xml, entity.FormsData, base.TemplateName);
                        sResult += (s + @"\r\n");
                        try
                        {
                            Convert.ToInt32(s);
                        }
                        catch
                        {
                            throw new Exception(s);
                        }
                    }
                    //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
                }

                #region 注释保留
                //if (string.IsNullOrEmpty(sOADPIDs))
                //{
                //    string[] sDPID1 = entity.HostDept.Split(new char[] { ',', ';' });
                //    string[] sDPID2 = entity.DeptSIDs.Split(new char[] { ',', ';' });
                //    if (sDPID1 != null)
                //    {
                //        for (int i = 0; i < sDPID1.Length; i++)
                //        {
                //            if (string.IsNullOrEmpty(sDPID1[i])) continue;
                //            xml = Devolve2DP(dpDev, sDPID1[i]);
                //            s = oa2dp.SendDevolve(xml, entity.FormsData, "公司发文");
                //            //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
                //        }
                //    }

                //    if (sDPID2 != null)
                //    {
                //        for (int i = 0; i < sDPID2.Length; i++)
                //        {
                //            if (string.IsNullOrEmpty(sDPID2[i])) continue;
                //            xml = Devolve2DP(dpDev, sDPID2[i]);
                //            s = oa2dp.SendDevolve(xml, entity.FormsData, "公司发文");
                //            //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
                //        }
                //    }
                //}
                //else
                //// 根据配置文件的处室ID归档
                //{
                //    string[] arrDPID = sOADPIDs.Split(new char[] { ',' });
                //    for (int i = 0; i < arrDPID.Length; i++)
                //    {
                //        xml = Devolve2DP(dpDev, arrDPID[i]);
                //        s = oa2dp.SendDevolve(xml, entity.FormsData, "公司发文");
                //        //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
                //    }
                //}
                #endregion
            }

            //string rest = oa2dc.CallBack(Convert.ToInt32(s), true, s);
            //string rest = CDevolve.CallBack(Convert.ToInt32(s), true, s, doc.InnerXml);

            //IMessage ms = new WebFormMessage(Page, s);
            //ms.Show();
        }
        public void Devolve(out string sResult)
        {
            sResult = "";
            string sPath = HttpContext.Current.Server.MapPath((@"~\Config\DevolveConfig.xml"));

            FounderSoftware.ADIM.OA.OA2DC.HN_OA2DC dcDev = new HN_OA2DC(sPath);
            FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP dpDev = new HN_OA2DP(sPath);

            // 开始发送归档

            /*
             * 根据DevoleConfig.xml配置文件的中相应流程的<Object>DC</Object>节点来判断归档到哪个系统中
             * 若配置中为DC则表明调用OA2DC.DLL接口进行归档,若为DP则表明调用OA2DP.DLL接口进行归档
             */
            string xml        = "";
            string objDevolve = dcDev.GetCfgNodeValues("/Devolve/Process[@Name='" + base.TemplateName + "']/Object");
            string s          = "";

            //EntityLetterSend entity = new EntityLetterSend(base.tableName);
            //SetEntity(entity, true);
            B_Finance entity = this.ControlToEntity(false) as B_Finance;

            entity.FormsData = XmlUtility.SerializeXml(entity);
            if (objDevolve.ToUpper() == "DC" || objDevolve.ToUpper() == "FC")
            {
                FounderSoftware.ADIM.OA.OA2DC.OA2DC oa2dc = new FounderSoftware.ADIM.OA.OA2DC.OA2DC();
                xml = Devolve2DC(dcDev);

                s        = oa2dc.SendDevolve(xml, entity.FormsData, "请示报告");
                sResult += (s + @"\r\n");
                try
                {
                    Convert.ToInt32(s);
                }
                catch
                {
                    throw new Exception(s);
                }
                //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
            }


            if (objDevolve.ToUpper() == "DP")
            {
                FounderSoftware.ADIM.OA.OA2DP.OA2DP oa2dp = new FounderSoftware.ADIM.OA.OA2DP.OA2DP();
                string sOADPIDs = dpDev.GetCfgNodeValues("/Devolve/Process[@Name='" + base.TemplateName + "']/DPID");

                // 若DevolveConifg.xml配置文件中未配置CategID则根据流程实体中的处室ID归档

                string[] arrDPID = sOADPIDs.Split(new char[] { ',', ';' });
                for (int i = 0; i < arrDPID.Length; i++)
                {
                    try
                    {
                        Convert.ToInt32(arrDPID[i]);
                    }
                    catch
                    {
                        continue;
                    }
                    xml      = Devovle2DP2(dpDev, arrDPID[i]);
                    s        = oa2dp.SendDevolve(xml, entity.FormsData, "请示报告");
                    sResult += (s + @"\r\n");
                    try
                    {
                        Convert.ToInt32(s);
                    }
                    catch
                    {
                        throw new Exception(s);
                    }
                    //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
                }

                string   sOptionDPID = dpDev.GetCfgNodeValues("/Devolve/Process[@Name='" + base.TemplateName + "']/OptionDPID");
                string[] arrOpDPID   = sOptionDPID.Split(new char[] { ',' });
                for (int i = 0; i < arrOpDPID.Length; i++)
                {
                    if (entity.GetVal(arrOpDPID[i]) == null)
                    {
                        continue;
                    }
                    string   sDPID = entity.GetVal(arrOpDPID[i]).ToString();
                    string[] IDs   = sDPID.Split(new char[] { ';', ',' });
                    for (int j = 0; j < IDs.Length; j++)
                    {
                        try
                        {
                            Convert.ToInt32(IDs[j]);
                        }
                        catch
                        {
                            continue;
                        }
                        xml      = Devovle2DP2(dpDev, IDs[j]);
                        s        = oa2dp.SendDevolve(xml, entity.FormsData, "请示报告");
                        sResult += (s + @"\r\n");
                        try
                        {
                            Convert.ToInt32(s);
                        }
                        catch
                        {
                            throw new Exception(s);
                        }
                    }
                    //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
                }

                #region 注释保留
                //if (string.IsNullOrEmpty(sOADPIDs))
                //{
                //    string[] sDPID1 = entity.BianZhiBuMenID.Split(new char[] { ',', ';' });
                //    string[] sDPID2 = entity.ChengBanBuMenID.Split(new char[] { ',', ';' });
                //    if (sDPID1 != null)
                //    {
                //        for (int i = 0; i < sDPID1.Length; i++)
                //        {
                //            if (string.IsNullOrEmpty(sDPID1[i])) continue;
                //            xml = Devolve2DP(dpDev, sDPID1[i]);
                //            s = oa2dp.SendDevolve(xml, entity.FormsData, "请示报告");
                //            //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
                //        }
                //    }

                //    if (sDPID2 != null)
                //    {
                //        for (int i = 0; i < sDPID2.Length; i++)
                //        {
                //            if (string.IsNullOrEmpty(sDPID2[i])) continue;
                //            xml = Devolve2DP(dpDev, sDPID2[i]);
                //            s = oa2dp.SendDevolve(xml, entity.FormsData, "请示报告");
                //            //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
                //        }
                //    }
                //}
                //else
                //// 根据配置文件的处室ID归档
                //{
                //    string[] arrDPID = sOADPIDs.Split(new char[] { ',' });
                //    for (int i = 0; i < arrDPID.Length; i++)
                //    {
                //        xml = Devolve2DP(dpDev, arrDPID[i]);
                //        s = oa2dp.SendDevolve(xml, entity.FormsData, "请示报告");
                //        //JScript.ShowMsgBox(Page, MsgType.VbCritical, s);
                //    }
                //}
                #endregion
            }
            //string rest = oa2dc.CallBack(Convert.ToInt32(s), true, s);
            //string rest = CDevolve.CallBack(Convert.ToInt32(s), true, s, doc.InnerXml);

            //IMessage ms = new WebFormMessage(Page, s);
            //ms.Show();
        }
        public string Devolve(B_PF enProFile, string strDraftDept, string dealUser, out string sResult)
        {
            sResult = "";
            string sProcessName = "";
            switch (enProFile.ProgramSort)
            {
                case "部门级管理程序":
                    if ("IDP部门管理程序" == enProFile.ProgramType1)
                    {
                        sProcessName = "部门管理程序";
                    }
                    break;
                case "管理程序":
                    switch (enProFile.ProgramType1)
                    {
                        case "PRG项目管理分大纲":
                        case "GPG质量保证大纲":
                            sProcessName = "大纲级管理程序";
                            break;
                        case "PRC公司管理程序":
                            sProcessName = "公司级管理程序";
                            break;
                    }
                    break;
                case "工作程序":
                    sProcessName = enProFile.ProgramSort;
                    break;
            }

            string sPath = HttpContext.Current.Server.MapPath((@"~\Config\DevolveConfig.xml"));
            FounderSoftware.ADIM.OA.OA2DC.HN_OA2DC dcDev = new HN_OA2DC(sPath);
            //FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP dpDev = new HN_OA2DP(sPath);

            // 开始发送归档
            /*
             * 根据DevoleConfig.xml配置文件的中相应流程的<Object>DC</Object>节点来判断归档到哪个系统中
             * 若配置中为DC则表明调用OA2DC.DLL接口进行归档,若为DP则表明调用OA2DP.DLL接口进行归档
             */
            string xml = "";
            string objDevolve = dcDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessName + "']/Object");
            string s = "";
            if (objDevolve.ToUpper() == "DC" || objDevolve.ToUpper() == "FC")
            {
                FounderSoftware.ADIM.OA.OA2DC.OA2DC oa2dc = new FounderSoftware.ADIM.OA.OA2DC.OA2DC();
                xml = Devolve2DC2(dcDev, enProFile, strDraftDept, dealUser, sProcessName);

                //B_PF cEntity = new B_PF();
                //SetEntity(cEntity);
                B_PF cEntity = this.ControlToEntity(false) as B_PF;
                cEntity.FormsData = XmlUtility.SerializeXml(cEntity);
                s = oa2dc.SendDevolve(xml, cEntity.FormsData, "程序文件");
                sResult += (s + @"\r\n");
                try
                {
                    Convert.ToInt32(s);
                }
                catch
                {
                    throw new Exception(s);
                }
            }
            else
            {
                return "尚无归档模板,请联系系统管理员。";
            }

            return s;
            //if (objDevolve.ToUpper() == "DP")
            //{
            //    FounderSoftware.ADIM.OA.OA2DP.OA2DP oa2dp = new FounderSoftware.ADIM.OA.OA2DP.OA2DP();
            //    xml = Devolve2DP(dpDev);
            //    s = oa2dp.SendDevolve(xml);
            //}
            //string rest = oa2dc.CallBack(Convert.ToInt32(s), true, s);

            //IMessage ms = new WebFormMessage(Page, s);
            //ms.Show();
        }
Example #5
0
        public void Devolve(out string sResult)
        {
            sResult = "";
            string sPath = HttpContext.Current.Server.MapPath((@"~\Config\DevolveConfig.xml"));

            FounderSoftware.ADIM.OA.OA2DC.HN_OA2DC dcDev = new HN_OA2DC(sPath);
            FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP dpDev = new HN_OA2DP(sPath);

            // 开始发送归档

            /*
             * 根据DevoleConfig.xml配置文件的中相应流程的<Object>DC</Object>节点来判断归档到哪个系统中
             * 若配置中为DC则表明调用OA2DC.DLL接口进行归档,若为DP则表明调用OA2DP.DLL接口进行归档
             */
            string xml        = "";
            string objDevolve = dcDev.GetCfgNodeValues("/Devolve/Process[@Name='" + base.TemplateName + "']/Object");
            string s          = "";

            //B_LetterReceive l_busWorkItems = new B_LetterReceive();
            //PopulateEntity(l_busWorkItems, base.ViewIDorName, base.WorkItemID);
            B_LetterReceive l_busWorkItems = this.ControlToEntity(false) as B_LetterReceive;

            l_busWorkItems.FormsData = XmlUtility.SerializeXml(l_busWorkItems);
            if (objDevolve.ToUpper() == "DC" || objDevolve.ToUpper() == "FC")
            {
                FounderSoftware.ADIM.OA.OA2DC.OA2DC oa2dc = new FounderSoftware.ADIM.OA.OA2DC.OA2DC();
                xml = Devolve2DC2(dcDev);

                s        = oa2dc.SendDevolve(xml, l_busWorkItems.FormsData, "函件收文");
                sResult += (s + @"\r\n");
                try
                {
                    Convert.ToInt32(s);
                }
                catch
                {
                    throw new Exception(s);
                }
            }


            if (objDevolve.ToUpper() == "DP")
            {
                FounderSoftware.ADIM.OA.OA2DP.OA2DP oa2dp = new FounderSoftware.ADIM.OA.OA2DP.OA2DP();
                xml = Devolve2DP(dpDev);

                s        = oa2dp.SendDevolve(xml, l_busWorkItems.FormsData, "函件收文");
                sResult += (s + @"\r\n");
                try
                {
                    Convert.ToInt32(s);
                }
                catch
                {
                    throw new Exception(s);
                }
            }
            //string rest = oa2dc.CallBack(Convert.ToInt32(s), true, s);

            //IMessage ms = new WebFormMessage(Page, s);
            //ms.Show();
        }
        //private string Devolve2DP(FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP hn_oa2dp)
        //{
        //string sXml = "";
        //#region ArchiveNode
        //FounderSoftware.ADIM.OA.OA2DP.HNDP_CArchiveNode ar = new HNDP_CArchiveNode();
        //ar.System = "OA_" + base.TableID;
        //// Pace-缓急程度
        ////ar.Pace = chkJinJi.Checked ? "0" : "1";
        //// 页数
        //ar.DocPages = txtPages.Text;
        //// 通讯渠道号
        //ar.CommunicationChannelCode = txtOurRef.Text;
        //#region 签发人 签发日期
        //if (txtSignDate.Text != "")
        //{
        //    if (txtSignDate.Text.Contains(" "))
        //    {
        //        //签发日期-批准日期
        //        ar.AuthorizeTime = txtSignDate.Text.Split(' ')[1];
        //    }
        //    else
        //    {
        //        //签发日期-批准日期
        //        ar.AuthorizeTime = txtSignDate.Text;
        //    }
        //    //签发人-批准者
        //    ar.Authorizer = txtQianFaRen.Text;
        //}
        //#endregion
        //// 会签者
        ////ar.Countersigner = txtHuiQianRen.Text;
        //// 会签日期
        ////ar.CountersignedDate = txtHuiQianRenDates.Text;
        //#region 核稿人-校核者
        //////核稿人-校核者
        ////if (txtHeGaoRenDate.Text != "")
        ////{
        ////    if (txtHeGaoRenDate.Text.Contains(" "))
        ////    {
        ////        //核稿日期-校核日期
        ////        ar.CheckDate = txtHeGaoRenDate.Text.Split(' ')[1];
        ////    }
        ////    else
        ////    {
        ////        //核稿日期-校核日期
        ////        ar.CheckDate = txtHeGaoRenDate.Text;
        ////    }
        ////    //核稿人-校核者
        ////    ar.Checkthose = txtHeGaoRenDate.Text;
        ////}
        //#endregion
        //// 编制人/编制日期
        //// 编制单位
        //ar.FormationDept = drpSendDept.SelectedItem.Text;
        //// 题名
        //ar.Title = txtSubject.Text;
        //// 主送单位
        //ar.MainDispenseUnit = txtCompany.Text;
        //// 抄送单位
        //ar.RelatedDespenseUnit = txtccCompany.Text;
        //// 备注
        //ar.Remark = txtMyPrompt.Text;
        ////ar.FK_CategoryID = "903";
        //// 公共常量
        ////ar.GatherLevel = "件";
        ////ar.D_StorageCarrierType = "纸质";
        ////ar.Amount = "1";
        ////ar.D_Language = "中文";
        //ar.ElectronicDocumentCount = UCFileControl1.UCDataList.Count.ToString();
        //#endregion
        //sXml = hn_oa2dp.GenOAArchiveNode(ar, base.TemplateID);

        //FounderSoftware.ADIM.OA.OA2DP.HNDP_CFileNode fl = new HNDP_CFileNode();
        ///****开始生成File节点************************************************************************/
        //#region 开始生成File节点
        //fl.AuthorizeTime = ar.AuthorizeTime;
        //fl.Code = ar.Code;
        //fl.Code19 = ar.Code19;
        //fl.D_FileStatus = ar.D_FileStatus;
        //fl.DocCodesExplain = "";
        //fl.DocPages = ar.DocPages;
        //fl.ElectronicDocumentTransceiverTime = ar.ElectronicDocumentTransceiverTime;
        //fl.Ext_1 = ar.Ext_1;
        //fl.Ext_2 = ar.Ext_2;
        //fl.Ext_3 = ar.Ext_3;
        //fl.Ext_4 = ar.Ext_4;
        //fl.Ext_5 = ar.Ext_5;
        //fl.Title = ar.Title;
        ////fl.FK_ArchiveID = ar.FK_Archive;
        //fl.FK_CategoryID = ar.FK_CategoryID;
        //fl.FormationDept = ar.FormationDept;
        //fl.FormationTime = ar.FormationTime;
        //fl.Importer = ar.Importer;
        //fl.ImporterTime = ar.ImporterTime;
        //fl.OriginalID = ar.OriginalID;
        //fl.OtherTitle = ar.OtherTitle;
        //fl.PaperDocumentTransceiverTime = ar.PaperDocumentTransceiverTime;
        //fl.RelatedCode = ar.RelatedCode;
        //fl.Revision = ar.Revision;
        //#endregion
        //sXml = hn_oa2dp.GenOAFileNode(fl);
        ///****完成生成File节点************************************************************************/

        //#region 始生成Attachment节点
        ///****开始生成Attachment节点******************************************************************/
        //string sServerWeb = hn_oa2dp.GetCfgNodeValues("/Devolve/Other/ServerWeb");
        ////"http://172.29.128.239";
        ////string sDocumentName = oaDev.GetCfgNodeValues("/Devolve/Other/DocumentName");
        //for (int i = 0; i < UCFileControl1.UCDataList.Count; i++)
        //{
        //    FounderSoftware.ADIM.OA.OA2DP.HNDP_CAttachmentNode at = new HNDP_CAttachmentNode();
        //    CFuJian file = UCFileControl1.UCDataList[i];

        //    at.DocumentName = "函件发文";//file.FileName;
        //    at.FK_FileID = "";
        //    at.MakeDate = "";
        //    at.MakeUnit = "";
        //    at.PublishedTime = "";
        //    at.Remark = "";

        //    at.ServerWeb = sServerWeb;
        //    Double iSize = 0;
        //    string sSize = file.Size.ToUpper();
        //    if (sSize.Contains("K"))
        //    {
        //        sSize = sSize.Replace("K", "");
        //        iSize = Convert.ToDouble(sSize);
        //        iSize = iSize * 1024;
        //    }
        //    if (sSize.Contains("M"))
        //    {
        //        sSize = sSize.Replace("M", "");
        //        iSize = Convert.ToDouble(sSize);
        //        iSize = iSize * 1024 * 1024;
        //    }
        //    at.Size = ((int)iSize).ToString();
        //    at.TimeSize = "";
        //    at.Title = file.Alias;
        //    at.Type = file.Type;
        //    at.Url = file.URL;

        //    sXml = hn_oa2dp.GenOAAttachmentNode(fl.FK_ArchiveID, at);
        //}
        //#endregion
        ///****完成生成Attachment节点******************************************************************/

        //    return sXml;
        //}
        #endregion

        public string Devolve(B_PF enProFile, string strDraftDept, string dealUser, out string sResult)
        {
            sResult = "";
            string sProcessName = "";

            switch (enProFile.ProgramSort)
            {
            case "部门级管理程序":
                if ("IDP部门管理程序" == enProFile.ProgramType1)
                {
                    sProcessName = "部门管理程序";
                }
                break;

            case "管理程序":
                switch (enProFile.ProgramType1)
                {
                case "PRG项目管理分大纲":
                case "GPG质量保证大纲":
                    sProcessName = "大纲级管理程序";
                    break;

                case "PRC公司管理程序":
                    sProcessName = "公司级管理程序";
                    break;
                }
                break;

            case "工作程序":
                sProcessName = enProFile.ProgramSort;
                break;
            }

            string sPath = HttpContext.Current.Server.MapPath((@"~\Config\DevolveConfig.xml"));

            FounderSoftware.ADIM.OA.OA2DC.HN_OA2DC dcDev = new HN_OA2DC(sPath);
            //FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP dpDev = new HN_OA2DP(sPath);

            // 开始发送归档

            /*
             * 根据DevoleConfig.xml配置文件的中相应流程的<Object>DC</Object>节点来判断归档到哪个系统中
             * 若配置中为DC则表明调用OA2DC.DLL接口进行归档,若为DP则表明调用OA2DP.DLL接口进行归档
             */
            string xml        = "";
            string objDevolve = dcDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessName + "']/Object");
            string s          = "";

            if (objDevolve.ToUpper() == "DC" || objDevolve.ToUpper() == "FC")
            {
                FounderSoftware.ADIM.OA.OA2DC.OA2DC oa2dc = new FounderSoftware.ADIM.OA.OA2DC.OA2DC();
                xml = Devolve2DC2(dcDev, enProFile, strDraftDept, dealUser, sProcessName);

                //B_PF cEntity = new B_PF();
                //SetEntity(cEntity);
                B_PF cEntity = this.ControlToEntity(false) as B_PF;
                cEntity.FormsData = XmlUtility.SerializeXml(cEntity);
                s        = oa2dc.SendDevolve(xml, cEntity.FormsData, "程序文件");
                sResult += (s + @"\r\n");
                try
                {
                    Convert.ToInt32(s);
                }
                catch
                {
                    throw new Exception(s);
                }
            }
            else
            {
                return("尚无归档模板,请联系系统管理员。");
            }

            return(s);
            //if (objDevolve.ToUpper() == "DP")
            //{
            //    FounderSoftware.ADIM.OA.OA2DP.OA2DP oa2dp = new FounderSoftware.ADIM.OA.OA2DP.OA2DP();
            //    xml = Devolve2DP(dpDev);
            //    s = oa2dp.SendDevolve(xml);
            //}
            //string rest = oa2dc.CallBack(Convert.ToInt32(s), true, s);

            //IMessage ms = new WebFormMessage(Page, s);
            //ms.Show();
        }
        public void Devolve(EntityBase entity, string sProcessType, out string sResult, out string sPlatForm)
        {
            sResult = "";
            string sPath = HttpContext.Current.Server.MapPath((@"~\Config\DevolveConfig.xml"));

            FounderSoftware.ADIM.OA.OA2DC.HN_OA2DC dcDev = new HN_OA2DC(sPath);
            FounderSoftware.ADIM.OA.OA2DP.HN_OA2DP dpDev = new HN_OA2DP(sPath);

            // 开始发送归档

            /*
             * 根据DevoleConfig.xml配置文件的中相应流程的<Object>DC</Object>节点来判断归档到哪个系统中
             * 若配置中为DC则表明调用OA2DC.DLL接口进行归档,若为DP则表明调用OA2DP.DLL接口进行归档
             */
            string xml        = "";
            string objDevolve = dcDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessType + "']/Object");
            string s          = "";

            sPlatForm = objDevolve.ToUpper();

            entity.FormsData = XmlUtility.SerializeXml(entity);
            if (objDevolve.ToUpper() == "DC" || objDevolve.ToUpper() == "FC")
            {
                FounderSoftware.ADIM.OA.OA2DC.OA2DC oa2dc = new FounderSoftware.ADIM.OA.OA2DC.OA2DC();
                xml = Devolve2DC2(entity, dcDev, sProcessType);

                s        = oa2dc.SendDevolve(xml, entity.FormsData, sProcessType);
                sResult += (s + @"\r\n");
                try
                {
                    Convert.ToInt32(s);
                }
                catch
                {
                    throw new Exception(s);
                }
                B_ProcessInstance.ProcessDevolve(entity.ProcessID, sProcessType);
            }

            if (objDevolve.ToUpper() == "DP")
            {
                FounderSoftware.ADIM.OA.OA2DP.OA2DP oa2dp = new FounderSoftware.ADIM.OA.OA2DP.OA2DP();
                string sOADPIDs = dpDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessType + "']/DPID");

                // 若DevolveConifg.xml配置文件中未配置CategID则根据流程实体中的处室ID归档
                string[] arrDPID = sOADPIDs.Split(new char[] { ',', ';' });
                for (int i = 0; i < arrDPID.Length; i++)
                {
                    try
                    {
                        Convert.ToInt32(arrDPID[i]);
                    }
                    catch
                    {
                        continue;
                    }
                    xml      = Devovle2DP2(entity, dpDev, arrDPID[i], sProcessType);
                    s        = oa2dp.SendDevolve(xml, entity.FormsData, sProcessType);
                    sResult += (s + @"\r\n");
                    try
                    {
                        Convert.ToInt32(s);
                    }
                    catch
                    {
                        throw new Exception(s);
                    }
                }

                string   sOptionDPID = dpDev.GetCfgNodeValues("/Devolve/Process[@Name='" + sProcessType + "']/OptionDPID");
                string[] arrOpDPID   = sOptionDPID.Split(new char[] { ',' });
                for (int i = 0; i < arrOpDPID.Length; i++)
                {
                    if (entity.GetVal(arrOpDPID[i]) == null)
                    {
                        continue;
                    }
                    string   sDPID = entity.GetVal(arrOpDPID[i]).ToString();
                    string[] IDs   = sDPID.Split(new char[] { ';', ',' });
                    for (int j = 0; j < IDs.Length; j++)
                    {
                        try
                        {
                            Convert.ToInt32(IDs[j]);
                        }
                        catch
                        {
                            continue;
                        }
                        xml      = Devovle2DP2(entity, dpDev, IDs[j], sProcessType);
                        s        = oa2dp.SendDevolve(xml, entity.FormsData, sProcessType);
                        sResult += (s + @"\r\n");
                        try
                        {
                            Convert.ToInt32(s);
                        }
                        catch
                        {
                            throw new Exception(s);
                        }
                    }
                }

                B_ProcessInstance.ProcessDevolve(entity.ProcessID, sProcessType);
            }
        }