public ActionResult AlterarProjeto(CadProjeto projeto)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             throw new Exception("ModelState is invalid!");
         }
         ProjetosDao.AlterarProjeto(projeto);
         TempData["Mensagem"] = "Projeto alterado com sucesso...";
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         ViewBag.MensagemErro = ex.Message;
         return(View("_erro"));
     }
 }
Пример #2
0
        public ActionResult AlterarProjeto(CadProjeto projeto)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View());
                }

                ProjetosDao.AlterarProjeto(projeto);
                return(RedirectToAction("ListarProjetos"));
            }
            catch (Exception ex)
            {
                ViewBag.MensagemErro = ex.Message;
                return(View("_Erro"));
            }
        }