public async Task <IActionResult> Edit(int id, [Bind("Id,Nome,Nascimento,NomeResponsavel,CpfResponsavel")] Aluno aluno) { if (id != aluno.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(aluno); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AlunoExists(aluno.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(aluno)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,DataMatricula")] Matricula matricula) { if (id != matricula.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(matricula); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MatriculaExists(matricula.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(matricula)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nome,Nascimento,CPF")] Professor professor) { if (id != professor.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(professor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProfessorExists(professor.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(professor)); }