Esempio n. 1
0
        public ActionResult IncluirTime(Models.Time time)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    _repTime = new Rep.TimeRepositorio();

                    if (_repTime.AdicionarTime(time))
                    {
                        ViewBag.Mensagem = "Time Cadastrado com sucesso!";
                    }
                    return(RedirectToAction("ObterTodos"));
                }
                return(View());
            }
            catch (Exception)
            {
                return(View("ObterTodos"));
            }
        }