private static void add_value(DocumentInDTO doc, IEnumerable<ResponseElementEntity> responseValues)
 {
     var val = responseValues.Where(v => v.DocumentInDTO.ControlNumber == doc.ControlNumber);
     if (val != null)
     {
         val.ToList().ForEach(v => doc.AddResponseElement(v.ElementName, v.Value, v.Qualifier));
     }
 }
 private void add_lines(DocumentInDTO doc, IEnumerable<DocumentLineItemEntity> lines)
 {
     var val = lines.Where(l => l.DocumentInDTO.ControlNumber == doc.ControlNumber);
     if (val != null)
     {
         val.ToList().ForEach(l => doc.AddLineItem(l.LineIdentifier, l.ResponseElements));
     }
 }
        public void TestFixtureSetUp()
        {
            StructureMapBootstrapper.Execute();
            _repo = ServiceLocator.Current.GetInstance<IIncomingDocumentsRepository>();

            IEnumerable<DocumentInDTO> isaList = get_doc_list();
            isaList.ForEach(_repo.Save);
            _firstDoc = _repo.GetByISAControlNumberAndPartnerID(1001, BusinessPartner.Initech.Number);
        }
        public void can_save_record()
        {
            var doc = new DocumentInDTO
                          {
                              ISAControlNumber = 332433,
                              ControlNumber = 253,
                              DateSent = DateTime.Today,
                              GroupID = "PO",
                              ID = new Guid(),
                              DocumentID = 850,
                              ERPID = "legacy",
                              PartnerNumber = BusinessPartner.Initech.Number
                          };

            _incomingDocumentsRepository.Save(doc);
        }
 private static DocumentInDTO get_save_info()
 {
     var doc = new DocumentInDTO
                   {
                       ISAControlNumber = 234,
                       ControlNumber = 23443,
                       DateSent = DateTime.Today,
                       PartnerNumber = BusinessPartner.Initech.Number
                   };
     doc.AddResponseElement("19", "23432", "19");
     return doc;
 }
        private static IEnumerable<DocumentInDTO> get_save_info()
        {
            var doc1 = new DocumentInDTO
            {
                ISAControlNumber = 234,
                ControlNumber = 60001,
                DateSent = DateTime.Today,
                PartnerNumber = BusinessPartner.Initech.Number
            };
            doc1.AddResponseElement("19", "23432", "19");
            doc1.AddResponseElement("REF02", "CAD36", "ZZ");
            doc1.AddResponseElement("REF02", "001", "19");
            doc1.AddResponseElement("REF02", "3", "XE");
            doc1.AddLineItem("1", get_element_list());

            var doc2 = new DocumentInDTO
            {
                ControlNumber = 23443,
                ISAControlNumber = 234,
                DateSent = DateTime.Today,
                PartnerNumber = 1004
            };
            doc2.AddResponseElement("REF02", "23432", "ZZ");
            doc2.AddLineItem("1", get_element_list());

            return new List<DocumentInDTO> {doc1, doc2};
        }
 private static DocumentInDTO get_save_info()
 {
     var doc = new DocumentInDTO
                   {
                       ControlNumber = 23444,
                       ISAControlNumber = 2300,
                       DateSent = DateTime.Today,
                       PartnerNumber = BusinessPartner.MicroCenter.Number
                   };
     doc.AddResponseElement("REF02", "23444", "ZZ");
     doc.AddLineItem("1", get_element_list());
     return doc;
 }
 public void Save(DocumentInDTO isa)
 {
     base.Save(isa);
       //  isa.Documents.ForEach(save_document);
 }
 public void Delete(DocumentInDTO doc)
 {
     base.Delete(doc);
 }
        private static DocumentInDTO get_save_info()
        {
            var doc = new DocumentInDTO
                          {
                              ISAControlNumber = 234,
                              ControlNumber = 23443,
                              DateSent = DateTime.Today,
                              PartnerNumber = BusinessPartner.Initech.Number,

                          };
            doc.AddResponseElement("REF02", "23432", "ZZ");
            doc.AddLineItem("1", get_element_list());
            doc.AddLineItem("2", get_element_list());
            return doc;
        }
 private static DocumentInDTO get_save_info()
 {
     var doc = new DocumentInDTO
                   {
                       ISAControlNumber = 234,
                       ControlNumber = 60001,
                       DateSent = DateTime.Today,
                       PartnerNumber = BusinessPartner.MicroCenter.Number
                   };
     doc.AddResponseElement("19", "23432", "19");
     doc.AddResponseElement("REF02", "CAD36", "ZZ");
     doc.AddResponseElement("REF02", "001", "19");
     doc.AddResponseElement("REF02", "3", "XE");
     doc.AddLineItem("1", get_element_list());
     return doc;
 }