Пример #1
0
    public int prConnect()
    {
        if (_helper == null)
        {
            _helper = new Helper();
        }

        try
        {
            /* Opening the PR system */
            _pr = new PassportReader(); /* Object for the PR system */

/*
 *          if (_pr.TestPowerState() != 0)
 *          {
 *              ErrorMessage = "The power is off";
 *              return -1;
 *          }
 */
            /* Validity check */
            if (!_pr.IsValid())
            {
                ErrorMessage = "Failed to initialize!";
                return(1303);
            }

            /* Connecting to the first device */
            _pr.UseDevice(0, (int)PR_USAGEMODE.PR_UMODE_FULL_CONTROL);
        }
        catch (gxException e)
        {
            return(_helper.GetErrorMessage(e, out _errorMessage));
        }
        catch (Exception e)
        {
            _errorMessage = e.Message + " --- prConnect()";
            return(1305);
        }

        return(0);
    }
Пример #2
0
        }                                      //No MRZ mais visiteurid pour scan de la pièce

        #region Contructeur
        public ScannerPiece()
        {
            pr = new PassportReader();

            visiteurID = "";

            if (!pr.IsValid())
            {
                throw new InvalidProgramException("Lecteur non prêt.");
            }
            else
            {
                try
                {
                    pr.UseDevice(0, (int)PR_USAGEMODE.PR_UMODE_FULL_CONTROL);
                }
                catch (Exception ex)
                {
                    Program.LogFich.Error(ex.ToString());
                    MessageBox.Show("Lecteur ARH non prêt.");
                    //throw new InvalidProgramException("Lecteur non prêt.");
                }
            }
        }
Пример #3
0
    public int prConnect()
    {
        if (_helper == null)
            _helper = new Helper();

        try
        {
            /* Opening the PR system */
            _pr = new PassportReader();	/* Object for the PR system */
        /*
            if (_pr.TestPowerState() != 0)
            {
                ErrorMessage = "The power is off";
                return -1;
            }
        */
            /* Validity check */
            if (!_pr.IsValid())
            {
                ErrorMessage = "Failed to initialize!";
                return 1303;
            }

            /* Connecting to the first device */
            _pr.UseDevice(0, (int)PR_USAGEMODE.PR_UMODE_FULL_CONTROL);

        }
        catch (gxException e)
        {
            return _helper.GetErrorMessage(e, out _errorMessage);
        }
        catch (Exception e)
        {
            _errorMessage = e.Message + " --- prConnect()";
            return 1305;
        }

        return 0;
    }