예제 #1
0
        public IActionResult Create()
        {
            var model = new QnAsViewModel();

            model.ExameList = _exameService.GetAllExame();
            return(View(model));
        }
        public IActionResult AtendeExame()
        {
            var model = new AtendeExameViewModel();

            LoginViewModel sessionObj = HttpContext.
                                        Session.Get <LoginViewModel>("loginvm");

            if (sessionObj != null)
            {
                model.EstudanteId = Convert.ToInt32(sessionObj.Id);
                model.QnAs        = new List <QnAsViewModel>();
                var exameDeHoje = _exameService.GetAllExame().
                                  Where(a => a.DataInicio.Date == DateTime.Today.Date).FirstOrDefault();
                if (exameDeHoje != null)
                {
                    model.Menssagem = "Nenhum exame para hoje";
                }
                else
                {
                    if (!_qnAsService.IsExameAttendet(exameDeHoje.Id, model.EstudanteId))
                    {
                        model.QnAs      = _qnAsService.GetAllQnAByExame(exameDeHoje.Id).ToList();
                        model.ExameNome = exameDeHoje.Titulo;
                        model.Menssagem = "";
                    }
                    else
                    {
                        model.Menssagem = "Você já fez esse exame";
                    }
                }
                return(View(model));
            }
            return(RedirectToAction("Login", "Account"));
        }
예제 #3
0
 public IActionResult Index(int pageNumber = 1, int pageSize = 10)
 {
     return(View(_exameService.GetAllExame(pageNumber, pageSize)));
 }