From 80f95a228777ab949c79ab012ee5e47486453045 Mon Sep 17 00:00:00 2001 From: Darinka Loncar <149894872+darinkaloncar@users.noreply.github.com> Date: Sat, 30 Mar 2024 14:09:56 +0100 Subject: [PATCH 1/2] Revert "Revert "[Add] CourseController Class"" This reverts commit 9348012efc05ccdac2edcecba2ee179fa6947166. --- LangLang/Core/Controller/CourseController.cs | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 LangLang/Core/Controller/CourseController.cs diff --git a/LangLang/Core/Controller/CourseController.cs b/LangLang/Core/Controller/CourseController.cs new file mode 100644 index 00000000..276b6cc0 --- /dev/null +++ b/LangLang/Core/Controller/CourseController.cs @@ -0,0 +1,36 @@ +using LangLang.Core.Model; +using LangLang.Core.Model.DAO; + +namespace LangLang.Core.Controller +{ + public class CourseController + { + private readonly CoursesDAO _courses; + + public CourseController() + { + _courses = new CoursesDAO(); + } + + public List GetAllVehicles() + { + return _courses.GetAllCourses(); + } + + public void Add(Course course) + { + _courses.AddCourse(course); + } + + public void Delete(int courseId) + { + _courses.RemoveCourse(courseId); + } + + public void Subscribe(IObserver observer) + { + _courses.Subscribe(observer); + } + + } +} \ No newline at end of file From 35d521bef4c2bf425a2bd38a1e9f5a58c4469477 Mon Sep 17 00:00:00 2001 From: Darinka Loncar <149894872+darinkaloncar@users.noreply.github.com> Date: Sat, 30 Mar 2024 14:10:11 +0100 Subject: [PATCH 2/2] Revert "Revert "[Update] CourseController Class"" This reverts commit 03b60082906d8303168d7de92247951362bb5d9f. --- LangLang/Core/Controller/CourseController.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LangLang/Core/Controller/CourseController.cs b/LangLang/Core/Controller/CourseController.cs index 276b6cc0..747d103e 100644 --- a/LangLang/Core/Controller/CourseController.cs +++ b/LangLang/Core/Controller/CourseController.cs @@ -1,5 +1,7 @@ using LangLang.Core.Model; using LangLang.Core.Model.DAO; +using LangLang.Core.Observer; +using System.Collections.Generic; namespace LangLang.Core.Controller {