public void ReadObjectTestNewReader() { var pos1 = new EdiBuilderTests.ApplicationInvoicePosition { Counter = 1, Name = "Verkaufsprovisionen", Total = 119, TotalNet = 100, TotalTax = 19 }; var pos2 = new EdiBuilderTests.ApplicationInvoicePosition { Counter = 2, Name = "Monatspauschalen", Total = 119, TotalNet = 100, TotalTax = 19 }; var appInv = new EdiBuilderTests.ApplicationInvoice { ApplicationAccountingNumber = "1113", ApplicationCity = "Rostock", ApplicationCountryCode = "DE", ApplicationIdentifier = "4a78baa6-39b8-4632-835b-4ff44ada56fa", ApplicationName = "colour and more", ApplicationPostalCode = "18055", ApplicationStreet = "Kröpeliner Str. 26", InvoiceDate = "200325", InvoiceDate2 = "20200325", InvoiceNumber = "20000", InvoiceNumber2 = null, InvoiceTime = "0000", }; appInv.Positions.Add(pos1); appInv.Positions.Add(pos2); var reader = new EdiObjectReader(); reader.Read(appInv); var result = reader.GetSegmentGroup(25); }
public void ReadD96ADocument() { var xmlDoc = new XmlDocument(); byte[] b = Encoding.UTF8.GetBytes(TestxmlD96A); using (var s = new MemoryStream(b)) { xmlDoc.Load(s); } if (xmlDoc.DocumentElement == null) { return; } var pos1 = new ApplicationInvoicePosition { Counter = 1, Name = "Verkaufsprovisionen", Total = 119, TotalNet = 100, TotalTax = 19 }; var pos2 = new ApplicationInvoicePosition { Counter = 2, Name = "Monatspauschalen", Total = 119, TotalNet = 100, TotalTax = 19 }; var appInv = new ApplicationInvoice { ApplicationAccountingNumber = "1113", ApplicationCity = "Rostock", ApplicationCountryCode = "DE", ApplicationIdentifier = "4a78baa6-39b8-4632-835b-4ff44ada56fa", ApplicationName = "colour and more", ApplicationPostalCode = "18055", ApplicationStreet = "Kröpeliner Str. 26", InvoiceDate = "200325", InvoiceDate2 = "20200325", InvoiceNumber = "20000", InvoiceNumber2 = null, InvoiceTime = "0000", }; appInv.Positions.Add(pos1); appInv.Positions.Add(pos2); //var reader = new EdiObjectReader(); //var docBuilder = new EdiDocumentBuilder(reader); var reader = new EdiObjectReader(); var docBuilder = new EdiDocumentBuilder(reader); var ediDocument = docBuilder.Create(xmlDoc, appInv); var docString = ediDocument.ToString(); File.WriteAllText("ediTest.txt", docString); }