예제 #1
0
        public string GerarDetalheRemessa(TipoArquivo tipoArquivo, Boleto boleto, ref int numeroRegistro)
        {
            try
            {
                string detalhe = Empty, strline = Empty;
                switch (tipoArquivo)
                {
                case TipoArquivo.CNAB400:
                    detalhe += GerarDetalheRemessaCNAB400Registro1(boleto, ref numeroRegistro);
                    strline  = GerarDetalheRemessaCNAB400Registro2(boleto, ref numeroRegistro);
                    if (!IsNullOrWhiteSpace(strline))
                    {
                        detalhe += Environment.NewLine;
                        detalhe += strline;
                    }
                    strline = GerarDetalheRemessaCNAB400Registro5(boleto, ref numeroRegistro);
                    if (!IsNullOrWhiteSpace(strline))
                    {
                        detalhe += Environment.NewLine;
                        detalhe += strline;
                    }
                    break;

                default:
                    throw new Exception("Tipo de arquivo inexistente.");
                }
                return(detalhe);
            }
            catch (Exception ex)
            {
                throw Boleto2NetException.ErroAoGerarRegistroDetalheDoArquivoRemessa(ex);
            }
        }
예제 #2
0
        public string GerarDetalheRemessa(TipoArquivo tipoArquivo, Boleto boleto, ref int numeroRegistro)
        {
            try
            {
                var detalhe = string.Empty;
                var strline = string.Empty;
                switch (tipoArquivo)
                {
                    case TipoArquivo.CNAB400:

                        // Registro 1 - Obrigatório
                        detalhe += GerarDetalheRemessaCNAB400Registro1(boleto, ref numeroRegistro);

                        // Registro 1 Adicional - Registro Opcional
                        strline = GerarDetalheRemessaCNAB400Registro1Mensagem(boleto, ref numeroRegistro);
                        if (!string.IsNullOrWhiteSpace(strline))
                        {
                            detalhe += Environment.NewLine;
                            detalhe += strline;
                        }

                        break;
                    default:
                        throw new Exception("Tipo de arquivo inexistente.");
                }
                return detalhe;
            }
            catch (Exception ex)
            {
                throw Boleto2NetException.ErroAoGerarRegistroDetalheDoArquivoRemessa(ex);
            }
        }
예제 #3
0
        public string GerarDetalheRemessa(TipoArquivo tipoArquivo, Boleto boleto, ref int numeroRegistro)
        {
            try
            {
                var detalhe = Empty;
                var strline = "";
                //base.GerarDetalheRemessa(boleto, numeroRegistro, tipoArquivo);
                switch (tipoArquivo)
                {
                case TipoArquivo.CNAB240:
                    // Segmento P (Obrigatório)
                    detalhe += GerarDetalheSegmentoPRemessaCNAB240SIGCB(boleto, ref numeroRegistro);

                    // Segmento Q (Obrigatório)
                    detalhe += Environment.NewLine;
                    detalhe += GerarDetalheSegmentoQRemessaCNAB240SIGCB(boleto, ref numeroRegistro);

                    // Segmento R (Opcional)
                    strline = GerarDetalheSegmentoRRemessaCNAB240SIGCB(boleto, ref numeroRegistro);
                    if (!IsNullOrWhiteSpace(strline))
                    {
                        detalhe += Environment.NewLine;
                        detalhe += strline;
                    }

                    // Segmento S (Opcional)
                    strline = GerarDetalheSegmentoSRemessaCNAB240SIGCB(boleto, ref numeroRegistro);
                    if (!IsNullOrWhiteSpace(strline))
                    {
                        detalhe += Environment.NewLine;
                        detalhe += strline;
                    }

                    break;

                default:
                    throw new Exception("Caixa Econômica Federal - Detalhe - Tipo de arquivo inexistente.");
                }

                return(detalhe);
            }
            catch (Exception ex)
            {
                throw Boleto2NetException.ErroAoGerarRegistroDetalheDoArquivoRemessa(ex);
            }
        }
예제 #4
0
        public string GerarDetalheRemessa(TipoArquivo tipoArquivo, Boleto boleto, ref int numeroRegistro)
        {
            try
            {
                string detalhe = Empty, strline = Empty;
                switch (tipoArquivo)
                {
                case TipoArquivo.CNAB400:
                    detalhe += GerarDetalheRemessaCNAB400Registro1(boleto, ref numeroRegistro);
                    break;

                default:
                    throw new Exception("Tipo de arquivo inexistente.");
                }
                return(detalhe);
            }
            catch (Exception ex)
            {
                throw Boleto2NetException.ErroAoGerarRegistroDetalheDoArquivoRemessa(ex);
            }
        }