예제 #1
0
        public ActionResult Create(Tarefa tarefa)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    TarefaDAO tarefasDatabase = new TarefaDAO();
                    tarefasDatabase.Salvar(tarefa);

                    return(Sucesso(tarefa));
                }
                catch (Exception ex)
                {
                    return(View(ex.ToString()));
                }
            }
            else
            {
                return(View(tarefa));
            }
        }