From db0b128447372ec9d5db44eecbe1c435984a337b Mon Sep 17 00:00:00 2001 From: Natasa Kasikovic~ Date: Tue, 2 Apr 2024 23:02:20 +0200 Subject: [PATCH] [Update] Enhanced the search to filter as text is typed --- LangLang/Core/Model/DAO/TutorDAO.cs | 4 ++-- LangLang/View/DirectorGUI/DirectorWindow.xaml | 17 ++++++++--------- .../View/DirectorGUI/DirectorWindow.xaml.cs | 16 +++++----------- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/LangLang/Core/Model/DAO/TutorDAO.cs b/LangLang/Core/Model/DAO/TutorDAO.cs index cbb01f51..ac8b4870 100644 --- a/LangLang/Core/Model/DAO/TutorDAO.cs +++ b/LangLang/Core/Model/DAO/TutorDAO.cs @@ -43,8 +43,8 @@ public Dictionary Search(TutorController tutorController, DateTime d Dictionary allTutors = tutorController.GetAllTutors(); Dictionary filteredTutors = allTutors.Where(tutor => - (date == default || tutor.Value.EmploymentDate == date) && - (language == "" || tutor.Value.Skill.Language.Any(skill => skill == language)) && + (date == default || tutor.Value.EmploymentDate.Date == date.Date) && + (language == "" || tutor.Value.Skill.Language.Any(skill => skill.Contains(language))) && (level == null || tutor.Value.Skill.Level.Any(skilll => skilll == level))).ToDictionary(x => x.Key, x => x.Value); diff --git a/LangLang/View/DirectorGUI/DirectorWindow.xaml b/LangLang/View/DirectorGUI/DirectorWindow.xaml index 19c4d6e3..bb0ee71a 100644 --- a/LangLang/View/DirectorGUI/DirectorWindow.xaml +++ b/LangLang/View/DirectorGUI/DirectorWindow.xaml @@ -29,11 +29,11 @@ - + - + - + - + @@ -103,14 +103,13 @@ - + -