Beispiel #1
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            fileLocation();

            if (textBox1.Text.Length >= 5)
            {

                if (!checkOpen.Checked && !checkSent.Checked)
                {
                    MessageBox.Show("No seleccionaste ninguna opción", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }

                if (checkOpen.Checked)
                {
                    backgroundWorker1.ReportProgress(1);
                    DescargaOpen dop = new DescargaOpen();
                    dop.descargaOpen(textBox1.Text,backgroundWorker1);

                }
                if (checkSent.Checked)
                {
                    backgroundWorker1.ReportProgress(1);
                    DescargaOpen dop = new DescargaOpen();
                    dop.descargaSent(textBox1.Text,backgroundWorker1);

                }
                MessageBox.Show("Bases finalizadas", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

            }
            else
            {
                MessageBox.Show("Ingrese el JobID", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Beispiel #2
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            fileLocation();

                if (!checkOpen.Checked && !checkSent.Checked)
                {
                    MessageBox.Show("No seleccionaste ninguna opción", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }

                if (checkOpen.Checked)
                {
                    backgroundWorker1.ReportProgress(1);
                    DescargaOpen dop = new DescargaOpen();
                    String s = String.Empty;
                    String [] lista = (String [] )e.Argument;
                    for (int i = 0; i < lista.Count(); i++)
                    {
                        s = lista[i];
                        System.Console.WriteLine(s);
                        dop.descargaOpen(s, backgroundWorker1);
                        backgroundWorker1.ReportProgress(1);
                    }

                }
                if (checkSent.Checked)
                {
                    backgroundWorker1.ReportProgress(1);
                    DescargaOpen dop = new DescargaOpen();
                    String s = String.Empty;
                    String[] lista = (String[])e.Argument;
                    for (int i = 0; i < lista.Count(); i++)
                    {
                        s = lista[i];
                        System.Console.WriteLine(s);
                        dop.descargaSent(s, backgroundWorker1);
                        backgroundWorker1.ReportProgress(1);
                    }

                }
                MessageBox.Show("Bases finalizadas", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }