Exemple #1
0
        public void UpdateIdentification(ALIdentification aId)
        {
            nr.Text             = aId.DocumentNumber;
            surname.Text        = aId.SurNames;
            givenNames.Text     = aId.GivenNames;
            code.Text           = aId.NationalityCountryCode;
            type.Text           = aId.DocumentType;
            dayOfBirth.Text     = GetDateStringFromObject(aId.DayOfBirthDateObject, aId.DayOfBirth);
            expirationDate.Text = GetDateStringFromObject(aId.ExpirationDateObject, aId.ExpirationDate);
            sex.Text            = aId.Sex;

            var mrzString   = aId.MRZString.Replace("\\n", "\n");
            var splitString = mrzString.Split('\n');

            if (splitString.Length == 2)
            {
                line0.Text = splitString[0];
                line1.Text = "";
                line2.Text = splitString[1];
            }
            else if (splitString.Length == 3)
            {
                line0.Text = splitString[0];
                line1.Text = splitString[1];
                line2.Text = splitString[2];
            }
            else
            {
                return;
            }
        }
        /*
         * This is the main delegate method Anyline uses to report its results
         */
        public void DidFindScanResult(AnylineMRZModuleView anylineMRZModuleView, ALIdentification scanResult, bool allCheckDigitsValid, UIImage image)
        {
            // Because there is a lot of information to be passed along the module
            // uses ALIdentification.
            idView.UpdateIdentification(scanResult);

            // Present the information to the user
            AnimateFadeIn();
        }
        public void UpdateIdentification(ALIdentification aId)
        {
            nr.Text             = aId.DocumentNumber;
            surname.Text        = aId.SurNames;
            givenNames.Text     = aId.GivenNames;
            code.Text           = aId.NationalityCountryCode;
            type.Text           = aId.DocumentType;
            dayOfBirth.Text     = aId.DayOfBirth;
            expirationDate.Text = aId.ExpirationDate;
            sex.Text            = aId.Sex;

            if (aId.DocumentType.Equals(@"P"))
            {
                line0.Text = String.Format("{0,-44}",
                                           String.Format("P<{0}{1}<<{2}", aId.NationalityCountryCode, aId.SurNames, aId.GivenNames)
                                           ).Replace(" ", "<");

                line1.Text = "";

                line2.Text = String.Format("{0,-42}{1,1}{2,1}", String.Format("{0,-9}{1}{2}{3}{4}{5}{6}{7}{8}",
                                                                              aId.DocumentNumber, aId.CheckdigitNumber,
                                                                              aId.IssuingCountryCode,
                                                                              aId.DayOfBirth, aId.CheckdigitDayOfBirth,
                                                                              aId.Sex,
                                                                              aId.ExpirationDate, aId.CheckdigitExpirationDate,
                                                                              aId.PersonalNumber),
                                           aId.CheckDigitPersonalNumber, aId.CheckdigitFinal)
                             .Replace(" ", "<");
            }
            else
            {
                line0.Text = String.Format("{0,-30}\n", String.Format("{0}{1,-3}{2,-9}{3}",
                                                                      aId.DocumentType, aId.NationalityCountryCode,
                                                                      aId.DocumentNumber, aId.CheckdigitNumber))
                             .Replace(" ", "<");

                line1.Text = String.Format("{0,-29}{1,1}\n", String.Format("{0}{1}{2}{3}{4}{5}",
                                                                           aId.DayOfBirth, aId.CheckdigitDayOfBirth,
                                                                           aId.Sex, aId.ExpirationDate,
                                                                           aId.CheckdigitExpirationDate, aId.IssuingCountryCode),
                                           aId.CheckdigitFinal)
                             .Replace(" ", "<");

                line2.Text = String.Format("{0,-30}", String.Format("{0}<<{1}",
                                                                    aId.SurNames, aId.GivenNames))
                             .Replace(" ", "<");
            }
        }