Пример #1
0
 public ActionResult Delete(AlunoModel model)
 {
     try
     {
         _servicoDeAluno.Excluir(model.Id);
         return RedirectToAction("Index");
     }
     catch
     {
         return View(model);
     }
 }
Пример #2
0
 public ActionResult Edit(AlunoModel model)
 {
     try
     {
         var aluno = Mapper.Map<Aluno>(model);
         _servicoDeAluno.Alterar(aluno);
         return RedirectToAction("Index");
     }
     catch
     {
         return View(model);
     }
 }
Пример #3
0
 public ActionResult Create(AlunoModel model)
 {
     try
     {
         var aluno = Mapper.Map<Aluno>(model);
         _servicoDeAluno.Adicionar(aluno);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }