private Customer Load_eid(BEID_ReaderContext Reader) { Customer IDCust = new Customer(); BEID_EIDCard card; card = Reader.getEIDCard(); if (card.isTestCard()) { card.setAllowTestCard(true); } BEID_EId doc; doc = card.getID(); IDCust.Address = doc.getStreet() + " " + doc.getZipCode() + " " + doc.getMunicipality(); IDCust.Balance = 0; IDCust.Name = doc.getFirstName() + " " + doc.getSurname(); IDCust.NationalNumber = doc.getNationalNumber().ToString(); BEID_Picture picture; picture = card.getPicture(); byte[] bytearray; bytearray = picture.getData().GetBytes(); IDCust.Picture = bytearray; return(IDCust); }
private void Login() { BEID_ReaderSet.initSDK(); 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) { Customer c = new Customer(); BEID_EIDCard card = readerContext.getEIDCard(); c.RijksregisterNummer = long.Parse(card.getID().getNationalNumber()); ControleerGebruiker(c); } } } else { Error = "Gelieve een geregistreerde klanten ID in de reader te plaatsen"; CreateErrorlog(Error, "TussenpaginaVM", "Login"); } BEID_ReaderSet.releaseSDK(); } catch (Exception ex) { Error = "Gelieve een geregistreerde klanten ID in de reader te plaatsen"; CreateErrorlog(Error, "TussenpaginaVM", "Login"); } }
public void ScanCustomer() { BEID_ReaderSet.initSDK(); 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) { Customer c = new Customer(); BEID_EIDCard card = readerContext.getEIDCard(); c.RijksregisterNummer = long.Parse(card.getID().getNationalNumber()); ControleerGebruiker(c); } } } else { Error = "Plaats een geldige kaart in het toestel"; CreateErrorlog(Error, "MainscreenVM", "ScanCustomer"); } BEID_ReaderSet.releaseSDK(); } catch (Exception ex) { Error = "Plaats een geldige kaart in het toestel"; CreateErrorlog(Error, "MainscreenVM", "ScanCustomer"); } }
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); } }
private void Login() { BEID_ReaderSet.initSDK(); 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) { Employee e = new Employee(); BEID_EIDCard card = readerContext.getEIDCard(); e.RijksregisterNummer = long.Parse(card.getID().getNationalNumber()); ControleerGebruiker(e); } } } else { Error = "Plaats een geldige kaart in het toestel"; CreateErrorlog(Error, "LoginVM", "Login"); } BEID_ReaderSet.releaseSDK(); } catch (Exception ex) { Error = "Plaats een geldige kaart in het toestel"; CreateErrorlog(Error, "LoginVM", "Login"); } }
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."; } }
private void register() { try { string barcode = ""; Customer c = new Customer(); if (NewCustomer.Barcode != 0) { c.Barcode = NewCustomer.Barcode; } BEID_ReaderSet.initSDK(); // access the eID card here 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; byte[] bytearray; picture = card.getPicture(); bytearray = picture.getData().GetBytes(); c.Picture = bytearray; //c.Picture = StringToImageConverter.BitmapImageFromBytes(bytearray); //img.Height = 100; c.CustomerName = card.getID().getFirstName() + " " + card.getID().getSurname(); c.Address = card.getID().getStreet() + " " + card.getID().getMunicipality(); barcode = card.getID().getNationalNumber(); } } } BEID_ReaderSet.releaseSDK(); BarCodeBuilder bb = new BarCodeBuilder(); bb.CodeText = barcode; bb.SymbologyType = Symbology.Code128; bb.Save(c.CustomerName + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg); c.Barcode = Int64.Parse(barcode); NewCustomer = c; } catch (Exception) { MessageBox.Show("Please insert a valid identitycard and try again"); } }
private void ReadIdentityEmployee() { Employee c = new Employee(); if (SelectedEmployee.Barcode != 0) { c.Barcode = SelectedEmployee.Barcode; } BEID_ReaderSet.initSDK(); // access the eID card here 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; //byte[] bytearray; //picture = card.getPicture(); //bytearray = picture.getData().GetBytes(); //c.Picture = bytearray; //c.Picture = StringToImageConverter.BitmapImageFromBytes(bytearray); //img.Height = 100; c.EmployeeName = card.getID().getFirstName() + " " + card.getID().getSurname(); c.Address = card.getID().getStreet() + " " + card.getID().getMunicipality(); c.Barcode = Int64.Parse(card.getID().getNationalNumber()); } } } BEID_ReaderSet.releaseSDK(); BarCodeBuilder bb = new BarCodeBuilder(); bb.CodeText = c.Barcode.ToString(); bb.SymbologyType = Symbology.Code128; bb.Save(c.EmployeeName + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg); SelectedEmployee = c; }
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"); } }
private void Login() { BEID_ReaderSet.initSDK(); 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) { Customer c = new Customer(); BEID_EIDCard card = readerContext.getEIDCard(); BEID_Picture picture; picture = card.getPicture(); byte[] bytearray = picture.getData().GetBytes(); c.CustomerName = card.getID().getFirstName() + " " + card.getID().getSurname(); c.Address = card.getID().getStreet() + " " + card.getID().getZipCode() + " " + card.getID().getMunicipality(); c.Picture = bytearray; c.RijksregisterNummer = long.Parse(card.getID().getNationalNumber()); c.Balance = 0; ApplicationVM.TempUser = c; ControleerGebruiker(c); } } } else { Error = "Plaats een geldige kaart in het toestel"; CreateErrorlog(Error, "LoginVM", "Login"); } BEID_ReaderSet.releaseSDK(); } catch (Exception ex) { Error = "Plaats een geldige kaart in het toestel"; CreateErrorlog(Error, "LoginVM", "Login"); } }
private void LoadEid() { BEID_ReaderSet.initSDK(); 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(); Customer = new Customers(); Customer.CustomerName = doc.getFirstName1() + " " + doc.getSurname(); GetCustomer(); } else { MakeErrorLog("doesn't support this version of E-ID ", mname, "LoadEid"); } } else { MakeErrorLog("Couldn't find an E-ID", mname, "LoadEid"); } BEID_ReaderSet.releaseSDK(); } catch (Exception) { MakeErrorLog("There is something wrong with reading the card", mname, "LoadEid"); } }
private static ReadId Load_eid(BEID_ReaderContext Reader) { string Naam, Adres; BEID_EIDCard card; card = Reader.getEIDCard(); if (card.isTestCard()) { card.setAllowTestCard(true); } BEID_EId doc; doc = card.getID(); Naam = doc.getFirstName() + " " + doc.getSurname(); Adres = doc.getStreet() + " " + doc.getZipCode() + " " + doc.getMunicipality(); /*sText = ""; * sText += "PERSONAL DATA" + "\r\n"; * sText += "\r\n"; * sText += "First Name = " + doc.getFirstName() + "\r\n"; * sText += "Last Name = " + doc.getSurname() + "\r\n"; * sText += "Gender = " + doc.getGender() + "\r\n"; * sText += "DateOfBirth = " + doc.getDateOfBirth() + "\r\n"; * sText += "LocationOfBirth = " + doc.getLocationOfBirth() + "\r\n"; * sText += "Nobility = " + doc.getNobility() + "\r\n"; * sText += "Nationality = " + doc.getNationality() + "\r\n"; * sText += "NationalNumber = " + doc.getNationalNumber() + "\r\n"; * sText += "SpecialOrganization = " + doc.getSpecialOrganization() + "\r\n"; * sText += "MemberOfFamily = " + doc.getMemberOfFamily() + "\r\n"; * sText += "AddressVersion = " + doc.getAddressVersion() + "\r\n"; * sText += "Street = " + doc.getStreet() + "\r\n"; * sText += "ZipCode = " + doc.getZipCode() + "\r\n"; * sText += "Municipality = " + doc.getMunicipality() + "\r\n"; * sText += "Country = " + doc.getCountry() + "\r\n"; * sText += "SpecialStatus = " + doc.getSpecialStatus() + "\r\n"; * * sText += "\r\n"; * sText += "\r\n"; * * sText += @"CARD DATA" + "\r\n"; * sText += "\r\n"; * sText += "LogicalNumber = " + doc.getLogicalNumber() + "\r\n"; * sText += "ChipNumber = " + doc.getChipNumber() + "\r\n"; * sText += "ValidityBeginDate = " + doc.getValidityBeginDate() + "\r\n"; * sText += "ValidityEndDate = " + doc.getValidityEndDate() + "\r\n"; * sText += "IssuingMunicipality = " + doc.getIssuingMunicipality() + "\r\n";*/ BEID_Picture picture; picture = card.getPicture(); byte[] bytearray; bytearray = picture.getData().GetBytes(); return(new ReadId() { Name = Naam, Adres = Adres, Bytes = bytearray }); }
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); } }