public IActionResult Edit(Tarefa tarefa) { if (ModelState.IsValid) { TarefaRepo.Update(tarefa); return(RedirectToAction("Index")); } return(View(tarefa)); }
public IActionResult Delete(Tarefa tarefa) { Tarefa tar = TarefaRepo.GetTarefa(tarefa.Id_Tarefa); if (tar != null) { TarefaRepo.Delete(tarefa.Id_Tarefa); TempData["Message"] = "Tarefa " + tar.Descricao + " foi removida"; } return(RedirectToAction("Index")); }
public IActionResult Delete(long?id) { if (id == null) { return(BadRequest()); } Tarefa tarefa = TarefaRepo.GetTarefa(id.Value); if (tarefa == null) { return(NotFound()); } return(View(tarefa)); }
public IActionResult Edit(long?id) { if (id == null) { return(BadRequest()); } Tarefa tarefa = TarefaRepo.GetTarefa(id.Value); if (tarefa == null) { return(NotFound()); } ViewBag.Projetos = ProjetoRepo.ListarProjetos(); return(View(tarefa)); }
public IActionResult Create(Tarefa tarefa) { TarefaRepo.Add(tarefa); return(RedirectToAction("Index")); }
public IActionResult Index() { return(View(TarefaRepo.ListarTarefas())); }