Example #1
0
        public IActionResult Cadastrar(Job j, int dprDptoResponsavel, int dprNomeStatus, int hdnProjetoId)
        {
            j.ProjetoId             = hdnProjetoId;
            ViewBag.DptoResponsavel = new SelectList(_departamentoDAO.ListarDepartamentos(), "DepartamentoId", "NomeDepartamento");
            ViewBag.NomeStatus      = new SelectList(_statusDAO.ListarStatusPorNome(), "TipoStatusId", "NomeStatus");

            if (ModelState.IsValid)
            {
                j.DptoResponsavel = _departamentoDAO.ListarDepartamentosPorId(dprDptoResponsavel);
                j.StatusJob       = _statusDAO.ListarStatusPorId(dprNomeStatus);
                _jobDAO.CadastrarNovoJob(j);
                return(View(j));
            }

            return(View(j));
        }