public IList<DocumentLineItemEntity> ProcessLines(List<Segment> lst, IEdiMessage doc)
        {
            _lines.Clear();
            var co = doc as OrderRequestReceivedMessage;
            if (co == null) return null;
            lst.RemoveWhile(seg => seg.Label != SegmentLabel.PurchaseOrder);
            _poParser.ProcessLines(lst, doc);
            CustomerOrderLine line;
            do
            {
                line = build_line(lst, SegmentLabel.SummaryLabel);
                if(line != null) co.Add(line);

            } while (line != null) ;
            return _lines;
        }
 public void ProcessAddresses(List<Segment> lst, IEdiMessage ediMessage)
 {
     lst.RemoveWhile(seg => seg.Label != EDIConstants.AddressNameLabel);
     var addr_loop = new List<Segment>();
     while (EDIUtilities.MoveSegmentByLabel(lst, addr_loop, EDIConstants.AddressNameLabel))
     {
         SegmentCount++;
         Segment next_seg = lst[0];
         while (next_seg.Label == EDIConstants.AddressLineLabel
                || next_seg.Label == EDIConstants.GeographicLabel)
         {
             SegmentCount++;
             EDIUtilities.MoveSegment(lst, addr_loop, next_seg);
             next_seg = lst[0];
         }
         ediMessage.AddAddress(process_address(addr_loop));
         addr_loop.Clear();
     }
 }
 public int ProcessAddresses(List<Segment> lst, IEdiMessageWithAddress ediMessage)
 {
     if (!addressesFound(lst)) return 0;
     lst.RemoveWhile(seg => seg.Label != SegmentLabel.AddressNameLabel);
     var addrLoop = new List<Segment>();
     var segmentCount = 0;
     while (EDIUtilities.MoveSegmentByLabel(lst, addrLoop, SegmentLabel.AddressNameLabel))
     {
         segmentCount++;
         Segment nextSeg = lst[0];
         while (nextSeg.Label == SegmentLabel.AddressLineLabel
                || nextSeg.Label == SegmentLabel.GeographicLabel
                || nextSeg.Label == SegmentLabel.ContactLabel)
         {
             segmentCount++;
             EDIUtilities.MoveSegment(lst, addrLoop, nextSeg);
             nextSeg = lst[0];
         }
         ediMessage.AddAddress(process_address(addrLoop));
         addrLoop.Clear();
     }
     return segmentCount;
 }