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"); } }
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 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); } }