示例#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();
     }
 }