public ActionResult ViewEditar(int id) { ConvenioDAO dao = new ConvenioDAO(); ViewBag.Convenio = dao.BuscaPorId(id); return(View()); }
public ActionResult Remover(int id) { ConvenioDAO dao = new ConvenioDAO(); Convenio convenio = dao.BuscaPorId(id); dao.Remover(convenio); return(RedirectToAction("Index", "Convenio")); }
public ActionResult Editar(int id, Convenio convenio) { ConvenioDAO dao = new ConvenioDAO(); Convenio conv = dao.BuscaPorId(id); conv.ConvenioNome = convenio.ConvenioNome; dao.Atualiza(conv); return(RedirectToAction("Index", "Convenio")); }