Пример #1
0
        public ActionResult Edit(int id)
        {
            Tarefa tarefa = new Tarefa();

            try
            {
                TarefaDAO tarefasDatabase = new TarefaDAO();
                tarefa = tarefasDatabase.BuscarTarefa(id);
            }
            catch
            {
                return(View());
            }

            return(View(tarefa));
        }
Пример #2
0
        public ActionResult DoneTarefa(int id)
        {
            try
            {
                TarefaDAO tarefasDatabase = new TarefaDAO();
                Tarefa    tarefa          = tarefasDatabase.BuscarTarefa(id);
                tarefa.feita = true;

                tarefasDatabase.Editar(tarefa);

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                return(View(ex.ToString()));
            }

            return(RedirectToAction("Index"));
        }