Example #1
0
        private void Ejecutar()
        {
            StringBuilder sbQuery = new StringBuilder();

            sbQuery.Append("select secuencia,linea,usuario,cia,time(fecha) as hora,date_format(fecha,'%d/%m/%Y') as fecha,");
            sbQuery.Append("message,programa");
            sbQuery.Append(" from errors");
            sbQuery.Append(" where secuencia = '" + txtNoError.Text + "'");
            MySqlConnection oCnn = new MySqlConnection(this.cCadenaConexion);
            MySqlCommand    oCmd = new MySqlCommand(sbQuery.ToString(), oCnn);
            MySqlDataReader Lector;

            oCnn.Open();
            Lector = oCmd.ExecuteReader();
            if (Lector.Read())
            {
                txtNoError.Text  = Lector.GetString("secuencia");
                txtCompania.Text = Convert.ToString(Lector.GetDecimal("cia"));
                //txtFecha.Text = Convert.ToString(registro["fecha"]);
                txtFecha.Text        = Convert.ToDateTime(Lector.GetString("fecha")).ToLongDateString();
                txtHora.Text         = Lector.GetString("hora");
                txtLinea.Text        = Lector.GetString("linea");;
                txtUsuario.Text      = Lector.GetString("usuario");;
                txtPrograma.Text     = Lector.GetString("programa");;
                txtMensajeError.Text = Lector.GetString("message");;
            }
            oCnn.Close();
        }
Example #2
0
        public void MetodoActualizarFicha(string IdFicha)
        {
            try
            {
                ConnectionBD  Puente;
                SqlCommand    Comando;
                SqlDataReader Lector;
                Puente  = new ConnectionBD();
                Comando = new SqlCommand("select * from Ficha where IdFicha='" + IdFicha + "'", Puente.RetornarConnexion());
                Lector  = Comando.ExecuteReader();


                while (Lector.Read())
                {
                    DocumentoInstructor = Lector.GetString(1);
                    IdPrograma          = Lector.GetString(2);
                    Jornada             = Lector.GetString(3);
                    FechaInicio         = Lector.GetDateTime(4);
                    FechaFin            = Lector.GetDateTime(5);
                    Estado = Lector.GetString(6);
                }
                a = IdPrograma.ToString();
                if (a == "")
                {
                    existe = 1;
                }
                Lector.Close();
                Comando.Dispose();
                Puente.CerrarConnexion();
            }

            catch (Exception ex)
            {
                MessageBox.Show("la ficha no existe");
            }
        }
Example #3
0
 // public string DocumentoInstructor,Nombre1,Apellido1,Direccion1,Telefono1,Celular1,Profesion1,Estado1;
 public void  MetodoInstructor(string DocumentoInstructor)
 {
     try
     {
         ConnectionBD  Puente;
         SqlCommand    Comando;
         SqlDataReader Lector;
         Puente  = new ConnectionBD();
         Comando = new SqlCommand("select * from Instructor where DocumentoInstructor='" + DocumentoInstructor + "'", Puente.RetornarConnexion());
         Lector  = Comando.ExecuteReader();
         while (Lector.Read())
         {
             Nombre    = Lector.GetString(1);
             Apellido  = Lector.GetString(2);
             Direccion = Lector.GetString(3);
             Telefono  = Lector.GetString(4);
             Celular   = Lector.GetString(5);
             Profesion = Lector.GetString(6);
             Estado    = Lector.GetString(7);
         }
         Nombre.ToString();
         Apellido.ToString();
         Direccion.ToString();
         Telefono.ToString();
         Celular.ToString();
         Profesion.ToString();
         Estado.ToString();
         Lector.Close();
         Comando.Dispose();
         Puente.CerrarConnexion();
     }
     catch (Exception ex)
     {
         MessageBox.Show("El Instructor no existe");
     }
 }