Пример #1
0
        } // fin boton

        private void button5_Click(object sender, EventArgs e)
        {
            richTextBox1.Text = string.Empty;
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                textBox42.Text = openFileDialog1.FileName;
                openFileDialog1.Dispose();
            }

            WS_ECUADOR.Integracion samir = new WS_ECUADOR.Integracion();  //Creamos el objeto samir



            //*************CONVERTIMOS EL ARCHIVO A BASE 64 y enviamos a Web Service***********************

            string archivo = textBox42.Text;

            byte[] bytes = File.ReadAllBytes(archivo);

            var resp = samir.Factura("1792433738001", "1792433738001_INT", "EQPCWF6Q7KRM", bytes, archivo);


            var timbre = samir.TimbresRestantes("1792433738001_INT", "EQPCWF6Q7KRM", "1792433738001");

            richTextBox1.Text = "La Cantidad de Folios restantes son:" + timbre.NrodeTickets;

            //***************************************************************************
        } // fin boton
Пример #2
0
        private void button11_Click(object sender, EventArgs e)
        {
            timer1.Start();
            button11.BackColor = Color.White;
            timer1.Enabled     = true;
            richTextBox1.Text  = string.Empty;
            richTextBox2.Text  = string.Empty;

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                textBox2.Text = openFileDialog1.FileName;
                openFileDialog1.Dispose();
            }



            WS_ECUADOR.Integracion samir = new WS_ECUADOR.Integracion();  //Creamos el objeto samir



            //*************CONVERTIMOS EL ARCHIVO A BASE 64 y enviamos a Web Service***********************

            string archivo = textBox2.Text;

            byte[] bytes = File.ReadAllBytes(archivo);



            var resp = samir.Factura("1792433738001", "1792433738001_INT", "EQPCWF6Q7KRM", bytes, archivo);

            richTextBox2.Text = "Procesando informacion,espere.....";
            MessageBox.Show("Enviada informacion");
            int rej = 0;

            while (rej < 650000)
            {
                rej++;
            }



            if (resp.Procesado == false)
            {
                richTextBox2.Text = "***********NO fue procesado*********" + "\n" + "Error Nro: " + resp.NumeroError + "\n" + "Menssaje: " + resp.MensajeError + "\n" + "Nro Autorización: " + resp.NrodeAutorizacion + "\n";
                timer1.Enabled    = false;
                timer1.Stop();
                button11.BackColor = Color.White;
            }
            else
            {
                richTextBox2.Text = "*********Mensaje recibido*******" + "\n" + "Error Nro: " + resp.NumeroError + "\n" + "Menssaje: " + resp.MensajeError + "\n" + "Nro Autorización: " + resp.NrodeAutorizacion + "\n";
                timer1.Enabled    = false;
                timer1.Stop();
                button11.BackColor = Color.White;
            }

            richTextBox1.Text = resp.XMLTimbrado;

            //var timbre = samir.TimbresRestantes("1792433738001_INT", "EQPCWF6Q7KRM", "1792433738001");
            //richTextBox1.Text = "La Cantidad de Folios restantes son:" + timbre.NrodeTickets;

            //***************************************************************************
        }