Exemple #1
0
        public static void GenerateWord(HeaderRequisicao requisicao, EnviarEmail email)
        {
            Email = email;
            Uri       enderecoURL = new Uri("http://35.204.155.170:4321/generateWord");
            WebClient client      = new WebClient();

            client.Headers[HttpRequestHeader.ContentType] = "application/json";
            string body = JsonConvert.SerializeObject(requisicao);

            client.UploadStringCompleted += new UploadStringCompletedEventHandler(UploadCompleted);
            client.UploadStringAsync(enderecoURL, "POST", body);
        }
        public void PressEnviarEmail(object sender, EventArgs r)
        {
            this.IsEnabled          = false;
            BusyIndicator.IsRunning = true;
            HeaderRequisicao head        = new HeaderRequisicao();
            MontaString      montaString = new MontaString();

            head = montaString.MontaSaida(emails, relatorio);
            apiConnector connector = new apiConnector();

            apiConnector.GenerateWord(head, this);

            if (emails.Count > 0)
            {
                // cadastrar Emails
            }
        }