// GET: Pessoa/Details/5 public ActionResult Detalhes(int id) { try { PessoaModel pessoa = new PessoaModel(); return(View(pessoa.PessoaItem(id))); } catch (Exception ex) { ViewBag.mensagemErro = "Erro: " + ex.Message; return(RedirectToAction("Index", "Pessoa"));; } }
// GET: Pessoa/Create public ActionResult Cadastro(int id = 0) { try { if (id > 0) { PessoaModel pessoa = new PessoaModel(); return(View(pessoa.PessoaItem(id))); } else { return(View()); } } catch (Exception ex) { ViewBag.mensagemErro = "Erro: " + ex.Message; return(View()); } }
// GET: api/ListarPessoas/5 public PessoaModel Get(int id) { PessoaModel pessoa = new PessoaModel(); return(pessoa.PessoaItem(id)); }