/// <summary> /// Cria uma nova instância abstrata de Arquivo para Remessa /// </summary> /// <param name="tipoArquivo">Tipo de Arquivo de Remesssa que deve ser gerado</param> public AbstractArquivoRemessa(TipoArquivo tipoArquivo) { switch (tipoArquivo) { case TipoArquivo.CNAB240: _arquivoRemessa = new ArquivoRemessaCNAB240(); _arquivoRemessa.LinhaDeArquivoGerada += new EventHandler <LinhaDeArquivoGeradaArgs>(_arquivoRemessa_LinhaDeArquivoGerada); break; case TipoArquivo.CNAB240EmModoTeste: _arquivoRemessa = new ArquivoRemessaCNAB240() { ModoTeste = true }; _arquivoRemessa.LinhaDeArquivoGerada += new EventHandler <LinhaDeArquivoGeradaArgs>(_arquivoRemessa_LinhaDeArquivoGerada); break; case TipoArquivo.CNAB400: _arquivoRemessa = new ArquivoRemessaCNAB400(); _arquivoRemessa.LinhaDeArquivoGerada += new EventHandler <LinhaDeArquivoGeradaArgs>(_arquivoRemessa_LinhaDeArquivoGerada); break; default: throw new NotImplementedException("Arquivo não implementado."); } }
public string GerarHeaderRemessa(Cedente cedente, IArquivoRemessa arquivo, int numeroArquivoRemessa) { try { return(_IBanco.GerarHeaderRemessa(cedente, arquivo, numeroArquivoRemessa)); } catch (Exception ex) { throw new Exception("Erro durante a geração do registro HEADER do arquivo de REMESSA.", ex); } }
public string GerarDetalheRemessa(Boleto boleto, int numeroRegistro, IArquivoRemessa arquivo) { try { return(_IBanco.GerarDetalheRemessa(boleto, numeroRegistro, arquivo)); } catch (Exception ex) { throw new Exception("Erro durante a geração dos registros de DETALHE do arquivo de REMESSA.", ex); } }
public AbstractArquivoRemessa(TipoArquivo tipoArquivo) { switch (tipoArquivo) { case TipoArquivo.CNAB240: _arquivoRemessa = new ArquivoRemessaCNAB240(); _arquivoRemessa.LinhaDeArquivoGerada += new EventHandler<LinhaDeArquivoGeradaArgs>(_arquivoRemessa_LinhaDeArquivoGerada); break; case TipoArquivo.CNAB400: _arquivoRemessa = new ArquivoRemessaCNAB400(); _arquivoRemessa.LinhaDeArquivoGerada += new EventHandler<LinhaDeArquivoGeradaArgs>(_arquivoRemessa_LinhaDeArquivoGerada); break; default: throw new NotImplementedException("Arquivo não implementado."); } }
public override string GerarHeaderRemessa( string numeroConvenio, Cedente cedente, IArquivoRemessa arquivo, int numeroArquivoRemessa) { try { this._convenio = numeroConvenio; this.Cedente = cedente; var header = string.Empty; base.GerarHeaderRemessa(numeroConvenio, cedente, arquivo, numeroArquivoRemessa); switch (arquivo.TipoArquivo) { case TipoArquivo.CNAB240: break; case TipoArquivo.CNAB400: header = this.GerarHeaderRemessaCNAB400(numeroConvenio); break; case TipoArquivo.CBR643: break; case TipoArquivo.Outro: break; default: throw new ArgumentOutOfRangeException("tipoArquivo", arquivo.TipoArquivo, null); } return(header); } catch (Exception) { throw; } }
public override string GerarHeaderRemessa(string numeroConvenio, Cedente cedente, IArquivoRemessa arquivo, int numeroArquivoRemessa) { throw new NotImplementedException("Função não implementada."); }
public override string GerarDetalheRemessa(Boleto boleto, int numeroRegistro, IArquivoRemessa arquivo) { throw new NotImplementedException("Função não implementada."); }
public override string GerarDetalheRemessa(Boleto boleto, int numeroRegistro, IArquivoRemessa arquivo) { try { var detalhe = string.Empty; switch (arquivo.TipoArquivo) { case TipoArquivo.CNAB240: break; case TipoArquivo.CNAB400: detalhe = this.GerarDetalheRemessaCNAB400(boleto, numeroRegistro); break; case TipoArquivo.CBR643: break; case TipoArquivo.Outro: break; default: throw new ArgumentOutOfRangeException("tipoArquivo", arquivo.TipoArquivo, null); } return(detalhe); } catch (Exception) { throw; } }
/// <summary> /// DETALHE do arquivo CNAB /// Gera o DETALHE do arquivo remessa de acordo com o lay-out informado /// </summary> public override string GerarDetalheRemessa(Boleto boleto, int numeroRegistro, IArquivoRemessa arquivo) { try { string _detalhe = " "; base.GerarDetalheRemessa(boleto, numeroRegistro, arquivo); switch (arquivo.TipoArquivo) { case TipoArquivo.CNAB240: _detalhe = GerarDetalheRemessaCNAB240(); break; case TipoArquivo.CNAB400: _detalhe = GerarDetalheRemessaCNAB400(boleto, numeroRegistro, arquivo.TipoArquivo); break; case TipoArquivo.Outro: throw new Exception("Tipo de arquivo inexistente."); } return(_detalhe); } catch (Exception ex) { throw new Exception("Erro durante a geração do DETALHE arquivo de REMESSA.", ex); } }
/// <summary> /// Gera o HEADER do arquivo remessa de acordo com o lay-out informado /// </summary> public override string GerarHeaderRemessa(string numeroConvenio, Cedente cedente, IArquivoRemessa arquivo, int numeroArquivoRemessa) { try { string _header = " "; base.GerarHeaderRemessa(numeroConvenio, cedente, arquivo, numeroArquivoRemessa); switch (arquivo.TipoArquivo) { case TipoArquivo.CNAB240: _header = GerarHeaderRemessaCNAB240(); break; case TipoArquivo.CNAB400: _header = GerarHeaderRemessaCNAB400(int.Parse(numeroConvenio), cedente, numeroArquivoRemessa); break; case TipoArquivo.Outro: throw new Exception("Tipo de arquivo inexistente."); } return(_header); } catch (Exception ex) { throw new Exception("Erro durante a geração do HEADER do arquivo de REMESSA.", ex); } }