Exemplo n.º 1
0
        public IActionResult Sessions()
        {
            var sessions = sessionsRepository.GetSessions().Select(x => sessionModelBuilder.Build(x, authTokenHelper.IsAdmin()));

            return(View(new SessionsModel
            {
                Sessions = sessions,
                AllowModify = authTokenHelper.IsAdmin()
            }));
        }
Exemplo n.º 2
0
        public IActionResult Voting(Guid sessionId)
        {
            var session = sessionsRepository.Get(sessionId);
            var events  = eventModelBuilder.BuildDateSorted(session.Events, sessionId, authTokenHelper.IsAdmin())
                          .ToList();

            if (!events.Any())
            {
                return(RedirectToAction("AddEvent", "Interaction", new { sessionId }));
            }

            return(View(new SessionModel
            {
                Events = events,
                SessionInfo = new SessionInfoModel
                {
                    SessionId = session.Id,
                    SessionCreateDate = session.CreateDate,
                    SessionName = session.Name
                }
            }));
        }