Exemple #1
0
        public IActionResult Cadastrar(Tarefa t, int dprResponsavel, int dprNomeStatus, int hdnJobId)
        {
            t.JobId             = hdnJobId;
            ViewBag.Responsavel = new SelectList(_funcionarioDAO.ListarFuncionarios(), "FuncionarioId", "NomeFuncionario");
            ViewBag.NomeStatus  = new SelectList(_statusDAO.ListarStatusPorNome(), "TipoStatusId", "NomeStatus");

            if (ModelState.IsValid)
            {
                t.Responsavel  = _funcionarioDAO.ListarFuncionariosPorId(dprResponsavel);
                t.StatusTarefa = _statusDAO.ListarStatusPorId(dprNomeStatus);
                _tarefaDAO.CadastrarNovaTarefa(t);
                return(View(t));
            }
            return(View(t));
        }