Login ist so gut wie fertig!
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							@@ -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> 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);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,12 @@
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.Scanner;
 | 
			
		||||
 | 
			
		||||
public class Login {
 | 
			
		||||
    public void Einloggen(ArrayList<User> 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;
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user