Пример #1
0
        public static ReadId Lees()
        {
            try
            {
                BEID_ReaderSet.initSDK();
                BEID_ReaderSet ReaderSet;
                ReaderSet = BEID_ReaderSet.instance();

                BEID_ReaderContext Reader;
                Reader = ReaderSet.getReader();

                if (Reader.isCardPresent())
                {
                    ReadId id = Load_eid(Reader);
                    BEID_ReaderSet.releaseSDK();
                    return(id);
                }
                return(null);
            }
            catch (Exception ex)
            {
                BEID_ReaderSet.releaseSDK();
                return(null);
            }
        }
Пример #2
0
        public void IsAlLid()
        {
            try
            {
                BEID_ReaderSet ReaderSet;
                ReaderSet = BEID_ReaderSet.instance();

                BEID_ReaderContext Reader;
                Reader = ReaderSet.getReader();


                if (Reader.isCardPresent())
                {
                    EIDAanwezig = "";
                    if (Reader.getCardType() == BEID_CardType.BEID_CARDTYPE_EID ||
                        Reader.getCardType() == BEID_CardType.BEID_CARDTYPE_FOREIGNER ||
                        Reader.getCardType() == BEID_CardType.BEID_CARDTYPE_KIDS)
                    {
                        EIDAanwezig = "";
                        Customer test = Load_eid(Reader);

                        foreach (Customer nn in CustomersDB)
                        {
                            if (nn.NationalNumber.Equals(test.NationalNumber))
                            {
                                if (nn.Picture == null)
                                {
                                    string pic = "0";
                                    byte[] id  = System.Text.Encoding.UTF8.GetBytes(pic);
                                    nn.Picture = id;
                                }
                                SaldoVM.SelectedCustomer   = nn;
                                AccountVM.SelectedCustomer = nn;

                                appvm.ChangePage(new AccountVM());
                            }
                            else
                            {
                                NewAccountVM.NewCust = test;
                                appvm.ChangePage(new NewAccountVM());
                            }
                        }
                    }
                    else
                    {
                        BEID_ReaderSet.releaseSDK();
                        EIDAanwezig = "Er is een fout bij het lezen van de kaart. Probeer opnieuw.";
                    }
                }

                BEID_ReaderSet.releaseSDK();
            }

            catch (BEID_Exception ex)
            {
                BEID_ReaderSet.releaseSDK();
                EIDAanwezig = "Gelieve uw eID in het voorziene toestel te steken.";
            }
        }
        //Kijken of de eID al lid is
        public void IsAlLid()
        {
            try
            {
                BEID_ReaderSet ReaderSet;
                ReaderSet = BEID_ReaderSet.instance();

                BEID_ReaderContext Reader;

                Reader = ReaderSet.getReader();


                if (Reader.isCardPresent())
                {
                    KlantMelding = "";
                    if (Reader.getCardType() == BEID_CardType.BEID_CARDTYPE_EID ||
                        Reader.getCardType() == BEID_CardType.BEID_CARDTYPE_FOREIGNER ||
                        Reader.getCardType() == BEID_CardType.BEID_CARDTYPE_KIDS)
                    {
                        KlantMelding = "";
                        Customer test = Load_eid(Reader);

                        foreach (Customer nn in CustomersDB)
                        {
                            if (nn.NationalNumber.Equals(test.NationalNumber))
                            {
                                KlantMelding   = "";
                                LoadedCustomer = new Customer();
                                LoadedCustomer = nn;
                                Saldo          = LoadedCustomer.Balance;
                            }
                            else
                            {
                                KlantMelding = "Deze klant is nog geen lid.";
                            }
                        }
                    }
                    else
                    {
                        BEID_ReaderSet.releaseSDK();
                        KlantMelding = "Er is een fout bij het lezen van de kaart. Probeer opnieuw.";
                    }
                }
                else
                {
                    BEID_ReaderSet.releaseSDK();
                    KlantMelding = "Er is geen kaart gedetecteerd.";
                }

                BEID_ReaderSet.releaseSDK();
            }

            catch (BEID_ExNoReader ex)
            {
                Errorlog newError = new Errorlog();
                newError.Message    = "Kaartlezer werd niet gevonden";
                newError.RegisterID = appvm.GekozenKassa;
                newError.Stacktrace = ex.StackTrace;
                newError.Timestamp  = DateTime.Now;
                Error(newError);
                BEID_ReaderSet.releaseSDK();
                KlantMelding = "De kaartlezer werd niet gevonden.";
            }
        }