diff --git a/LangLang/Core/Controller/CourseController.cs b/LangLang/Core/Controller/CourseController.cs index b95b0cac..204e750a 100644 --- a/LangLang/Core/Controller/CourseController.cs +++ b/LangLang/Core/Controller/CourseController.cs @@ -35,11 +35,19 @@ public void Subscribe(IObserver observer) _courses.Subscribe(observer); } - // Method checks if a certain course is available for the student - public bool isCourseAvailable(int id) + // Method checks if the course is valid for updating or canceling + public bool IsCourseValid(int courseId) { Course course = GetAllCourses()[id]; TimeSpan difference = course.StartDate - DateTime.Now; + return difference.TotalDays < 7; + } + + // Method checks if a certain course is available for the student + public bool IsCourseAvailable(int courseId) + { + Course course = GetAllCourses()[courseId]; + TimeSpan difference = course.StartDate - DateTime.Now; if (difference.TotalDays < 7) { if (course.Online)