Exemple #1
0
        public override void Map(IList <Data.Entities.StudentSectionAttendanceEvent> source, ProfileModel target)
        {
            var schoolYear = _sessionFilter.FindSession(DateTime.Now.Date).SchoolYear;
            var attendanceForCurrentSchoolYear = source.Where(ssae => ssae.SchoolYear == schoolYear).ToList();

            var presents = attendanceForCurrentSchoolYear.Count(ae =>
                                                                ae.AttendanceEventCategoryDescriptorId == (int)AttendanceEventCategoryDescriptorEnum.InAttendance ||
                                                                ae.AttendanceEventCategoryDescriptorId == (int)AttendanceEventCategoryDescriptorEnum.Earlydeparture ||
                                                                ae.AttendanceEventCategoryDescriptorId == (int)AttendanceEventCategoryDescriptorEnum.ExcusedAbsence);

            target.AttendancePercentage = CalculateAttedancePercentage(presents, attendanceForCurrentSchoolYear);
        }
Exemple #2
0
        public virtual ActionResult Week(int studentUsi, int?sessionId, int dayFrom = 1, int dayTo = 7)
        {
            if (sessionId == null)
            {
                var currentSession = _sessionFilter.FindSession(DateTime.Now);
                if (currentSession != null)
                {
                    sessionId = currentSession.SessionIdentity;
                }
            }


            var assessmentResultModel = Result(studentUsi, sessionId, dayFrom, dayTo);

            return(View(assessmentResultModel));
        }