public override void Map(Data.Entities.Student source, ProfileModel target) { MapBasicStudentInfo(source, target); target.ProfilePhotoUrl = _profilePhotoUrlFetcher.GetProfilePhotoUrlOrDefault(source); MapStudentAddress(source, target); MapParentInformation(source, target); _studentAttendancePercentageMapper.Map(source.StudentSectionAttendanceEvents.ToList(), target); MapFlagCount(source, target); if (!source.StudentAcademicDetails.IsNullOrEmpty()) { target.AcademicDetail = _studentToAcademicDetailsMapper.Build(source); } MapProgramStatus(source, target); }
public virtual ActionResult Set(int id) { var student = _genericRepository.Get <Student>(s => s.StudentUSI == id); var profilePhotoUrl = _profilePhotoUrlFetcher.GetProfilePhotoUrlOrDefault(student); var sessionModels = GetAllSessionModels(); var defaultSessionListModel = new SessionListItemModel(); if (!sessionModels.IsNullOrEmpty()) { defaultSessionListModel = _sessionToSessionListItemModelMapper.Build(new SessionFilter(_genericRepository).FindSession(DateTime.Now)); } var currentlyEnrolledSections = GetCurrentlyEnrolledSectionsFor(id); var setModel = SetModel.CreateNewWith(student, profilePhotoUrl, sessionModels, defaultSessionListModel, currentlyEnrolledSections); return(View(setModel)); }
private AssessmentResultModel Result(int studentUsi, int?sessionId, int dayFrom = 1, int dayTo = 7) { var assessmentResultModel = new AssessmentResultModel(); if (sessionId != null) { var session = _genericRepository.Get <Session>(s => s.SessionIdentity == sessionId); var startDate = session.BeginDate.AddDays(dayFrom - 1); var endDate = session.BeginDate.AddDays(dayTo - 1); var studentAssessments = _assessmentRepository.GetAssessmentResults(studentUsi, startDate, endDate); assessmentResultModel = _studentAssessmentsToAssessmentResultModelMapper.Map(studentAssessments, startDate, endDate); assessmentResultModel.Session = session.SessionName; } var student = _genericRepository.Get <Student>(s => s.StudentUSI == studentUsi); var profilePhotoUrl = _profilePhotoUrlFetcher.GetProfilePhotoUrlOrDefault(student); assessmentResultModel.Update(student, profilePhotoUrl, sessionId, dayFrom, dayTo); return(assessmentResultModel); }