public int GetTrueStudentIDWhoHaveCourses(Student student, DataClasses1DataContext db) { Console.WriteLine("\n\tStudents ID who have courses"); AvailableStudentIDPerCourse(db); int studentID = student.GetStudentIDForCreate(db); bool existStudent = CheckStudentId(studentID, db); bool foundStudent = CheckStudentIdInTableStudentPerCourse(studentID, db); while (!existStudent) { Console.WriteLine("\n\tThis Student ID does not correspond to a student!!!"); Console.WriteLine("\n\tStudentσ ID who have courses"); AvailableStudentIDPerCourse(db); studentID = student.GetStudentIDForCreate(db); existStudent = CheckStudentId(studentID, db); } while (!foundStudent) { Console.WriteLine("\n\tThis student has not courses!!!"); AvailableStudentIDPerCourse(db); studentID = student.GetStudentIDForCreate(db); foundStudent = CheckStudentIdInTableStudentPerCourse(studentID, db); } return(studentID); }
public int GetTrueStudentID(Student student, DataClasses1DataContext db) { AvailableStudentID(db); int studentID = student.GetStudentIDForCreate(db); bool existStudent = CheckStudentId(studentID, db); while (!existStudent) { Console.WriteLine("\n\tThis Student ID does not correspond to a student!!!"); AvailableStudentID(db); studentID = student.GetStudentIDForCreate(db); existStudent = CheckStudentId(studentID, db); } return(studentID); }