// // GET: /Pais/Edit/5 public ActionResult Edit(int id) { PaisCtl ctl = new PaisCtl(); Pais pais = ctl.BuscaPorId(id); return(View(pais)); }
public ActionResult Edit(int id, Pais model) { try { PaisCtl ctl = new PaisCtl(); Pais pais = ctl.BuscaPorId(id); if (ModelState.IsValid) { pais = model; ctl.SalvarAlteracoes(); } return(RedirectToAction("Index")); } catch { return(View()); } }