Skip to content

Commit

Permalink
Merge pull request #45 from hamings/feature/jung
Browse files Browse the repository at this point in the history
�Feature/jung 반복문 수정
  • Loading branch information
hamings authored Mar 27, 2024
2 parents 0569370 + 06dbeb7 commit c830323
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 57 deletions.
2 changes: 1 addition & 1 deletion src/src/domain/Admin.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@Getter
public class Admin {
private static Admin admin = new Admin();
private static Admin admin;
private String id;
private String password;

Expand Down
128 changes: 72 additions & 56 deletions src/src/domain/AmsApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public void run() throws IOException {
num = scanner.nextLine();
switch (num) {
case "1": {
while(true){
Constant.printRegistrationLectureMenu();
Constant.printInputText();
num = scanner.nextLine();
Expand All @@ -74,7 +75,6 @@ public void run() throws IOException {

String choiceLectureId = scanner.nextLine();
studentService.registerLecture(choiceLectureId);
break;
} else if (num.equals("2")) { //수강신청 취소
if (studentService.showStudentAllRegistrationLecture()) {
System.out.println("취소하고자 하는 강의의 강의 id를 입력해주세요: \n");
Expand All @@ -85,34 +85,38 @@ public void run() throws IOException {

} else if (num.equals("3")) {
studentService.showStudentAllRegistrationLecture();
} else if (num.equals("4")) {
Constant.printLogout();
studentService.setStudent((Student) userService.logout());
} else if (num.equals("0")) {
break;
} else {
//올바르지 않은 번호 선택
Constant.incorrectNumber();
}
}
break;
}
case "2": {
studentService.showStudyRoom();
Constant.printStudyRoomMenu();
Constant.printInputText();
num = scanner.nextLine();
if (num.equals("1")) {
if (!studentService.isExistResevation()) {
System.out.println("\n예약을 원하는 좌석 번호를 입력하세요(ex: 1-1)");
while(true) {
studentService.showStudyRoom();
Constant.printStudyRoomMenu();
Constant.printInputText();
num = scanner.nextLine();
if (num.equals("1")) {
if (!studentService.isExistResevation()) {
System.out.println("\n예약을 원하는 좌석 번호를 입력하세요(ex: 1-1)");
Constant.printInputText();
String choiceSeat = scanner.nextLine();
studentService.isPossibleReserve(choiceSeat);
}
} else if (num.equals("2")) {
System.out.println("\n취소를 원하는 좌석 좌석 번호를 입력하세요(ex: 1-1)");
Constant.printInputText();
String choiceSeat = scanner.nextLine();
studentService.isPossibleReserve(choiceSeat);
String seatNum = scanner.nextLine();
studentService.cancelReservation(seatNum);
}else if(num.equals("0")){
break;
} else {
Constant.incorrectNumber();
}
} else if (num.equals("2")) {
System.out.println("\n취소를 원하는 좌석 좌석 번호를 입력하세요(ex: 1-1)");
Constant.printInputText();
String seatNum = scanner.nextLine();
studentService.cancelReservation(seatNum);
} else {
Constant.incorrectNumber();
}
break;
}
Expand Down Expand Up @@ -183,50 +187,62 @@ public void run() throws IOException {

switch (num) {
case "1": {
adminService.showStudentList();
Constant.printStudentInformationMenu();
Constant.printInputText();
num = scanner.nextLine();
if (num.equals("1")) { //학생 상세
showDetailStudent();
} else if (num.equals("2")) { //학생 수정
editStudentInformation();
} else if (num.equals("3")) { //학생 삭제
deleteStudentInformation();
} else {
Constant.incorrectNumber();
while(true) {
adminService.showStudentList();
Constant.printStudentInformationMenu();
Constant.printInputText();
num = scanner.nextLine();
if (num.equals("1")) { //학생 상세
showDetailStudent();
} else if (num.equals("2")) { //학생 수정
editStudentInformation();
} else if (num.equals("3")) { //학생 삭제
deleteStudentInformation();
} else if(num.equals("0")){
break;
}else {
Constant.incorrectNumber();
}
}
break;
}
case "2": {
adminService.showTeacherList();
Constant.printTeacherInformationMenu();
Constant.printInputText();
num = scanner.nextLine();

if (num.equals("1")) { //강사 상세
showDetailTeacher();
} else if (num.equals("2")) { //강사 수정
editTeacherInformation();
} else {
Constant.incorrectNumber();
while(true) {
adminService.showTeacherList();
Constant.printTeacherInformationMenu();
Constant.printInputText();
num = scanner.nextLine();

if (num.equals("1")) { //강사 상세
showDetailTeacher();
} else if (num.equals("2")) { //강사 수정
editTeacherInformation();
} else if (num.equals("0")) { //뒤로 가기
break;
} else {
Constant.incorrectNumber();
}
}
break;
}
case "3": {
adminService.showLectureList();
Constant.printLectureInfromationMenu();
Constant.printInputText();
num = scanner.nextLine();

if (num.equals("1")) { //강의 상세
showDetailLecture();
} else if (num.equals("2")) { //강의 등록
registerLecture();
} else if (num.equals("3")) { //강의 삭제
deleteLectureInformation();
} else { //숫자 잘못 입력
Constant.incorrectNumber();
while(true) {
adminService.showLectureList();
Constant.printLectureInfromationMenu();
Constant.printInputText();
num = scanner.nextLine();

if (num.equals("1")) { //강의 상세
showDetailLecture();
} else if (num.equals("2")) { //강의 등록
registerLecture();
} else if (num.equals("3")) { //강의 삭제
deleteLectureInformation();
} else if (num.equals("0")) { //뒤로 가기
break;
} else { //숫자 잘못 입력
Constant.incorrectNumber();
}
}
break;
}
Expand Down
5 changes: 5 additions & 0 deletions src/src/util/Constant.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static void printRegistrationLectureMenu() {
System.out.println("1. 수강 신청");
System.out.println("2. 수강 취소");
System.out.println("3. 수강 신청 내역");
System.out.println("0. 뒤로 가기");
System.out.println("----------------------------------\n");
System.out.println("원하시는 서비스 번호를 선택하세요");
}
Expand All @@ -47,6 +48,7 @@ public static void printStudyRoomMenu() {
System.out.println("---------[자습실 관리 시스템]---------");
System.out.println("1. 좌석 예약하기");
System.out.println("2. 좌석 취소하기");
System.out.println("0. 뒤로 가기");
System.out.println("-----------------------------------\n");
System.out.println("원하시는 서비스 번호를 선택하세요");
}
Expand Down Expand Up @@ -75,6 +77,7 @@ public static void printStudentInformationMenu() {
System.out.println("1. 학생상세정보");
System.out.println("2. 학생정보수정");
System.out.println("3. 학생정보삭제");
System.out.println("0. 뒤로 가기");
System.out.println("---------------------------------");
}

Expand All @@ -83,6 +86,7 @@ public static void printTeacherInformationMenu() {
System.out.println("----------[강사정보관리]------------");
System.out.println("1. 강사상세정보");
System.out.println("2. 강사정보수정");
System.out.println("0. 뒤로 가기");
System.out.println("---------------------------------");
}

Expand All @@ -92,6 +96,7 @@ public static void printLectureInfromationMenu() {
System.out.println("1. 강의상세정보");
System.out.println("2. 신규강의등록");
System.out.println("3. 강의정보삭제");
System.out.println("0. 뒤로 가기");
System.out.println("---------------------------------");
}

Expand Down

0 comments on commit c830323

Please sign in to comment.