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.");
            }
        }
Exemple #2
0
        private void btoEjecutar_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.txtRutaArchivoExaminar.Text == null)
                {
                    MessageBox.Show("Validacion: La ruta del archivo de carga no es valido");
                }

                string       LineaCaptura;
                StreamReader FileCaptura = new StreamReader(this.txtRutaArchivoExaminar.Text);
                Int64        y           = File.ReadAllLines(this.txtRutaArchivoExaminar.Text).Length;

                cls.FileEntity objEnt     = new cls.FileEntity("P_Departamento");
                bool           Encabezado = false;
                Int64          Regs       = 0;

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

                    if (Encabezado == false)
                    {
                        for (Int16 i = 0; i < strLineArzay.Length; i++)
                        {
                            cls.ColFileEntity objColEnt = new cls.ColFileEntity(i, strLineArzay[i]);
                            objEnt.ColumnsEntity.Add(objColEnt);
                        }
                        Encabezado = true;
                    }
                    else
                    {
                        cls.RowsFileEntity objRowEntity = new cls.RowsFileEntity(Regs);
                        objEnt.RowsEntity.Add(objRowEntity);
                        Regs++;

                        for (Int16 i = 0; i < strLineArzay.Length; i++)
                        {
                            cls.RowColFileEntity objRowColData = new cls.RowColFileEntity(i, strLineArzay[i]);
                            objRowEntity.Values.Add(objRowColData);
                        }
                    }
                }


                this.dtGridDatos.ColumnCount                = objEnt.ColumnsEntity.Count;
                this.dtGridDatos.ColumnHeadersVisible       = true;
                this.dtGridDatos.DefaultCellStyle.ForeColor = Color.Red;
                //Adjust

                int cont = 0;
                foreach (cls.ColFileEntity Col  in objEnt.ColumnsEntity)
                {
                    dtGridDatos.Columns[cont].Name = Col.NameCol;
                    cont++;
                }
                foreach (cls.RowsFileEntity rows in objEnt.RowsEntity)
                {
                    cont = 0;
                    string[] r = new string[rows.Values.Count];
                    foreach (cls.RowColFileEntity row in rows.Values)
                    {
                        r[cont] = row.Value;
                        cont++;
                    }
                    dtGridDatos.Rows.Add(r);
                }


                RobotSOA2GJv11.CapaSOA objSOA = new RobotSOA2GJv11.CapaSOA();
                objSOA.WS_GetEntityAsString("P_Departamento");
            }
            catch (Exception e1)
            {
                MessageBox.Show("Exception: " + e1.Message);
            }
            finally
            {
                Console.WriteLine("Executing finally block.");
            }
        }
        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.");
            }
        }