diff --git a/out/production/VPR_SCRIPT/Execute.class b/out/production/VPR_SCRIPT/Execute.class index e58be0a..05a5928 100644 Binary files a/out/production/VPR_SCRIPT/Execute.class and b/out/production/VPR_SCRIPT/Execute.class differ diff --git a/out/production/VPR_SCRIPT/Menue.class b/out/production/VPR_SCRIPT/Menue.class deleted file mode 100644 index 10da297..0000000 Binary files a/out/production/VPR_SCRIPT/Menue.class and /dev/null differ diff --git a/out/production/VPR_SCRIPT/Order.class b/out/production/VPR_SCRIPT/Order.class index 9b1f762..0567068 100644 Binary files a/out/production/VPR_SCRIPT/Order.class and b/out/production/VPR_SCRIPT/Order.class differ diff --git a/out/production/VPR_SCRIPT/User.class b/out/production/VPR_SCRIPT/User.class index ce14ec6..811e1e6 100644 Binary files a/out/production/VPR_SCRIPT/User.class and b/out/production/VPR_SCRIPT/User.class differ diff --git a/src/Execute.java b/src/Execute.java index ddcc5b4..bd01490 100644 --- a/src/Execute.java +++ b/src/Execute.java @@ -6,7 +6,7 @@ import java.util.Scanner; */ public class Execute { public static void main(String[] args) { -//EXECUTE MENUE OVERVIEW +//EXECUTE MENU OVERVIEW Data data = new Data("menue.txt"); ArrayList menu = data.readMenu(); @@ -33,17 +33,11 @@ public class Execute { Data userData = new Data("user.txt"); Login login = new Login(); Scanner leser = new Scanner(System.in); - - while(true) - { - System.out.print("Telefonnummer: "); - String phoneNumber = leser.nextLine(); - System.out.print("Passwort: "); - String password = leser.nextLine(); - login.Einloggen(userData.readUser(), password, phoneNumber); - - } - + System.out.print("Telefonnummer: "); + String phoneNumber = leser.nextLine(); + System.out.print("Passwort: "); + String password = leser.nextLine(); + login.Einloggen(userData.readUser(), password, phoneNumber); } diff --git a/src/Login.java b/src/Login.java index 2e5dbf9..36b1f42 100644 --- a/src/Login.java +++ b/src/Login.java @@ -1,10 +1,12 @@ import java.util.ArrayList; +import java.util.Scanner; public class Login { public void Einloggen(ArrayList user, String password, String phoneNumber) { + Scanner leser = new Scanner(System.in); + System.out.println(); - System.out.println("\t\t\tANMELDUNG"); int i = 0; while (true) { @@ -16,6 +18,8 @@ public class Login { if (!error) { if (user1.getPassword().equals(password) && user1.getPhonenumber().equals(phoneNumber)) { + System.out.println(""); + System.out.println("\t\t\tANMELDUNG"); System.out.println(); System.out.println("Herzlich Willkommen " + user1.getNameParent1() + " und " + user1.getNameParent2() + ", Ihr Login war erfolgreich!"); i++; @@ -24,6 +28,11 @@ public class Login { else if (!(user1.getPassword().equals(password) && user1.getPhonenumber().equals(phoneNumber))) { System.out.println("Login fehlgeschlagen. Versuchen Sie es erneut."); + System.out.println(""); + System.out.print("Telefonnummer: "); + phoneNumber = leser.nextLine(); + System.out.print("Passwort: "); + password = leser.nextLine(); break; } }