コード例 #1
0
        public bool CompartilharExame(string key)
        {
            var usuarioIdLogado = _usuarioAspNet.GetUsuarioId();
            var exameComp       = _exameCompRepository.ObterPorKey(key);

            if (exameComp == null)
            {
                AdicionarErroModelState("Exame não encontrado", "ExameService");
                return(false);
            }

            _exameCompRepository.AdicionarUsuario(key, usuarioIdLogado);
            _uow.Commit();
            return(!ExisteErrosNoModelState());
        }
コード例 #2
0
 public IActionResult Compartilhado(string id)
 {
     if (this.User.Identity.IsAuthenticated)
     {
         var exameComp = _exameCompRepository.ObterPorKey(id);
         var res       = _exameService.CompartilharExame(id);
         if (res)
         {
             return(RedirectToAction("VisualizarCompartilhado", new { id = exameComp.ExameId }));
         }
         return(RedirectToAction("Index", new { }));
     }
     else
     {
         return(RedirectToAction("Login", "Usuario"));
     }
 }