/// <summary> /// Batch multiple transmissions in the same stream. /// </summary> public static void Run2() { Debug.WriteLine("******************************"); Debug.WriteLine(MethodBase.GetCurrentMethod().Name); Debug.WriteLine("******************************"); using (var stream = new MemoryStream()) { using (var writer = new NcpdpTelcoWriter(stream)) { // Write transmission header 1 writer.Write(SegmentBuilders.BuildTransmissionHeader("1")); // Write the claim writer.Write(SegmentBuilders.BuildClaim("1")); // Write transmission header 2 writer.Write(SegmentBuilders.BuildTransmissionHeader("1")); // Write the claim writer.Write(SegmentBuilders.BuildClaim("2")); //... } Debug.Write(stream.LoadToString()); } }
/// <summary> /// Generate and write NCPDP document to a file /// </summary> public static void Run() { Debug.WriteLine("******************************"); Debug.WriteLine(MethodBase.GetCurrentMethod().Name); Debug.WriteLine("******************************"); using (var writer = new NcpdpTelcoWriter(@"C:\Test\Output.txt", false)) { // Write the transmission header writer.Write(SegmentBuilders.BuildTransmissionHeader()); // Write the claim writer.Write(SegmentBuilders.BuildClaim()); } }