internal static Segment SetUNA(string componentDataElementSeparator, string dataElementSeparator, string decimalNotation, string releaseIndicator, string reservedForFutureUse, string segmentTerminator) { var una = new UNA(componentDataElementSeparator, dataElementSeparator, decimalNotation, releaseIndicator, reservedForFutureUse, segmentTerminator); return(una); }
/// <summary> /// Creates UNA segment. /// </summary> /// <returns>The separators.</returns> public UNA ToUna() { var result = new UNA { ComponentDataElement = ComponentDataElement, DataElement = DataElement, DecimalNotation = '.', ReleaseIndicator = Escape ?? '?', Reserved = ' ', Segment = Segment }; return(result); }
public static string Generate(List <EdiItem> items, Separators separators, string postFix, Encoding encoding = null, UNA una = null) { using (var stream = new MemoryStream()) { var writer = new EdifactWriter(stream, encoding, postFix); if (una != null) { writer.Write(una); } foreach (var item in items) { var message = item as EdiMessage; if (message != null) { writer.Write(message); continue; } var gs = item as UNG; if (gs != null) { writer.Write(gs); continue; } var ge = item as UNE; if (ge != null) { continue; } var unb = item as UNB; if (unb != null) { writer.Write(unb, separators); } } writer.Flush(); return(CommonHelper.LoadString(stream)); } }
/// <summary> /// Write UNA to the destination. /// </summary> /// <param name="ediSegment">The UNA.</param> public void Write(UNA ediSegment) { Write(ediSegment.GenerateSegment()); }