Example #1
0
        public virtual DetalheSegmentoYRetornoCNAB240 LerDetalheSegmentoYRetornoCNAB240(string registro)
        {
            var detalhe = new DetalheSegmentoYRetornoCNAB240(registro);

            detalhe.LerDetalheSegmentoYRetornoCNAB240(registro);

            return detalhe;
        }
Example #2
0
        public override DetalheSegmentoYRetornoCNAB240 LerDetalheSegmentoYRetornoCNAB240(string registro)
        {
            try
            {
                DetalheSegmentoYRetornoCNAB240 detalhe = new DetalheSegmentoYRetornoCNAB240(registro);

                if (registro.Substring(13, 1) != "U")
                    throw new Exception("Registro inválido. O detalhe não possuí as características do segmento Y.");

                detalhe.CodigoMovimento = Convert.ToInt32(registro.Substring(15, 2));
                detalhe.IdentificacaoRegistro = Convert.ToInt32(registro.Substring(17, 4));
                detalhe.IdentificacaoCheque1 = registro.Substring(19, 34);
                detalhe.IdentificacaoCheque2 = registro.Substring(43, 34);
                detalhe.IdentificacaoCheque3 = registro.Substring(87, 34);
                detalhe.IdentificacaoCheque4 = registro.Substring(121, 34);
                detalhe.IdentificacaoCheque5 = registro.Substring(155, 34);
                detalhe.IdentificacaoCheque6 = registro.Substring(189, 34);

                return detalhe;
            }
            catch (Exception ex)
            {
                throw new Exception("Erro ao processar arquivo de RETORNO - SEGMENTO Y.", ex);
            }


        }