public ActionResult Create(PessoaModel pessoaModel) { if (ModelState.IsValid) { pessoaModel.Create(pessoaModel); return(RedirectToAction("Index")); } else { return(View("Create")); } }
public ActionResult Cadastro(Pessoa pessoa) { if (ModelState.IsValid) { using (PessoaModel model = new PessoaModel()) { model.Create(pessoa); } return(View("Resultado", pessoa)); } return(View(pessoa)); }
public ActionResult Create(FormCollection form) { string Nome = form["Nome"]; string Email = form["Email"]; string Senha = form["Senha"]; DateTime DataNascimento = DateTime.Parse(form["DataNascimento"]); Pessoa p = new Pessoa(); p.Nome = Nome; p.Email = Email; p.Senha = Senha; p.DataNascimento = DataNascimento; PessoaModel model = new PessoaModel(); model.Create(p); return(RedirectToAction("Dashboard")); }