Beispiel #1
0
        public async Task <IActionResult> Create([Bind("id,cpf,nome,dataNascimento,telefone,email,ativo")] Aluno aluno)
        {
            if (ModelState.IsValid)
            {
                _context.Add(aluno);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(aluno));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("id,turma,periodo,idioma,sala,nivel,periodo_conclusao")] Turma turma)
        {
            if (ModelState.IsValid)
            {
                _context.Add(turma);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(turma));
        }
        public async Task <IActionResult> Create([Bind("id,cpf,nome,dataNascimento,email,telefone")] Professor professor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(professor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(professor));
        }