From 76d08d93dabd7cfb77a1bd9bd493143c720528b0 Mon Sep 17 00:00:00 2001 From: Kevin Pfannenstiel Date: Tue, 20 Dec 2022 19:41:12 +0100 Subject: [PATCH] Login ist so gut wie fertig! --- out/production/VPR_SCRIPT/Execute.class | Bin 2335 -> 2311 bytes out/production/VPR_SCRIPT/Menue.class | Bin 1912 -> 0 bytes out/production/VPR_SCRIPT/Order.class | Bin 240 -> 240 bytes out/production/VPR_SCRIPT/User.class | Bin 1752 -> 1752 bytes src/Execute.java | 18 ++++++------------ src/Login.java | 11 ++++++++++- 6 files changed, 16 insertions(+), 13 deletions(-) delete mode 100644 out/production/VPR_SCRIPT/Menue.class diff --git a/out/production/VPR_SCRIPT/Execute.class b/out/production/VPR_SCRIPT/Execute.class index e58be0a4f596e55d00c87c2fd3c3e583c5b276bb..05a5928606fe5a6eb5f0688ec7c5a135a3d5ea2d 100644 GIT binary patch delta 297 zcmXYqy)Q#?6o#MM`&psft09_nL~l}NtHnetB?il-SAyFQmzMhMB3AMnI~W*@6^qSi zVz5@k-$80_OOWj~h zWu3*daUPlAiAkO*@QP25BB5NYlE!6)Ew<4U0udGIeY{bnhQ=T-)Y&0Lhgo9rbZ(hp zmpw`83a3F6Q|Nj2IlvNrhL$LsLm~B}75^be0y!4TL;u0Gv2BL6Z|1%jlAsgWq&WQp DdqY7& delta 279 zcmX|)El+|`6vuxTo_p^D!}$nB2$CH5g3e&FGEC0o2XOKfCkQCMf?Axjx!qteSe!N| zv)G6>XECvZ7$-LKq6xx5>5hg0?3#GhljB=Wo@kNirrDF z{3pN%@Eod;smcQ%kdLA`v%87c*ra#}rP}SD-k#H^XS!R@{(AZ+fE8?(kU`c$&PE;u zftiQ$v8)fIw^P5r{ZMtaKw-u8T)irgU9N3Tpoj?zB^xJT3*^_8H&Oz*p41fO_QCd! z4qR`iVKz+Jm^R+Io*VX!;WZm&VyElIDaUem=9gMzNe+@5o>-q#kbj)K}Y>K zQeIazYTp;}mVlMO7I8rU=BSozETcvg?LP-Rxm-)ZBxx6MNkD8FI#+C5MV(-Q8V+Qa z$JF}QxGA8+d{Q4?M0kf0ekk#z-m~$(AywE>dSh=`=FMKW@c}**IQ2;Gs;2LCrT*5{ zeQKeW(Lp{)lSnX+M)@z6W6~Fx=(szc)T4m;F2*P??rh~K>S{w^>yobJ1<5UU*(ILXZ&_Szdh_w@fS*2kWb z$;9F{x1xTV>}c8DU6;dzb*bZzg05O~O1BY=m3BuR|Tk;kwd&zZXsyaJPid z@r8x9sg-qJ(?RpP-eZ4P)#I{=%V$k?wIA#W{FF{Oag0IlNUt|g;bPnOcSpm<(OXVg z4sB%7s$<-@QvUHYYNTr|foRIXpyO)ANpPQyDN4x?_Fd0YL31EE8bS+S3tTvo;c>(* zYzQp8+?CB1XNmJ{zzjPs&xbRSZdsISoSD`kPQ z>ihxWTpGi2E{`$kTp44=spQ6(bt?HW=6<7379a7w0E_Q4#F@tg&SHwgW|r0p&hb~p zD!;DAnD`i#qZy{TNHbjX_>{U0kyvih60^TWTN5?D4fi^w z@yR>C!+Js`6A>&#MkgW?gX9w;!VIir^8Px# delta 16 Ycmeys_<@n*)W2Q(7#J9ACUU$006$v>=l}o! diff --git a/out/production/VPR_SCRIPT/User.class b/out/production/VPR_SCRIPT/User.class index ce14ec6abe0ca80e3a9596bbc69d5542f32daf37..811e1e692df811fd79ebfb0163800e7c32fcd5e4 100644 GIT binary patch delta 88 zcmcb?dxLkvCPu%Fn>|=$r5IQkq!~CFWEl7uWEq4R|=$r5RWlWEeOZWEuDvwQ}m=(+Bz!*7s9-9>aJ3$kO 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; } }