Esempio n. 1
0
        public void Transform270ToHtml()
        {
            var htmlService = new X12HtmlTransformationService(new X12EdiParsingService(suppressComments: false));

            Stream ediFile = new MemoryStream(Encoding.ASCII.GetBytes(inquiry));

            string html = htmlService.Transform(new StreamReader(ediFile).ReadToEnd());

            Trace.Write(html);
        }
        public void ParseToHtml(
            [ValueSource(typeof(ResourcePathManager), nameof(ResourcePathManager.ResourcePaths))]
            string resourcePath)
        {
            // arrange
            Stream stream = GetEdi(resourcePath);

            if (!resourcePath.Contains("MultipleInterchanges"))
            {
                var service = new X12HtmlTransformationService(new X12EdiParsingService(false));

                // act - assert
                string html = service.Transform(new StreamReader(stream).ReadToEnd());
            }
        }
        public void ParseToHtml()
        {
            string resourcePath = Convert.ToString(TestContext.DataRow["ResourcePath"]);

            Trace.WriteLine(resourcePath);
            Stream stream = GetEdi(resourcePath);

            if (!resourcePath.Contains("MultipleInterchanges"))
            {
                var    service = new X12HtmlTransformationService(new X12EdiParsingService(false));
                string html    = service.Transform(new StreamReader(stream).ReadToEnd());

                Trace.Write(html);
#if DEBUG
                new FileStream(resourcePath.Replace(".txt", ".htm"), FileMode.Create).PrintHtmlToFile(html);
#endif
            }
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                Console.WriteLine("Usage: TransformToHTML <Filename.edi> <Filename.html>");
                return;
            }
            string mydoc = args[0];

            if (!File.Exists(mydoc))
            {
                Console.WriteLine("Source File " + mydoc + " not found... ");
                return;
            }

            var htmlService = new X12HtmlTransformationService(new X12EdiParsingService(suppressComments: false));

            Stream ediFile = new FileStream(mydoc, FileMode.Open, FileAccess.Read);

            string html = htmlService.Transform(new StreamReader(ediFile).ReadToEnd());

            string extension = Path.GetExtension(mydoc);
            string htmlfile  = mydoc.Replace(extension, ".html");

            using (StreamWriter outputFile = new StreamWriter(htmlfile))
            {
                outputFile.WriteLine(html);
            }
            if (File.Exists(htmlfile))
            {
                Console.WriteLine("File: " + htmlfile + " created");
            }
            else
            {
                Console.WriteLine("File: " + htmlfile + " was not created");
            }
        }
Esempio n. 5
0
        public string X12Tohtml(string x12)
        {
            var htmlService = new X12HtmlTransformationService(new X12EdiParsingService(Properties.Settings.Default.SurppressParsingComments, new x12Test.specFinder()));

            return(htmlService.Transform(x12));
        }