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();
        }
Example #3
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();
        }
        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 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);
            }
        }