Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public static SetModel CreateNewWith(Data.Entities.Student student, string profilePhotoUrl, List<SessionListItemModel> sessions, SessionListItemModel session, List<Section.SectionListItemModel> currentlyEnrolledSections)
        {
            var setModel = new SetModel
            {
                StudentName = String.Join(" ", student.FirstName, student.LastSurname),
                StudentUsi = student.StudentUSI,
                ProfilePhotoUrl = profilePhotoUrl,
                Sessions = sessions,
                Session = session.SessionId,
                BeginDate = session.BeginDate,
                EndDate = session.EndDate,
                CurrentlyEnrolledSections = currentlyEnrolledSections
            };

            return setModel;
        }
Exemplo n.º 3
0
        public static SetModel CreateNewWith(Data.Entities.Student student, string profilePhotoUrl, List <SessionListItemModel> sessions, SessionListItemModel session, List <Section.SectionListItemModel> currentlyEnrolledSections)
        {
            var setModel = new SetModel
            {
                StudentName               = String.Join(" ", student.FirstName, student.LastSurname),
                StudentUsi                = student.StudentUSI,
                ProfilePhotoUrl           = profilePhotoUrl,
                Sessions                  = sessions,
                Session                   = session.SessionId,
                BeginDate                 = session.BeginDate,
                EndDate                   = session.EndDate,
                CurrentlyEnrolledSections = currentlyEnrolledSections
            };

            return(setModel);
        }