示例#1
0
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Write EDI to stream and then to string or file
            WriteHL7ToStream.Run();
            WriteHL7ToStreamAsync.Run();

            //  Write EDI directly to file
            WriteHL7ToFile.Run();

            //  Write EDI with custom delimiters (this includes all delimiters set in ISA)
            WriteHL7WithCustomDelimiters.Run();

            //  Write EDI with postfix (such as new line) after each segment
            //WriteHL7WithNewLines.Run();

            //  Write batches
            WriteHL7Batch.Run1();
            WriteHL7Batch.Run2();
            WriteHL7BHSBatch.Run();
            WriteHL7FHSBatch.Run();

            //  Retain trailing data element delimiters for empty data elements
            WriteHL7WithEmptyDataElements.Run();
        }
示例#2
0
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Read NCPDP file to the end
            ReadNCPDPFileToEnd.Run();
            ReadNCPDPFileToEndAsync.Run();

            //  Read one item at a time
            ReadNCPDPFileStreaming.Run();
            ReadNCPDPFileStreamingAsync.Run();

            //  Read using partner-specific template (inherited)
            ReadNCPDPFileWithInheritedTemplate.Run();

            //  Read using dynamic template resolution
            ReadNCPDPFileWithTemplateResolution.RunWithAssemblyFactory();
            ReadNCPDPFileWithTemplateResolution.RunWithTypeFactory();

            //  Read NCPDP file with corrupt transmission header
            ReadNCPDPFileCorrupt.Run();

            //  Read NCPDP file with corrupt G1
            ReadNCPDPFileCorrupt.Run2();

            //  Split transactions to repeating loops
            ReadNCPDPFileSplitting.Run();

            //  Read NCPDP file with batches of B1 and RESPONSE
            ReadNCPDPFileToEndWithResponse.Run();
        }
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Validate custom EDI codes
            ValidateCustomEDICodes.Run();
            ValidateCustomEDICodes.Run2();

            //  Validate transactions after reading
            ValidateEDITransationsAfterRead.Run();

            //  Validate transactions before writing them out
            ValidateEDITransationsBeforeWrite.Run();

            //  Validate transactions with custom code
            ValidateEDITransationsWithCustomCode.Run();

            //  Validate data element alpha and alphanumeric data types
            ValidateDataElementTypes.Unoa();
            ValidateDataElementTypes.Unob();

            //  Validate control segments, UNB and UNG
            ValidateUNBorUNG.Run();

            //  Validate sample transactions
            ValidateINVOIC.Run();
            ValidateORDERS.Run();

            //  Validate async
            ValidateEDITransationsAsync.Run();
        }
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Read EDI file to the end
            ReadEDIFileToEnd.Run();
            ReadEDIFileToEndAsync.Run();

            //  Read one item at a time
            ReadEDIFileStreaming.Run();
            ReadEDIFileStreamingAsync.Run();

            //  Read batches of transactions
            ReadEDIFileBatch.Run();

            //  Split transactions to repeating loops
            ReadEDIFileSplitting.Run();
            ReadEDIFileSplitting.RunWithCopy();

            //  Read EDI files with issues
            ReadEDIFileCorrupt.Run();
            ReadEDIFileWithErrors.Run();

            //  Read transaction only
            ReadEDIFileTransactionOnly.Run();

            //  Read using partner-specific template (inherited)
            ReadEDIFileWithInheritedTemplate.Run();

            //  Read using dynamic template resolution
            ReadEDIFileWithTemplateResolution.RunWithAssemblyFactory();
            ReadEDIFileWithTemplateResolution.RunWithTypeFactory();
        }
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Write EDI to stream and then to string or file
            WriteEDIToStream.Run();
            WriteEDIToStreamAsync.Run();

            //  Write EDI directly to file
            WriteEDIToFile.Run();

            //  Write EDI with custom delimiters (this includes all delimiters set in ISA)
            WriteEDIWithCustomDelimiters.Run();

            //  Write EDI with postfix (such as new line) after each segment
            WriteEDIWithNewLines.Run();

            //  Write batches
            WriteEDITransactionBatch.Run();
            WriteEDIGroupBatch.Run();
            WriteEDIInterchangeBatch.Run();

            //  Retain trailing data element delimiters for empty data elements
            WriteEDIWithEmptyDataElements.Run();

            //  Write transaction only
            WriteEDITransactionOnly.Run();

            //  Turn auto-trailers off
            WriteEDIWithoutAutoTrailers.Run();
        }
示例#6
0
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Validate custom EDI codes
            //ValidateCustomEDICodes.Run();
            //ValidateCustomEDICodes.Run2();

            //  Validate transactions after reading
            ValidateEDITransationsAfterRead.Run();

            //  Validate transactions before writing them out
            ValidateEDITransationsBeforeWrite.Run();

            //  Validate transactions with custom code
            ValidateEDITransationsWithCustomCode.Run();

            //  Validate data element alpha and alphanumeric data types
            ValidateDataElementTypes.Basic();
            ValidateDataElementTypes.Extended();

            //  Validate control segments, ISA and GS
            ValidateISAorGS.Run();

            //  Validate sample transactions
            Validate810.Run();
            Validate850.Run();
            Validate837P.Run();

            //  Validate async
            ValidateEDITransationsAsync.Run();
        }
示例#7
0
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Write NCPDP to stream and then to string or file
            WriteNCPDPToStream.Run();
            WriteNCPDPToStreamAsync.Run();

            //  Write NCPDP directly to file
            WriteNCPDPToFile.Run();

            //  Write NCPDP with custom delimiters
            WriteNCPDPWithCustomDelimiters.Run();

            //  Write NCPDP with postfix (such as new line) after each segment
            WriteNCPDPWithNewLines.Run();

            //  Write batches
            WriteNCPDPBatch.Run1();
            WriteNCPDPBatch.Run2();

            //  Retain trailing data element delimiters for empty data elements
            WriteNCPDPWithEmptyDataElements.Run();

            //  Write transaction only
            WriteNCPDPTransactionOnly.Run();

            //  Turn auto-trailers off
            WriteNCPDPWithoutAutoTrailers.Run();
        }
示例#8
0
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Validate custom NCPDP codes
            ValidateCustomNCPDPCodes.Run();
            ValidateCustomNCPDPCodes.Run2();

            //  Validate transactions
            ValidateNCPDPTransations.Run();

            //  Validate transactions with custom code
            ValidateNCPDPTransationsWithCustomCode.Run();

            //  Validate data element alpha and alphanumeric data types
            ValidateDataElementTypes.Unoa();
            ValidateDataElementTypes.Unob();

            //  Validate control segment TransmissionHeader
            ValidateUIB.Run();

            //  Validate async
            ValidateNCPDPTransationsAsync.Run();

            //  Validate before writing
            ValidateEDITransationsBeforeWrite.Run();
        }
示例#9
0
        protected void SaveButton_Click(object sender, EventArgs e)
        {
            ErrorMessagePanel.Visible = false;
            if (Page.IsValid)
            {
                string inputData = SerialKeyData.Text;
                string delimiter;
                switch (KeyDelimiter.SelectedIndex)
                {
                case 2: delimiter = ","; break;

                case 1: delimiter = "\r\n\r\n"; break;

                default: delimiter = "\r\n"; break;
                }
                string[] delimiterArray = { delimiter };
                string[] keys           = inputData.Split(delimiterArray, StringSplitOptions.RemoveEmptyEntries);

                List <string> duplicateKeys = new List <string>();
                string        key;
                bool          added = false;
                foreach (string tkey in keys)
                {
                    key = tkey.Trim();
                    if (_DigitalGood.HasSerialKey(key))
                    {
                        duplicateKeys.Add(key);
                    }
                    else
                    {
                        SerialKey skey = new SerialKey();
                        skey.SerialKeyData = key;
                        skey.DigitalGoodId = _DigitalGood.Id;
                        _DigitalGood.SerialKeys.Add(skey);
                        added = true;
                    }
                }
                if (added)
                {
                    _DigitalGood.SerialKeys.Save();
                }
                if (duplicateKeys.Count == 0)
                {
                    // redirect to configure page
                    CancelButton_Click(sender, e);
                }
                else
                {
                    //show error messages regarding duplicate keys
                    ErrorMessageList.Items.Clear();
                    ErrorMessagePanel.Visible = true;
                    foreach (string skey in duplicateKeys)
                    {
                        ListItem item = new ListItem(skey);
                        ErrorMessageList.Items.Add(item);
                    }
                }
            }
        }
示例#10
0
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            ReadVDA.Run();
            ReadVDABatch.Run();
            ReadVDAAsync.Run();
        }
 static void Main(string[] args)
 {
     SerialKey.Set(Common.SerialKey.Get());
     Read();
     Write();
     EVVExample.Read();
     EVVExample.Write();
 }
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Export to custom CSV
            ExportToCsv.Run();

            //  Import from custom CSV
            ImportFromCsv.Run();
        }
示例#13
0
        private void frmRegister_Load(object sender, EventArgs e)
        {
            string cpuInfo = string.Empty;

            cpuInfo = SerialKey.RetrieveIDMachine();

            tbIDMachine.Text      = cpuInfo;
            tbUsername.Text       = ClassHelper.userName;
            ClassHelper.idMachine = cpuInfo;
        }
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Map using XSLT
            EDIToCustomObjectWithXslt.Run();

            //  Map using AutoMapper
            EDIToCustomObjectWithAutoMapper.Run();
        }
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Serialize to JSON
            SerializeToJson.Run();

            //  Deserialize from JSON
            DeserializeFromJson.Run();
        }
示例#16
0
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            // Parse 850
            ParsePO(@"\..\..\..\Files\X12\PurchaseOrder.txt");

            //  Parse modified 850
            ParseModifiedPO(@"\..\..\..\Files\X12\PurchaseOrderModified.txt");
        }
示例#17
0
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            // Parse ORDERS
            ParsePO(@"\..\..\..\Files\EDIFACT\PurchaseOrder.txt");

            //  Parse modified ORDERS
            ParseModifiedPO(@"\..\..\..\Files\EDIFACT\PurchaseOrderModified.txt");
        }
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Save purchase order to DB. This will automatically create a DB structure for the full D96A version the first time it is executed.
            //  NOTE: edit the connection string in app.config, by default it looks for a local SQL Server instance
            SaveToDb.Run();

            //  Pull the latest purchase order from the DB
            PullFromDb.Run();
        }
示例#19
0
 //Initializes objects, generates keys and adds to listview
 private void Initialize()
 {
     userdataList     = new List <UserData>();
     serial           = new SerialKey();
     data             = new DataPersistance();
     validate         = new ValidateUserData();
     adminList        = new List <Admin>();
     usedKeysList     = new List <String>();
     popup            = new Popup();
     loginSuccesfully = false;
 }
示例#20
0
 private string GetKey()
 {
     while (true)
     {
         string key = SerialKey.Generate().ToUpper();
         if (!_context.Licenses.Any(l => l.Key == key))
         {
             return(key);
         }
     }
 }
示例#21
0
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Serialize to XML
            SerializeToXml.WithXmlSerializer();
            SerializeToXml.WithDataContractSerializer();

            //  Deserialize from XML
            DeserializeFromXml.WithXmlSerializer();
            DeserializeFromXml.WithDataContractSerializer();
        }
示例#22
0
        static void Main(string[] args)
        {
            //  Translator Demo

            //  Supported versions/transactions are:
            //  NCPDP Telecommunications D.0, all classes that begin with TS in namespace EdiFabric.Templates.Ncpdp

            //  If you need a different NCPDP version or transaction, please contact us at https://support.edifabric.com/hc/en-us/requests/new, EdiFabric supports all versions and transactions for NCPDP.

            SerialKey.Set(Common.SerialKey.Get());

            Translate_NCPDP_D0();
        }
示例#23
0
        static void Main(string[] args)
        {
            //  Translator Demo

            //  Supported versions/transactions are:
            //  HL7 2.6, all classes that begin with TS in namespace EdiFabric.Templates.HL726

            //  If you need a different HL7 version or transaction, please contact us at https://support.edifabric.com/hc/en-us/requests/new, EdiFabric supports all versions and transactions for HL7.

            SerialKey.Set(Common.SerialKey.Get());

            Translate_HL7_26();
        }
示例#24
0
        public static void Initialize(ApplicationDbContext _context)
        {
            _context.Database.EnsureCreated();

            KeyGeneration generateKeys = new KeyGeneration();
            var           keyCodes     = new List <string>();
            var           serialKeys   = new SerialKey[99];

            if (!_context.SerialKey.Any())
            {
                keyCodes = generateKeys.KeyGenerator();

                foreach (string s in keyCodes)
                {
                    serialKeys = new SerialKey[]
                    {
                        new SerialKey {
                            KeyCode = s
                        }
                    };

                    foreach (SerialKey serial in serialKeys)
                    {
                        _context.SerialKey.Add(serial);
                    }
                    _context.SaveChanges();
                }
            }


            //if (!context.Form.Any())
            //{
            //    var forms = new Form[]
            //    {
            //        new Form{FirstName = "Karl", Lastname = "Johan", DateOfBirth = "02-03-1994", EmailAddress = "*****@*****.**", ProductSerialNumber = "eb627b18-ffcd-4244-8ddd-f1c3deb7de0d"},
            //        new Form{FirstName = "Maja", Lastname = "Hansen", DateOfBirth = "03-05-1990", EmailAddress = "*****@*****.**", ProductSerialNumber = "2a98c93f-a64a-45a8-85b1-a019d516082d"},
            //        new Form{FirstName = "Hans", Lastname = "Madsen", DateOfBirth = "20-07-1993", EmailAddress = "*****@*****.**", ProductSerialNumber = "eb627b18-ffcd-4244-8ddd-f1c3deb7de0d"},
            //        new Form{FirstName = "Kaya", Lastname = "Kul", DateOfBirth = "26-09-1980", EmailAddress = "*****@*****.**", ProductSerialNumber = "eed0d2a7-6697-459d-aa61-885cc58e2fcf"},
            //        new Form{FirstName = "Mikkel", Lastname = "Sermon", DateOfBirth = "27-10-1995", EmailAddress = "*****@*****.**", ProductSerialNumber = "a249ed54-99fe-4a7f-8b52-83fddff4340c"},
            //        new Form{FirstName = "Benjamin", Lastname = "Lundgren", DateOfBirth = "15-09-1997", EmailAddress = "*****@*****.**", ProductSerialNumber = "da8d5938-658d-4eeb-8885-421f71712412"},
            //    };

            //    foreach (Form f in forms)
            //    {
            //        context.Form.Add(f);
            //    }
            //    context.SaveChanges();
            //}
        }
        static void Main(string[] args)
        {
            //  Translator Demo

            //  Supported versions/transactions are:
            //  X12 004010, all classes that begin with TS in namespace EdiFabric.Templates.X12004010
            //  HIPAA 005010, all classes that begin with TS in namespace EdiFabric.Templates.Hipaa5010

            //  If you need a different X12 version or transaction, please contact us at https://support.edifabric.com/hc/en-us/requests/new, EdiFabric supports all versions and transactions for X12/HIPAA.

            SerialKey.Set(Common.SerialKey.Get());

            Translate_HIPAA_5010();
            Translate_X12_4010();
        }
示例#26
0
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Write EDI to stream and then to string or file
            WriteNCPDPToStream.Run();
            WriteNCPDPToStreamAsync.Run();

            //  Write EDI directly to file
            WriteNCPDPToFile.Run();

            //  Write batches
            WriteNCPDPBatch.Run1();
            WriteNCPDPBatch.Run2();
        }
示例#27
0
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Read HL7 file to the end
            ReadHL7FileToEnd.Run();
            ReadHL7FileToEndAsync.Run();

            //  Read one item at a time
            ReadHL7FileStreaming.Run();
            ReadHL7FileStreamingAsync.Run();

            //  Read batches of transactions
            ReadHL7FileBatch.Run();

            //  Split transactions to repeating loops
            ReadHL7FileSplitting.Run();
            ReadHL7FileSplitting.RunWithCopy();

            //  Read HL7 files with issues
            ReadHL7FileCorrupt.Run();

            //  Read using partner-specific template (inherited)
            ReadHL7FileWithInheritedTemplate.Run();

            //  Read using dynamic template resolution
            ReadHL7FileWithTemplateResolution.RunWithAssemblyFactory();
            ReadHL7FileWithTemplateResolution.RunWithTypeFactory();

            //  Read file with ADD segments
            ReadHL7FileWithADD.Run();

            //  Read file with unlimited number of repeating data element in the last position
            ReadHL7FileWithQPD.Run();

            //  Read file with continuation started
            ReadHL7FileWithDSC.Run();

            //  Read file with continuation to a DSC
            //  Placeholder segment HXX is not parsed or validated
            ReadHL7FileWithADDandDSC.Run();

            //  Read file with escaped delimiters
            ReadHL7FileWithEscapedDelimiters.Run();

            //  Read with custom FHS or BHS
            ReadHL7FileWithCustomFHSorBHS.Run();
        }
        static void Main(string[] args)
        {
            //  Translator Demo

            //  Supported versions/transactions are:
            //  EDIFACT D96A, all classes that begin with TS in namespace EdiFabric.Templates.EdifactD96A
            //  Custom CUSCAR and PAXLST version EDIFACT D03B for US Customs, the classes are TSCUSCAR and TSPAXLST in namespace EdiFabric.Templates.EdifactD03B
            //  Custom BAPLIE version EDIFACT D13B for SMDG, the class is TSBAPLIE in namespace EdiFabric.Templates.EdifactD13B
            //  INVOIC EANCOM D01B Syntax 3, the class is TSINVOIC in namespace EdiFabric.Templates.EancomD01B

            //  If you need a different EDIFACT/EANCOM version or transaction, please contact us at https://support.edifabric.com/hc/en-us/requests/new, EdiFabric supports all versions and transaction for EDIFACT/EANCOM.

            SerialKey.Set(Common.SerialKey.Get());

            //  Change the path to point to your own file to test with
            var path = File.OpenRead(Directory.GetCurrentDirectory() + @"\..\..\..\Files\Edifact\PurchaseOrders.txt");

            List <IEdiItem> ediItems;

            using (var reader = new EdifactReader(path, "EdiFabric.Templates.Edifact", new EdifactReaderSettings {
                ContinueOnError = true
            }))
                ediItems = reader.ReadToEnd().ToList();

            foreach (var message in ediItems.OfType <EdiMessage>())
            {
                if (!message.HasErrors)
                {
                    //  Message was successfully parsed

                    MessageErrorContext mec;
                    if (message.IsValid(out mec))
                    {
                        //  Message was successfully validated
                    }
                    else
                    {
                        //  Message failed validation with the following validation issues:
                        var validationIssues = mec.Flatten();
                    }
                }
                else
                {
                    //  Message was partially parsed with errors
                }
            }
        }   //  Add a breakpoint here, run in debug mode and inspect ediItems
示例#29
0
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());

            //  Generate CONTRL for valid group
            GenerateValidCONTRL.Run();

            //  Generate CONTRL for invalid group
            GenerateInvalidCONTRL.Run();

            //  Generate CONTRL for duplicates
            GenerateCONTRLForDuplicateTransaction.Run();
            GenerateCONTRLForDuplicateGroup.Run();
            GenerateCONTRLForDuplicateInterchange.Run();

            //  Generate CONTRL with explicit control numbers
            GenerateCONTRLWithCustomControlNumbers.Run();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _CategoryId          = AbleCommerce.Code.PageHelper.GetCategoryId();
            _ProductId           = AlwaysConvert.ToInt(Request.QueryString["ProductId"]);
            _DigitalGoodId       = AlwaysConvert.ToInt(Request.QueryString["DigitalGoodId"]);
            _DigitalGood         = DigitalGoodDataSource.Load(_DigitalGoodId);
            _SerialKeyProviderId = Misc.GetClassId(typeof(DefaultSerialKeyProvider));

            if (_DigitalGood == null)
            {
                if (_ProductId > 0)
                {
                    Response.Redirect("~/Admin/Products/EditProduct.aspx?CategoryId=" + _CategoryId.ToString()
                                      + "&ProductId=" + _ProductId.ToString() + "&DigitalGoodId=" + _DigitalGoodId.ToString());
                }
                else
                {
                    Response.Redirect("~/Admin/DigitalGoods/EditDigitalGood.aspx?DigitalGoodId=" + _DigitalGoodId.ToString());
                }
            }

            _SerialKeyId = AlwaysConvert.ToInt(Request.QueryString["SerialKeyId"]);
            _SerialKey   = SerialKeyDataSource.Load(_SerialKeyId);

            if (_SerialKey == null)
            {
                if (_ProductId > 0)
                {
                    Response.Redirect("~/Admin/Products/EditProduct.aspx?CategoryId=" + _CategoryId.ToString()
                                      + "&ProductId=" + _ProductId.ToString() + "&DigitalGoodId=" + _DigitalGoodId.ToString());
                }
                else
                {
                    Response.Redirect("~/Admin/DigitalGoods/EditDigitalGood.aspx?DigitalGoodId=" + _DigitalGoodId.ToString());
                }
            }

            Caption.Text = string.Format(Caption.Text, _DigitalGood.Name);

            if (!Page.IsPostBack)
            {
                InitializeForm();
            }
        }