public List <LectureVO> RemoveFromLectureList(List <LectureVO> lectureList, List <LectureVO> interestingLectureList) { string inputLectureIndex; print.ShowLecture(interestingLectureList); print.InputMsg("학수번호"); inputLectureIndex = Console.ReadLine(); error = errorCheck.IsValidPattern(inputLectureIndex, "lectureIndex"); if (error == true) { print.ErrorMsg("잘못된 양식의 학수번호"); return(interestingLectureList); } error = errorCheck.IsValidLecture(interestingLectureList, inputLectureIndex); if (error == false) //장바구니에 없는 강의 { print.ErrorMsg("관심과목 리스트에 없는 강의"); return(interestingLectureList); } //관심과목 리스트에서 삭제 interestingLectureList.RemoveAll(lecture => lecture.LectureIndex.Equals(inputLectureIndex)); print.ShowLecture(interestingLectureList); print.CompleteMsg("관심과목 삭제"); return(interestingLectureList); }
public void JoinLectureList(List <LectureVO> inputLectureList) { print.ShowLecture(inputLectureList); print.PreviousMsg(); Console.ReadLine(); }
public List <LectureVO> AddLectureInList(List <LectureVO> lectureList, List <LectureVO> inputLectureList, string type) { Console.Clear(); string inputLectureIndex; string inputClassIndex; string inputDepartment; print.ShowLecture(lectureList); print.InputMsg("학수번호"); inputLectureIndex = Console.ReadLine(); error = errorCheck.IsValidPattern(inputLectureIndex, "lectureIndex"); if (error == true) { print.ErrorMsg("잘못된 양식의 학수번호"); return(inputLectureList); } error = errorCheck.IsValidLecture(inputLectureList, inputLectureIndex); if (error == true) { print.ErrorMsg("이미 추가된 강의"); return(inputLectureList); } //일치하는 학수번호 강의 리스트 출력 List <LectureVO> foundList = lectureList.FindAll(lecture => lecture.LectureIndex.Equals(inputLectureIndex)); print.ShowLecture(foundList); //학수번호 같은데 전공이 다른 과목 if (CheckAnotherDepartment(foundList) == true) { List <LectureVO> computerEngineering = foundList.FindAll(lecture => lecture.Department.Equals("컴퓨터공학과")); List <LectureVO> informationProtection = foundList.FindAll(lecture => lecture.Department.Equals("정보보호학과"));; List <LectureVO> digitalContents = foundList.FindAll(lecture => lecture.Department.Equals("디지털콘텐츠학과")); List <LectureVO> softWare = foundList.FindAll(lecture => lecture.Department.Equals("소프트웨어학과")); print.InputMsg("개설학과전공"); inputDepartment = Console.ReadLine(); error = errorCheck.IsValidPattern(inputDepartment, "department"); if (error == true) { print.ErrorMsg("잘못된 양식의 개설학과전공"); return(inputLectureList); } inputLectureList = AddLectureByDepartment(inputDepartment, foundList, inputLectureList, computerEngineering, informationProtection, digitalContents, softWare, type); return(inputLectureList); } print.InputMsg("분반"); inputClassIndex = Console.ReadLine(); error = errorCheck.IsValidPattern(inputClassIndex, "classIndex"); if (error == true) { print.ErrorMsg("잘못된 양식의 분반"); return(inputLectureList); } //리스트에 이미 시간이 중복되는 강의가 있는지 error = errorCheck.IsValidTime(inputLectureList, foundList, inputClassIndex); if (error == true) { print.ErrorMsg("시간 중복 강의"); return(inputLectureList); } double toGrade = double.Parse(foundList[0].Grade); //추가직전에 학점초과 되는지 여부 체크 error = errorCheck.IsValidGrade(inputLectureList, type, toGrade); if (error == true) { print.ErrorMsg("학점 초과"); return(inputLectureList); } //리스트에 추가 LectureVO newLecture = foundList.Find(lecture => lecture.ClassIndex.Equals(inputClassIndex)); inputLectureList.Add(new LectureVO(newLecture.Department, newLecture.LectureIndex, newLecture.ClassIndex, newLecture.LectureName, newLecture.Division, newLecture.Year, newLecture.Grade, newLecture.Time, newLecture.Classroom, newLecture.Professor, newLecture.Language)); print.ShowLecture(inputLectureList); print.CompleteMsg(type + " 추가"); return(inputLectureList); }
public void SearchByDepartment(List <LectureVO> lectureList) { print.ShowLecture(lectureList); print.InputMsg("개설학과 전공"); input = Console.ReadLine(); error = errorCheck.IsValidPattern(input, "department"); if (error == true) { print.ErrorMsg("잘못된 양식의 개설학과전공"); return; } List <LectureVO> foundList = lectureList.FindAll(lecture => lecture.Department.Equals(input)); print.ShowLecture(foundList); print.PreviousMsg(); Console.ReadLine(); }