public static ChoNACHAReader LoadText(string inputText, ChoNACHAConfiguration configuration = null) { var r = new ChoNACHAReader(inputText.ToStream(), configuration); r._closeStreamOnDispose = true; return(r); }
public ChoNACHAReader(StreamReader streamReader, ChoNACHAConfiguration configuration = null) { ChoGuard.ArgumentNotNull(streamReader, "StreamReader"); Configuration = configuration; Init(); _streamReader = streamReader; }
public ChoNACHAReader(TextReader textReader, ChoNACHAConfiguration configuration = null) { ChoGuard.ArgumentNotNull(textReader, "TextReader"); Configuration = configuration; Init(); _textReader = textReader; }
private void Init() { _enumerator = new Lazy <IEnumerator>(() => GetEnumerator()); if (Configuration == null) { Configuration = new ChoNACHAConfiguration(); } }
public ChoNACHAReader(Stream inStream, ChoNACHAConfiguration configuration = null) { ChoGuard.ArgumentNotNull(inStream, "Stream"); Configuration = configuration; Init(); _streamReader = new StreamReader(inStream, Configuration.GetEncoding(inStream), false, Configuration.BufferSize); _closeStreamOnDispose = true; }
public ChoNACHAReader(string filePath, ChoNACHAConfiguration configuration = null) { ChoGuard.ArgumentNotNullOrEmpty(filePath, "FilePath"); Configuration = configuration; Init(); _textReader = new StreamReader(ChoPath.GetFullPath(filePath), Configuration.GetEncoding(filePath), false, Configuration.BufferSize); _closeStreamOnDispose = true; }
internal ChoNACHAEntryDetailWriter(ChoManifoldWriter writer, ChoNACHARunningStat batchRunningStatObject, ChoNACHAConfiguration configuration) { _configuration = configuration; _writer = writer; _batchRunningStatObject = batchRunningStatObject; _entryDetailWriter = new Lazy <bool>(() => { WriteEntryDetail(); return(true); }); }
public ChoNACHAWriter(StreamWriter streamWriter, ChoNACHAConfiguration configuration = null) { ChoGuard.ArgumentNotNull(streamWriter, "StreamWriter"); Configuration = configuration; if (Configuration == null) { Configuration = new ChoNACHAConfiguration(); } _streamWriter = streamWriter; Init(); }
public ChoNACHAWriter(TextWriter textWriter, ChoNACHAConfiguration configuration = null) { ChoGuard.ArgumentNotNull(textWriter, "TextWriter"); Configuration = configuration; if (Configuration == null) { Configuration = new ChoNACHAConfiguration(); } _textWriter = textWriter; Init(); }
internal ChoNACHABatchWriter(ChoManifoldWriter writer, ChoNACHARunningStat fileRunningStatObject, ChoNACHAConfiguration configuration) { _configuration = configuration; _writer = writer; _batchRunningStatObject = new ChoNACHARunningStat(); _fileRunningStatObject = fileRunningStatObject; _batchHeaderWriter = new Lazy <bool>(() => { WriteBatchHeader(); return(true); }); }
public ChoNACHAWriter(Stream inStream, ChoNACHAConfiguration configuration = null) { ChoGuard.ArgumentNotNull(inStream, "Stream"); Configuration = configuration; if (Configuration == null) { Configuration = new ChoNACHAConfiguration(); } _streamWriter = new StreamWriter(inStream, Configuration.Encoding, Configuration.BufferSize); _closeStreamOnDispose = true; Init(); }
public ChoNACHAWriter(string filePath, ChoNACHAConfiguration configuration = null) { ChoGuard.ArgumentNotNullOrEmpty(filePath, "FilePath"); Configuration = configuration; if (Configuration == null) { Configuration = new ChoNACHAConfiguration(); } _streamWriter = new StreamWriter(ChoPath.GetFullPath(filePath), false, Configuration.Encoding, Configuration.BufferSize); _closeStreamOnDispose = true; Init(); }
public ChoNACHAReader(Stream inStream, ChoNACHAConfiguration configuration = null) { ChoGuard.ArgumentNotNull(inStream, "Stream"); Configuration = configuration; Init(); if (inStream is MemoryStream) { _textReader = new StreamReader(inStream); } else { _textReader = new StreamReader(inStream, Configuration.GetEncoding(inStream), false, Configuration.BufferSize); } }
public ChoNACHAWriter(Stream inStream, ChoNACHAConfiguration configuration = null) { ChoGuard.ArgumentNotNull(inStream, "Stream"); Configuration = configuration; if (Configuration == null) { Configuration = new ChoNACHAConfiguration(); } if (inStream is MemoryStream) { _textWriter = new StreamWriter(inStream); } else { _textWriter = new StreamWriter(inStream, Configuration.Encoding, Configuration.BufferSize); } Init(); }
public void Validate(ChoNACHAConfiguration configuration) { if (!configuration.TurnOffDestinationBankRoutingNumber) { string immediateDestination = ImmediateDestination.ToNString(); var value1 = !immediateDestination.IsNullOrEmpty() && ((immediateDestination.Length == 9 && !immediateDestination.Where(c => !Char.IsDigit(c)).Any()) || (immediateDestination.Length == 10 && immediateDestination[0] == ' ' && !immediateDestination.Skip(1).Where(c => !Char.IsDigit(c)).Any())); if (!value1) { throw new ChoNACHAException("Invalid ImmediateDestination value found."); } } if (!configuration.TurnOffOriginatingCompanyIdValidation) { string immediateOrigin = ImmediateOrigin.ToNString(); var value2 = !immediateOrigin.IsNullOrEmpty() && ((immediateOrigin.Length == 9 && !immediateOrigin.Where(c => !Char.IsDigit(c)).Any()) || (immediateOrigin.Length == 10 && immediateOrigin[0] == ' ' && !immediateOrigin.Skip(1).Where(c => !Char.IsDigit(c)).Any()) || (immediateOrigin.Length == 10 && !immediateOrigin.Where(c => !Char.IsDigit(c)).Any())); if (!value2) { throw new ChoNACHAException("Invalid ImmediateOrigin value found."); } } }
public ChoNACHAReader(StringBuilder sb, ChoNACHAConfiguration configuration = null) : this(new StringReader(sb.ToString()), configuration) { }
public static ChoNACHAReader LoadText(string inputText, Encoding encoding = null, ChoNACHAConfiguration configuration = null, TraceSwitch traceSwitch = null) { var r = new ChoNACHAReader(inputText.ToStream(encoding), configuration) { TraceSwitch = traceSwitch == null ? ChoETLFramework.TraceSwitch : traceSwitch }; r._closeStreamOnDispose = true; return(r); }
public ChoNACHAWriter(StringBuilder sb, ChoNACHAConfiguration configuration = null) : this(new StringWriter(sb), configuration) { }