Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (33 sloc) 1.13 KB
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using EdiFabric.Examples.X12.Common;
using EdiFabric.Examples.X12.Templates.V4010;
using EdiFabric.Framework.Writers;
namespace EdiFabric.Examples.X12.WriteEDI
{
class WriteEDIWithNewLines
{
/// <summary>
/// Write with segment postfix.
/// </summary>
public static void Run()
{
Debug.WriteLine("******************************");
Debug.WriteLine(MethodBase.GetCurrentMethod().Name);
Debug.WriteLine("******************************");
var invoice = EF_X12_004010_810_Builder.BuildInvoice("1");
using (var stream = new MemoryStream())
{
using (var writer = new X12Writer(stream, new X12WriterSettings() { Postfix = Environment.NewLine }))
{
writer.Write(SegmentBuilders.BuildIsa("1"));
writer.Write(SegmentBuilders.BuildGs("1"));
writer.Write(invoice);
}
Debug.Write(stream.LoadToString());
}
}
}
}
You can’t perform that action at this time.