Exemple #1
0
        public DisciplineResultQueryList Handle(DisciplineInputListByEnrollment command)
        {
            var result      = new DisciplineResultQueryList();
            var disciplines = _DREP.GetByEnrollment(command.EnrollmentId);

            foreach (var discipline in disciplines)
            {
                var activities = _AREP.GetByDiscipline(command.StudentId, discipline.Id, new Shared.Semester(command.SemesterBegin, command.SemesterEnd)).ToList();
                var finalExam  = new Activity();
                if (activities.Count() > 0)
                {
                    finalExam = activities.SingleOrDefault(x => x.Value == 100);
                    activities.Remove(finalExam);
                }
                discipline.AddActivities(activities, finalExam.Grade, command.SemesterBegin, command.SemesterEnd);
            }
            result.Disciplines = disciplines;
            return(result);
        }