private async void LaadEid()
        {
            KanKaartOpladen        = false;
            IsNogNietGeregistreerd = false;
            StatusMessage          = "";
            Error = "";

            try
            {
                if (BEID_ReaderSet.instance().readerCount() > 0)
                {
                    BEID_ReaderContext readerContext = readerContext = BEID_ReaderSet.instance().getReader();
                    if (readerContext != null)
                    {
                        if (readerContext.getCardType() == BEID_CardType.BEID_CARDTYPE_EID)
                        {
                            BEID_EIDCard card      = readerContext.getEIDCard();
                            BEID_Picture picture   = card.getPicture();
                            byte[]       bytearray = picture.getData().GetBytes();

                            try
                            {
                                //Image img = StringToImageConverter.ImageFromBytes(bytearray);
                                Customer newCustomer = new Customer()
                                {
                                    Name    = card.getID().getFirstName() + " " + card.getID().getSurname(),
                                    Address = card.getID().getStreet() + " " + card.getID().getZipCode(),
                                    Image   = bytearray
                                };

                                Klant = newCustomer;
                                ControleerOfKlantAlGeregistreerd();
                            }
                            catch (Exception e)
                            {
                                Error = "Er was een fout bij het converteren van je foto.";
                            }
                        }
                        else
                        {
                            Error = "Kon geen kaart vinden. Probeer opnieuw.";
                        }
                    }
                    else
                    {
                        Error = "Kon geen kaart vinden. Probeer opnieuw.";
                    }
                }
                else
                {
                    Error = "Kon geen kaart vinden. Probeer opnieuw.";
                }
                //BEID_ReaderSet.releaseSDK();
            }
            catch
            {
                Error = "Kon geen kaart vinden. Probeer opnieuw.";
            }
        }
Beispiel #2
0
        private void LoadEid()
        {
            BEID_ReaderSet.initSDK();
            Registrated = false;

            try
            {
                BEID_ReaderSet     readerSet = BEID_ReaderSet.instance();
                BEID_ReaderContext reader    = readerSet.getReader();

                if (reader.isCardPresent())
                {
                    if (reader.getCardType() == BEID_CardType.BEID_CARDTYPE_EID)
                    {
                        BEID_EIDCard card         = reader.getEIDCard();
                        BEID_EId     doc          = card.getID();
                        BEID_Picture picture      = card.getPicture();
                        byte[]       pictureBytes = picture.getData().GetBytes();

                        Customer.CustomerName = doc.getFirstName1() + " " + doc.getSurname();
                        Customer.Address      = doc.getStreet() + ", " + doc.getZipCode() + " " + doc.getMunicipality();
                        Customer.Picture      = pictureBytes;
                        Customer.Balance      = 0;

                        FirstName = doc.getFirstName1();
                        LastName  = doc.getSurname();
                        Address   = doc.getStreet();
                        City      = doc.getZipCode() + " " + doc.getMunicipality();

                        CheckIfCustomerExists();
                    }
                    else
                    {
                        MakeErrorLog("Doesn't support this version", mname, "LoadEid");
                    }
                }
                else
                {
                    MakeErrorLog("No E-ID was found", mname, "LoadEid");
                }

                BEID_ReaderSet.releaseSDK();
            }
            catch (Exception)
            {
                MakeErrorLog("Something went wrond with reading the E-ID", mname, "LoadEid");
            }
        }
Beispiel #3
0
        private async void LaadEid()
        {
            IsNogNietGeregistreerd = false;
            Error = "";

            try
            {
                if (BEID_ReaderSet.instance().readerCount() > 0)
                {
                    BEID_ReaderContext readerContext = readerContext = BEID_ReaderSet.instance().getReader();
                    if (readerContext != null)
                    {
                        if (readerContext.getCardType() == BEID_CardType.BEID_CARDTYPE_EID)
                        {
                            BEID_EIDCard card      = readerContext.getEIDCard();
                            BEID_Picture picture   = card.getPicture();
                            byte[]       bytearray = picture.getData().GetBytes();

                            try
                            {
                                Customer newCustomer = new Customer()
                                {
                                    Name    = card.getID().getFirstName() + " " + card.getID().getSurname(),
                                    Address = card.getID().getStreet() + " " + card.getID().getZipCode(),
                                    Image   = bytearray
                                };

                                Klant = newCustomer;

                                OnPropertyChanged("SelectedProduct");
                                OnPropertyChanged("Producten");
                                OnPropertyChanged("OrderTotal");
                                OnPropertyChanged("CanDecreaseQuantity");
                                OnPropertyChanged("CanIncreaseQuantity");
                                OnPropertyChanged("OrderTotalTooHigh");
                                OnPropertyChanged("Klant");
                                ControleerOfKlantAlGeregistreerd();
                            }
                            catch (Exception e)
                            {
                                Error = "Er was een fout bij het converteren van je foto.";
                                Helpers.PostLog.Post(e);
                            }
                        }
                        else
                        {
                            Error = "Kon geen kaart vinden. Probeer opnieuw.";
                        }
                    }
                    else
                    {
                        Error = "Kon geen kaart vinden. Probeer opnieuw.";
                        await Helpers.PostLog.Post(new Exception("readerContext was null"));
                    }
                }
                else
                {
                    Error = "Kon geen kaartlezer vinden. Probeer opnieuw.";
                    await Helpers.PostLog.Post(new Exception("BEID_ReaderSet.instance().readerCount() was 0"));
                }
            }
            catch (Exception e)
            {
                Error = "Kon geen kaart vinden. Probeer opnieuw.";
                Helpers.PostLog.Post(e);
            }
        }