public ActionResult Edit(ProjetoViewModel projeto) { if (ModelState.IsValid) { var projetoDomain = Mapper.Map<ProjetoViewModel, Projeto>(projeto); _projetoApp.Update(projetoDomain); return RedirectToAction("Index"); } return View(projeto); }
public ActionResult Create(ProjetoViewModel projeto) { if (ModelState.IsValid) { var projetoDomain = Mapper.Map<ProjetoViewModel, Projeto>(projeto); _projetoApp.Add(projetoDomain); return RedirectToAction("Index"); } ViewBag.IdPessoa = new SelectList(_pessoaApp.GetAll(), "IdPessoa", "Nome", projeto.IdPessoa); ViewBag.IdStatus = new SelectList(_statusApp.GetAll(), "IdPessoa", "Nome", projeto.IdStatus); ViewBag.Responsavel = new SelectList(_pessoaApp.GetAll(), "IdPessoa", "Nome", projeto.Responsavel); return View(projeto); }