From 9004a4475e1722d0b89201d62663fad71c3b798a Mon Sep 17 00:00:00 2001 From: Natasa Kasikovic~ Date: Sun, 28 Apr 2024 16:36:38 +0200 Subject: [PATCH] [Add] an attribute indicating whether exam registration is possible --- LangLang/Core/Model/ExamSlot.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/LangLang/Core/Model/ExamSlot.cs b/LangLang/Core/Model/ExamSlot.cs index aae1ba7e..c7e31314 100644 --- a/LangLang/Core/Model/ExamSlot.cs +++ b/LangLang/Core/Model/ExamSlot.cs @@ -8,16 +8,15 @@ public class ExamSlot: ISerializable, Overlapable public int Id { get; set; } public string Language { get; set; } public LanguageLevel Level { get; set; } - public int TutorId { get; set; } - public TimeSlot TimeSlot { get; set; } public int MaxStudents { get; set; } + public bool ApplicationPossible { get; set; } // NOTE: if possible don't save number of registeredStudents, ask the database. If not, then add attribute. - public ExamSlot(int id, string language, LanguageLevel level, TimeSlot timeSlot, int maxStudents, int tutorId) + public ExamSlot(int id, string language, LanguageLevel level, TimeSlot timeSlot, int maxStudents, int tutorId, bool applicationPossible) { Id = id; Language = language; @@ -25,6 +24,7 @@ public ExamSlot(int id, string language, LanguageLevel level, TimeSlot timeSlot, TutorId = tutorId; TimeSlot = timeSlot; MaxStudents = maxStudents; + ApplicationPossible = applicationPossible; } public ExamSlot() { } @@ -38,6 +38,7 @@ public string[] ToCSV() TutorId.ToString(), // TODO: add serialization for timeSlot when implemented MaxStudents.ToString(), + ApplicationPossible.ToString() }; } @@ -49,6 +50,7 @@ public void FromCSV(string[] values) TutorId = int.Parse(values[3]); // TODO: add deserialization for timeSlot when implemented MaxStudents = int.Parse(values[6]); + ApplicationPossible = bool.Parse(values[7]); } } }