Ejemplo n.º 1
0
        public void generateBarCodeTest1()
        {
            IModulo modulo  = new Modulo10_Luhn();
            string  barCode = BarCodesHelpers.GenerateCode("a7e5f55e1dbb48b799268e1a6d8618a3", "12345678", Convert.ToDateTime("2015-08-15 10:13:32"), modulo);

            StringAssert.AreEqualIgnoringCase(barCode, "223175087923687075112234402528973166755123456781508151013327");
        }
Ejemplo n.º 2
0
        public void generateBarCodeTest2()
        {
            IModulo modulo  = new Modulo10_Easy();
            string  barCode = BarCodesHelpers.GenerateCode("1234567890abcdef", "24578436", Convert.ToDateTime("2017-01-11 18:00:32"), modulo);

            StringAssert.AreEqualIgnoringCase(barCode, "000000000000000000001311768467294899695245784361701111800329");
        }
Ejemplo n.º 3
0
        private BarCodes(XmlDocument invoice)
        {
            // People at FURS say that modulo is just easy modulo 10 and not luhn!
            IModulo modulo = new Modulo10_Easy();

            this.invoice = invoice;

            XmlNode protectedIDNode = XmlHelperFunctions.GetSubNode(invoice.DocumentElement, "fu:ProtectedID");
            XmlNode taxNumberNode   = XmlHelperFunctions.GetSubNode(invoice.DocumentElement, "fu:TaxNumber");
            XmlNode timeStampNode   = XmlHelperFunctions.GetSubNode(invoice.DocumentElement, "fu:IssueDateTime");

            if ((protectedIDNode == null) || (taxNumberNode == null) || (timeStampNode == null))
            {
                this.BarCodeValue = string.Empty;
            }
            else
            {
                this.BarCodeValue = BarCodesHelpers.GenerateCode(protectedIDNode.InnerText, taxNumberNode.InnerText, Convert.ToDateTime(timeStampNode.InnerText), modulo);
            }
        }
Ejemplo n.º 4
0
        private BarCodes(string protectedIDHex, string taxNumber, DateTime timeStamp)
        {
            IModulo modulo = new Modulo10_Easy();

            this.BarCodeValue = BarCodesHelpers.GenerateCode(protectedIDHex, taxNumber, timeStamp, modulo);
        }