Ejemplo n.º 1
0
        private async void btnAprovar_Click(object sender, EventArgs e)
        {
            Acompanhamento acompanhamento = await HttpAcompanhamento.GetBySolicitacaoId(idSolicitacao, usuarioLogado.token);

            BloqueiaCampos();
            this.Cursor = Cursors.WaitCursor;
            if (await HttpEmail.EnviarEmail(data, idSolicitacao, usuarioLogado.token))
            {
                acompanhamento.StatusId = ConstantesProjeto.STATUS_ANEXAR_NF;
                var acompanhamentoUpdate = await HttpAcompanhamento.Update(acompanhamento, acompanhamento.Id, usuarioLogado.token);

                DesbloqueiaCampos();
                this.Cursor = Cursors.Arrow;
                MessageBox.Show("Envio de e-mail feito com sucesso");
                if (acompanhamentoUpdate != null)
                {
                    this.Dispose();
                    frmPrecadastroEmail.Dispose();
                    frmAreaCoordenacao.AtualizaGridSolicitacoes();
                }
            }
            else
            {
                MessageBox.Show("Erro ao enviar e-mail");
                this.Dispose();
            }
        }