public ActionResult Create(FormCollection collection) { try { Disciplina disciplina = new Disciplina(); disciplina.Descricao = collection["Descricao"]; DisciplinaDAO.Persistir(disciplina); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, FormCollection collection) { try { Disciplina disciplina = new Disciplina(); disciplina.Id = id; disciplina.Descricao = collection["Descricao"]; if (!DisciplinaDAO.Persistir(disciplina)) { return(View()); } return(RedirectToAction("Index")); } catch { return(View()); } }