public ActionResult Editar(int id) { Tarefa tarefa = repository.ObterPeloId(id); ViewBag.Tarefa = tarefa; UsuarioRepository usuarioRepository = new UsuarioRepository(); List <Usuario> usuarios = usuarioRepository.ObterTodos(); ViewBag.Usuario = usuarios; ProjetoRepository projetoRepository = new ProjetoRepository(); List <Projeto> projetos = projetoRepository.ObterTodos(); ViewBag.Projeto = projetos; CategoriaRepository categoriaRepository = new CategoriaRepository(); List <Categoria> categorias = categoriaRepository.ObterTodos(); ViewBag.Categoria = categorias; return(View()); }
public ActionResult Alterar(int id) { if (LoginController.retorno == true) { ViewBag.Tarefas = repository.ObterPeloId(id); CategoriaRepository categoriaRepository = new CategoriaRepository(); ViewBag.Categorias = categoriaRepository.ObterTodos(); UsuarioRepository usuarioRepository = new UsuarioRepository(); ViewBag.Usuarios = usuarioRepository.ObterTodos(); ProjetoRepository projetoRepository = new ProjetoRepository(); ViewBag.Projetos = projetoRepository.ObterTodos(); return(View()); } else { return(Redirect("/login")); } }
public JsonResult ObterPeloId(int id) { Tarefa tarefa = repository.ObterPeloId(id); return(Json(tarefa, JsonRequestBehavior.AllowGet)); }