private void pin() { Opnemen opnemen = new Opnemen(); Boolean printTicket = false; Boolean cancelled = false; Boolean goBack = true; int amount = 0; String input; while (goBack == true) { opnemen.Show(); while (true) { input = arduino.getString(); if (input.Contains("1")) { amount = 10; break; } else if (input.Contains("2")) { amount = 20; break; } else if (input.Contains("3")) { amount = 50; break; } else if (input.Contains("#")) { cancelled = true; break; } else if (input.Contains("C")) { cancelled = true; endOfSession = false; break; } } if (amount > saldo && amount != 0) { //PinError pinError = new PinError(); cancelled = true; } if (cancelled == true) { opnemen.Hide(); break; } else { uploadConnection.UpdateBalans(rekeningID, (saldo - amount)); uploadConnection.transaction(pasID, rekeningID, saldo - amount); //Error.show(amount.ToString()); } Bon asker = new Bon(); asker.Show(); while (true) { input = arduino.getString(); if (input.Contains("*")) { printTicket = true; goBack = false; break; } else if (input.Contains("#")) { //Error.show("Geen Bon", "bon"); goBack = false; break; } } asker.Hide(); if (printTicket == true) { //Printer bonPrinter = new Printer(userName, amount); //bonPrinter.printTicket(); } if (goBack != false) { DankU goAway = new DankU(); goAway.Show(); System.Threading.Thread.Sleep(5000); goAway.Hide(); opnemen.Hide(); } } }