Example #1
0
 public IActionResult Edit(int id)
 {
     try
     {
         ViewBag.PerfilUsuario = _httpContextAccessor.HttpContext.User.FindFirstValue(ClaimTypes.Role);
         var ret = _masculinoCadastroRepositorio.SelecionarPorId(id);
         ViewBag.VoluntarioMasculinoId = ret.MasculinoCadastroId;
         return(View(ret));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 private IActionResult VoluntarioMasculinoRetorno(int id)
 {
     try
     {
         var voluntarioCadastrado = _masculinoCadastroRepositorio.SelecionarPorId(id);
         ViewData["CadastroVoluntarioId"] = voluntarioCadastrado.MasculinoCadastroId;
         ViewData["CadastroNome"]         = voluntarioCadastrado.CadastroNome;
         ViewData["Estudos"] = new SelectList(_estudoRepositorio.SelecionarTodos(), "Id", "Nome");
         var result = _voluntarioEstudosRepositorio.SelecionarTodos().Where(x => x.VoluntarioId == voluntarioCadastrado.MasculinoCadastroId).ToList().OrderByDescending(y => y.DataEstudo);
         return(View(result));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }