예제 #1
0
        private void btoReintento_Click(object sender, EventArgs e)
        {
            //int Contador = 0;

            try
            {
                //Abrir el archivo de captura.
                if (this.tbExaminar.Text == null)
                {
                    MessageBox.Show("Validacion: La ruta del archivo de carga no es valido");
                }

                string       LineaCaptura;
                StreamReader FileCaptura = new StreamReader(this.tbExaminar.Text);

                Int64 y = File.ReadAllLines(this.tbExaminar.Text).Length;
                RegTotal.Text = y.ToString();

                Int64 RegEje = 0;

                while ((LineaCaptura = FileCaptura.ReadLine()) != null)
                {
                    char     tmpChar      = '\t';
                    char[]   Separador    = new char[] { tmpChar };
                    string[] strLineArzay = LineaCaptura.Split(Separador, StringSplitOptions.RemoveEmptyEntries);


                    for (int i = 0; i < strLineArzay.Length; i++)
                    {
                        rtbResultado.Text += strLineArzay[i] + "\t";
                    }


                    KDBAsynch objAsy = new KDBAsynch(Convert.ToInt32(strLineArzay[2]), Convert.ToInt32(strLineArzay[0]));
                    objAsy.RunActualizacion(strLineArzay);

                    rtbResultado.Text += objAsy.Log + "\t";
                }
            }
            catch (Exception e1)
            {
                MessageBox.Show("Exception: " + e1.Message);
            }
            finally
            {
                Console.WriteLine("Executing finally block.");
            }
        }
예제 #2
0
        private void btoReintento_Click(object sender, EventArgs e)
        {
            //int Contador = 0;

            try
            {
                //Abrir el archivo de captura.
                if (this.tbExaminar.Text == null)
                {
                    MessageBox.Show("Validacion: La ruta del archivo de carga no es valido");
                }

                string       LineaCaptura;
                StreamReader FileCaptura = new StreamReader(this.tbExaminar.Text);

                Int64 y = File.ReadAllLines(this.tbExaminar.Text).Length;
                RegTotal.Text = y.ToString();

                Int64 RegEje = 0;

                if (this.chkLogActData.Checked)
                {
                    rtActData.Text += "IDCASE" + "\t" + "RADNUMBER" + "\t" + "IDTASK" + "\t" + "LOCK1" + "\t" + "ID" + "\t" + "TIPODOC" + "\t" + "NODOC" + "\t" + "NOMBRE" + "\t" + "DIRECCION" + "\t" + "LOCK2" + "\n";
                }


                while ((LineaCaptura = FileCaptura.ReadLine()) != null)
                {
                    char     tmpChar      = '\t';
                    char[]   Separador    = new char[] { tmpChar };
                    string[] strLineArzay = LineaCaptura.Split(Separador, StringSplitOptions.RemoveEmptyEntries);

                    for (int i = 0; i < strLineArzay.Length; i++)
                    {
                        rtbResultado.Text += strLineArzay[i] + "\t";
                    }

                    //PerformActivity
                    CapaSOA2GJ.CapaSOA2GJ objSOA = new CapaSOA2GJ.CapaSOA2GJ();
                    objSOA.PerformActivity("domain", "admon", Convert.ToInt32(strLineArzay[0]), Convert.ToInt32(strLineArzay[2]));


                    //Buscar soluciones en BDM.
                    if (this.chkAplicaBDC.Checked == true)
                    {
                        KDBAsynch objAsy = new KDBAsynch(Convert.ToInt32(strLineArzay[2]), objSOA.CodeAnswer, objSOA.DescriptionAnswer, Convert.ToInt32(strLineArzay[0]));
                        objAsy.RunSolution();
                        if (objAsy.Retry == true)
                        {
                            objSOA.PerformActivity("domain", "admon", Convert.ToInt32(strLineArzay[0]), Convert.ToInt32(strLineArzay[2]));
                        }

                        if (this.chkLogActData.Checked == true && objAsy.GenUpdData == true)
                        {
                            rtActData.Text += objAsy.LogUpdData.ToString();
                        }
                        rtbResultado.Text += objSOA.CodeAnswer + ":" + objSOA.DescriptionAnswer + "\t" + "True" + "\t" + objAsy.Retry.ToString() + "\t" + objAsy.Log.ToString() + "\n";
                    }
                    else
                    {
                        rtbResultado.Text += objSOA.CodeAnswer + ":" + objSOA.DescriptionAnswer + "\n";
                    }

                    RegEje            += 1;
                    RegEjecutados.Text = RegEje.ToString();

                    this.Update();
                }
            }
            catch (Exception e1)
            {
                MessageBox.Show("Exception: " + e1.Message);
            }
            finally
            {
                Console.WriteLine("Executing finally block.");
            }
        }