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());
        }
예제 #2
0
        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"));
            }
        }
예제 #3
0
        public JsonResult ObterPeloId(int id)
        {
            Tarefa tarefa = repository.ObterPeloId(id);

            return(Json(tarefa, JsonRequestBehavior.AllowGet));
        }