diff --git a/src/main/java/org/example/Administration.java b/src/main/java/org/example/Administration.java index a27384c..14b2ae9 100644 --- a/src/main/java/org/example/Administration.java +++ b/src/main/java/org/example/Administration.java @@ -185,8 +185,23 @@ public class Administration { } else if(findProfessorById(UserId) == null || findAdminById(UserId) == null || findStudentById(UserId) == null) { - System.out.println("The Id has not been used already!"); - correctData = true; + String substring = UserId.substring(1); + + if(!rightPrefix(UserId, userType)) + { + correctData = false; + } + else if(!isNumber(substring)) + { + System.out.println("Every character besides the first one need to be digits"); + correctData = false; + + } + else{ + System.out.println("The Id has not been used already!"); + correctData = true; + } + } switch (userType)