Exemplo n.º 1
0
 public EdiEnvelope(EdiSegmentCollection segs)
 {
     Header       = segs.FirstWith(headerLabel());
     Footer       = segs.FirstWith(footerLabel());
     _footerArray = Footer.GetElements(segs.ElementDelimiter);
     _headerArray = Header.GetElements(segs.ElementDelimiter);
     if (Header == null || Footer == null)
     {
         throw new EdiBadlyFormedEnvelopeException("Header/Footer not found in envelope!");
     }
     ControlNumber = Footer.GetElements(segs.ElementDelimiter)[1];
     _segments     = segs;
     _parseHeader();
     _parseFooter();
 }