Beispiel #1
0
        public async Task <IActionResult> RemoverAnalise(NovaAnaliseViewModel modelo)
        {
            bool responsavel = _projetoRepo.VerificarResposavel(await ObterIdAsync().ConfigureAwait(false), modelo.ProjetoId);

            if (responsavel)
            {
                Analise analise = await _analiseRepo.BuscarAnalise(modelo.IdAnalise).ConfigureAwait(false);

                analise.Ativa = false;
                bool resultado = _analiseRepo.AlterarAnalise(analise);
                if (resultado)
                {
                    await _repoCola.RemoverColaboradores(modelo.IdAnalise);

                    TempData["msg"] = 10;
                    return(RedirectToAction("AcessarProjeto", "Projetos", new { Id = modelo.ProjetoId }));
                }
                TempData["msg"] = 11;
                return(RedirectToAction("AcessarProjeto", "Projetos", new { Id = modelo.ProjetoId }));
            }
            return(StatusCode(203));
        }