private Boolean addCustomer(BEID_EIDCard card)
        {
            try
            {
                byte[] bytesPicture = card.getPicture().getData().GetBytes();

                BEID_EId data           = card.getID();
                string   nationalNumber = data.getNationalNumber();
                string   firstname      = data.getFirstName1().Contains(' ') ? data.getFirstName1().Split(' ')[0] : data.getFirstName1();
                string   lastname       = data.getSurname();
                string   street         = data.getStreet();
                string   postcode       = data.getZipCode();
                string   city           = data.getMunicipality();

                Customer = new Customer()
                {
                    NationalNumber = nationalNumber,
                    Firstname      = firstname,
                    Lastname       = lastname,
                    Street         = street,
                    Postcode       = postcode,
                    City           = city,
                    Picture        = bytesPicture
                };

                return(true);
            }
            catch (BEID_Exception ex)
            {
                IDReader.logError(ex);
                BEID_ReaderSet.releaseSDK();
                return(false);
            }
        }
Example #2
0
        public static BEID_EIDCard getData()
        {
            try
            {
                BEID_ReaderSet.initSDK();
                BEID_ReaderContext Reader = BEID_ReaderSet.instance().getReader();

                if (Reader.isCardPresent())
                {
                    BEID_EIDCard card = Reader.getEIDCard();

                    if (card.isTestCard())
                    {
                        card.setAllowTestCard(true);
                    }

                    return(card);
                }
                else
                {
                    return(null);
                }
            }

            catch (BEID_Exception ex)
            {
                IDReader.logError(ex);
                BEID_ReaderSet.releaseSDK();
                return(null);
            }
        }