public void AddCourse(Course course) { if (Courses.Any(c => c.Id == course.Id)) { throw new Exception("Course already on teacher"); } Courses.Add(course); }
public void AddCourse(Course course) { if (Courses.Any(c => c.Id == course.Id)) { throw new InvalidOperationException($"Het vak {course.Description} is reeds toegevoegd."); } Courses.Add(course); }
public Evaluation(string description, EvaluationTemplate evaluationTemplate, Student student, DateTime evaluationDate, Course course, ICollection<EvaluationItem> evaluationItems, string generalComment, Guid bundleId, Class createdForClass) { Description = description; EvaluationTemplate = evaluationTemplate; Student = student; EvaluationDate = evaluationDate; Course = course; EvaluationItems = evaluationItems; GeneralComment = generalComment; BundleId = bundleId; CreatedForClass = createdForClass; EditAbleState = new EditableState(); }
public void AddNewEvaluations( string description, Class klas, EvaluationTemplate evaluationTemplate, DateTime evaluationDate, Course course) { Guid bundleId = Guid.NewGuid(); foreach (var student in klas.Students) { List<EvaluationItem> evaluationItems = new List<EvaluationItem>(); foreach (var subsection in evaluationTemplate.EvaluationSubSections) { foreach (Goal goal in subsection.Goals) { evaluationItems.Add(new EvaluationItem(goal, subsection)); } } AddEvaluation(new Evaluation(description, evaluationTemplate, student, evaluationDate, course, evaluationItems, "", bundleId,klas)); } }