Exemple #1
0
 /// <summary>
 /// Altera um atalho
 /// </summary>
 public async Task <Saida <Atalho> > AlterarAtalho(ManterAtalho entrada)
 {
     using (var content = new StringContent(entrada.ObterJson(), Encoding.UTF8, "application/json"))
     {
         return(await _httpClientHelper.FazerRequest <Saida <Atalho> >("atalho/alterar?idAtalho=" + entrada.Id, MetodoHttp.PUT, content));
     }
 }
Exemple #2
0
        public async Task <IActionResult> AlterarAtalho(ManterAtalho entrada)
        {
            if (entrada == null)
            {
                return(new FeedbackResult(new Feedback(TipoFeedback.Atencao, "As informações do atalho não foram preenchidas.", new[] { "Verifique se todas as informações do atalho foram preenchidas." }, TipoAcaoAoOcultarFeedback.Ocultar)));
            }

            var saida = await _proxy.AlterarAtalho(entrada);

            return(!saida.Sucesso
                ? new FeedbackResult(new Feedback(TipoFeedback.Erro, "Não foi possível alterar o atalho.", saida.Mensagens))
                : new FeedbackResult(new Feedback(TipoFeedback.Sucesso, saida.Mensagens.First(), tipoAcao: TipoAcaoAoOcultarFeedback.OcultarMoldais)));
        }