Exemple #1
0
        private void parseOnUs(MICR parsed, String fragment)

        {
            if (parsed.getAuxOnUs() == null)
            {
                int lastOnUsIdx = fragment.LastIndexOf(getOnUsSymbol());
                //parsed.setOnUs(fragment);
                String potentialSerial = fragment.Substring(lastOnUsIdx + 1);


                if (potentialSerial != null && potentialSerial.Length > 1)
                {
                    parsed.setSerialNumber(potentialSerial);
                    fragment = fragment.Substring(0, lastOnUsIdx);
                }
                fragment = Regex.Replace(fragment, "[^.0-9]", "");
                parsed.setOnUs(fragment);
            }
            else
            {
                parsed.setOnUs(fragment != null ? Regex.Replace(fragment, "[^.0-9]", "") : null);
                parsed.setSerialNumber(parsed.getAuxOnUs());
            }
        }
Exemple #2
0
        private void axRanger1_TransportSetItemOutput(object sender, AxRANGERLib._DRangerEvents_TransportSetItemOutputEvent e)
        {
            txtMICR = '"' + axRanger1.GetMicrText(1) + '"';
            //txtMICR = "d102100400d 40142475062280c";
            MICRParser mp   = new MICRParser();
            MICR       micr = mp.parseMicrString(txtMICR);

            //string [] data = CheckUtil.readRangerMICR(txtMICR);
            if (verifyCompany(micr.getRtn(), micr.getOnUs()) > 0)
            {
                cc.check.Text = micr.getSerialNumber() != null?micr.getSerialNumber() : micr.getAuxOnUs();

                cc.routing.Text = micr.getRtn();
                cc.acct.Text    = micr.getOnUs();
            }

            axRanger1.SetTargetLogicalPocket(1);
        }