public ActionResult ExcluirConfirmado(int id) { var appDisciplina = new DisciplinaAplicacao(); appDisciplina.Excluir(id); return(RedirectToAction("Visualizar")); }
public ActionResult DeleteConfirmed(int id) { try { var deleteDisciplina = appDisciplina.ListarPorId(id.ToString()); appDisciplina.Excluir(deleteDisciplina); ExibeMensagem('S', 3); return(RedirectToAction("Index")); } catch (System.Exception e) { if (e.InnerException.InnerException.Message.IndexOf("FK_gesc_disciplinaturma_gesc_disciplina_DIS_IN_CODIGO") > -1) { ExibeMensagem('D', 51); } else { ExibeMensagem('D', 51); } return(RedirectToAction("Index")); } }