public string ConsultaOP(string key, string password, string numeroDocumentoGerador)
        {
            try
            {
                var entityProgramacaoDesembolso = new ProgramacaoDesembolso();
                var result     = DataHelperProdespPagementoContaDer.Procedure_ConsultaOP(key, password, numeroDocumentoGerador);
                var resultItem = result[0];

                if (!string.IsNullOrEmpty(resultItem?.outErro))
                {
                    var error = resultItem?.outErro;
                    if (error.Contains("FCFIN4 - PAGAMENTO NAO PREPARADO"))
                    {
                        entityProgramacaoDesembolso.OP = resultItem?.outNumeroOP + "@" + resultItem?.outErro;
                        //entityProgramacaoDesembolso.ProdespConsultaOPMensagemErro = resultItem?.outErro;
                    }
                    else
                    {
                        throw new ProdespException(error);
                    }
                }
                else
                {
                    entityProgramacaoDesembolso.OP = resultItem?.outNumeroOP;
                }

                return(entityProgramacaoDesembolso.OP);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message.Contains("EntradaCICS_Fora") ? "Erro na comunicação com WebService Prodesp." : ex.Message);
            }
        }
        public string ConsultaOP(string key, string password, string numeroDocumentoGerador)
        {
            try
            {
                var result = DataHelperProdespPagementoContaDer.Procedure_ConsultaOP(key, password, numeroDocumentoGerador);
                var resultItem = result[0];

                //if (!string.IsNullOrEmpty(resultItem?.outErro))
                //  throw new Exception($"Prodesp - {resultItem?.outErro}");

                var entityProgramacaoDesembolso = new ProgramacaoDesembolso();
                entityProgramacaoDesembolso.OP = resultItem?.outNumeroOP + "@" + resultItem?.outErro;
                //entityProgramacaoDesembolso.ProdespConsultaOPMensagemErro = resultItem?.outErro;

                return entityProgramacaoDesembolso.OP;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message.Contains("EntradaCICS_Fora") ? "Erro na comunicação com WebService Prodesp." : ex.Message);
            }
        }