Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        /// <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);
        }
Esempio n. 3
0
        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));
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Write UNA to the destination.
 /// </summary>
 /// <param name="ediSegment">The UNA.</param>
 public void Write(UNA ediSegment)
 {
     Write(ediSegment.GenerateSegment());
 }