public void SaveAcks(Acknowledgements acks)
 {
     acks.Acks.Where(a => a != null).ForEach(a =>
                           {
                               base.Save(getAck(a, acks));
                           });
 }
        public Acknowledgements ProcessSegmentList(List<Segment> segList)
        {
            var st = segList.First();
            _elementDelimiter = get_element_delimiter(st);

            var header = st.GetElements(_elementDelimiter);
            var acks = new Acknowledgements();
            acks.ControlNumber = header[2];
            var akList = getAK2List(segList);
            acks.Acks  = akList.Select(getAck).ToList();
            return acks;
        }
        private ReceiptAcknowledgement getAck(ReceiptAcknowledgementMsg ackMsg, Acknowledgements acks)
        {
            var ack = GetSentDocument(ackMsg.ControlNumber.CastToInt());
                                      if(ack == null)
                                          throw new EDIWorkflowException(
                                              string.Format(
                                                  "The ACK placeholder for control number {0} was not found!",
                                                  ackMsg.ControlNumber));
            ack.AckReceiveDate = DateTime.Now;
            ack.AckControlNumber = acks.ControlNumber.CastToInt();

            return ack;
        }