예제 #1
0
 public IActionResult Edit(Aluno aluno)
 {
     if (ModelState.IsValid)
     {
         _alunoBll.AtualizarAluno(aluno);
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View());
     }
 }
예제 #2
0
        public IActionResult Edit(
            [Bind(nameof(Aluno.Id), nameof(Aluno.Sexo), nameof(Aluno.Email), nameof(Aluno.Nascimento))]
            Aluno aluno)
        {
            aluno.Nome = alunoBll.GetAlunos().Single(a => a.Id == aluno.Id).Nome;

            if (ModelState.IsValid)
            {
                //AlunoBLL alunoBll = new AlunoBLL();
                alunoBll.AtualizarAluno(aluno);
                return(RedirectToAction("Index"));
            }
            {
                return(View(aluno));
            }
        }
예제 #3
0
 public IActionResult Edit([Bind(
                                nameof(Aluno.Id),
                                nameof(Aluno.Sexo),
                                nameof(Aluno.Email),
                                nameof(Aluno.Nascimento),
                                nameof(Aluno.Nome),
                                nameof(Aluno.Foto),
                                nameof(Aluno.Texto))]
                           Aluno aluno)
 {
     if (ModelState.IsValid)
     {
         _alunoBll.AtualizarAluno(aluno);
         return(RedirectToAction("Index"));
     }
     return(View(aluno));
 }