public static void MostrarNombre(string nombre)
 {
     try
     {
         ConnectionBD Puente;
         Puente = new ConnectionBD();
         SqlCommand Commando = new SqlCommand("select * from Aprendiz where NombreAprendiz='" + nombre + "'", Puente.RetornarConnexion());
         da = new SqlDataAdapter(Commando);
         ds = new DataSet();
     }
     catch (Exception)
     {
     }
 }
Example #2
0
 public static void MostrarTipoProceso(string TipoProceso)
 {
     try
     {
         ConnectionBD Puente;
         Puente = new ConnectionBD();
         SqlCommand Commando = new SqlCommand("select * from  Proceso where TipoProceso='" + TipoProceso + "'", Puente.RetornarConnexion());
         da = new SqlDataAdapter(Commando);
         ds = new DataSet();
     }
     catch (Exception)
     {
     }
 }
Example #3
0
 public static void MostrarDocumentoAprendiz(string DocumentoAprendiz)
 {
     try
     {
         ConnectionBD Puente;
         Puente = new ConnectionBD();
         SqlCommand Commando = new SqlCommand("select * from  Proceso where DocumentoAprendiz='" + DocumentoAprendiz + "'", Puente.RetornarConnexion());
         da = new SqlDataAdapter(Commando);
         ds = new DataSet();
     }
     catch (Exception)
     {
     }
 }
Example #4
0
 public static void MostrarFechaRadicacion(string FechaRadicacion)
 {
     try
     {
         ConnectionBD Puente;
         Puente = new ConnectionBD();
         SqlCommand Commando = new SqlCommand("select * from  Proceso where FechaRadicacion='" + FechaRadicacion + "'", Puente.RetornarConnexion());
         da = new SqlDataAdapter(Commando);
         ds = new DataSet();
     }
     catch (Exception)
     {
     }
 }
 public static void MostrarDataGrid()
 {
     try
     {
         ConnectionBD Puente;
         Puente = new ConnectionBD();
         SqlCommand Commando = new SqlCommand("select * from Instructor", Puente.RetornarConnexion());
         da = new SqlDataAdapter(Commando);
         ds = new DataSet();
     }
     catch (Exception)
     {
     }
 }
 public static void FiltrarDatos(String DocumentoInstructor)
 {
     try
     {
         ConnectionBD Puente;
         Puente = new ConnectionBD();
         SqlCommand Commando = new SqlCommand("select * from Instructor where DocumentoInstructor='" + DocumentoInstructor + "'", Puente.RetornarConnexion());
         da = new SqlDataAdapter(Commando);
         ds = new DataSet();
     }
     catch (Exception)
     {
     }
 }
Example #7
0
 public static void MetodoMostrarFichas(string IdFichas)
 {
     try
     {
         ConnectionBD Puente;
         Puente = new ConnectionBD();
         SqlCommand Commando = new SqlCommand("select * from Ficha where IdFicha='" + IdFicha + "'", Puente.RetornarConnexion());
         da = new SqlDataAdapter(Commando);
         ds = new DataSet();
     }
     catch (Exception)
     {
     }
 }
Example #8
0
 public static void MostrarEstadoFicha(string ACTIVO)
 {
     try
     {
         ConnectionBD Puente;
         Puente = new ConnectionBD();
         SqlCommand Commando = new SqlCommand("select * from  Ficha where Estado='" + ACTIVO + "'", Puente.RetornarConnexion());
         da = new SqlDataAdapter(Commando);
         ds = new DataSet();
     }
     catch (Exception)
     {
     }
 }
Example #9
0
        private void BtnIngresar_Click(object sender, EventArgs e)
        {
            try
            {
                if (Revisar() == 0)
                {
                    MetodoIngresarProceso.TipoProceso         = ComboBoxTipoProceso.Text.ToUpper();
                    MetodoIngresarProceso.DateFecha           = DateFecha.Value;
                    MetodoIngresarProceso.DateFechaRadicacion = DateFechaRadicacion.Value;
                    MetodoIngresarProceso.TipoNovedad         = ComboBoxTipoNovedad.Text.ToUpper();
                    MetodoIngresarProceso.ConceptoNovedad     = TxtConceptoNovedad.Text.ToUpper();
                    MetodoIngresarProceso.DocumentoAprendiz   = TxtDocAprendiz.Text.ToUpper();
                    MetodoIngresarProceso.IngresarProceso(MetodoIngresarProceso.IdProceso,
                                                          MetodoIngresarProceso.TipoProceso, MetodoIngresarProceso.DateFecha,
                                                          MetodoIngresarProceso.FechaRadicacion, MetodoIngresarProceso.TipoNovedad,
                                                          MetodoIngresarProceso.ConceptoNovedad, MetodoIngresarProceso.DocumentoAprendiz);
                }
                else
                {
                    MessageBox.Show("Faltan campos por llenar", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    Limpiar();
                }
            }


            catch (Exception ex)
            { MessageBox.Show("Error" + ex.ToString()); }
            if (Revisar() == 0)
            {
                try
                {
                    Puente               = new ConnectionBD();
                    comando1             = new SqlCommand();
                    comando1.CommandText = "ActualizarEstado";
                    comando1.CommandType = CommandType.StoredProcedure;
                    comando1.Parameters.AddWithValue("@documentoaprendiz", TxtDocAprendiz.Text);
                    //comando.Parameters.AddWithValue("@idBicicletasRecibido", txtidBicicleta.Text);
                    //comando.Parameters.AddWithValue("@cantidadRecibida", Int32.Parse(txtCantidad.Text));
                    comando1.Connection = Puente.RetornarConnexion();
                    comando1.ExecuteNonQuery();
                    MessageBox.Show("ACTUALIZACION EXITOSA");
                    //textBox1.Text = comando.CommandText;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Faltan campos por llenar", "Advertencia" + ex, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                Limpiar();
            }
        }
Example #10
0
 public static void IngresarAprendiz(string NombreDocumento, string DocumentoAprendiz, string Ficha, string NombreAprendiz, string ApellidoAprendiz, DateTime FechaNacimiento1, string Direccion, string Telefono, string Celular, string Correo, string CelularContacto, string Estado, string Genero)
 {
     try
     {
         SqlCommand   Commando;
         ConnectionBD Puente;
         Puente   = new ConnectionBD();
         Commando = new SqlCommand("insert into Aprendiz(DocumentoAprendiz,IdFicha,NombreDocumento,NombreAprendiz,ApellidoAprendiz,Direccion,Telefono,Celular,Correo,FechaNacimiento,CelularContacto,Estado,Genero) values('" + DocumentoAprendiz + "','" + Ficha + "','" + NombreDocumento + "','" + NombreAprendiz + "','" + ApellidoAprendiz + "','" + Direccion + "','" + Telefono + "','" + Celular + "','" + Correo + "','" + FechaNacimiento1 + "','" + CelularContacto + "','" + Estado + "','" + Genero + "');", Puente.RetornarConnexion());
         Commando.ExecuteNonQuery();
         //MessageBox.Show(""+Commando.ExecuteNonQuery());
         Commando.Dispose();
     }
     catch (Exception ex)
     {
         MessageBox.Show("INGRESO ERRONEO" + ex);
     }
 }
Example #11
0
        public static void IngresarPrograma(String NumeroPrograma, String NombrePrograma, String TipoPrograma, String AreaPrograma)
        {
            try
            {
                SqlCommand   Commando;
                ConnectionBD Puente;
                Puente   = new ConnectionBD();
                Commando = new SqlCommand("insert into Programas(IdPrograma,Nombre,Tipo,Area) values('" + NumeroPrograma.ToUpper() + "','" + NombrePrograma.ToUpper() + "','" + TipoPrograma.ToUpper() + "','" + AreaPrograma.ToUpper() + "')", Puente.RetornarConnexion());
                Commando.ExecuteNonQuery();

                MessageBox.Show("INGRESO EXITOSO");
                Commando.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show("INGRESO ERRONEO");
            }
        }
Example #12
0
        public void Actualizar(string DocumentoInstructor, String Nombre1, String Apellido1, String Direccion1, String Telefono1, String Celular1, String Profesion1, String Estado1)
        {
            try
            {
                SqlCommand   Comando1;
                ConnectionBD Puente;
                Puente   = new ConnectionBD();
                Comando1 = new SqlCommand("Update Instructor set NombreInstructor='" + Nombre1.ToUpper() + "',ApellidoInstructor='" + Apellido1.ToUpper() + "',Direccion='" + Direccion1 + "',Telefono='" + Telefono1 + "',Celular='" + Celular1 + "',Profesion='" + Profesion1.ToUpper() + "',Estado='" + Estado1.ToUpper() + "' where DocumentoInstructor='" + DocumentoInstructor + "'", Puente.RetornarConnexion());
                Comando1.ExecuteNonQuery();

                MessageBox.Show("ACTUALIZACIÓN EXITOSA");
                Comando1.Dispose();
                Puente.CerrarConnexion();
            }
            catch (Exception ex)
            {
                MessageBox.Show("ACTUALIZACIÓN ERRONEA" + ex.ToString());
            }
        }
Example #13
0
        public void Actualizar(string IdFicha, String DocumentoInstructor1, String IdPrograma1, String Jornada1, DateTime FechaInicio, DateTime FechaFin, String Estado1)
        {
            try
            {
                SqlCommand   Comando1;
                ConnectionBD Puente;
                Puente = new ConnectionBD();

                Comando1 = new SqlCommand("Update Ficha set DocumentoInstructor='" + DocumentoInstructor1.ToUpper() + "',IdPrograma='" + IdPrograma1.ToUpper() + "',Jornada='" + Jornada1 + "',FechaInicio='" + FechaInicio + "',FechaFin='" + FechaFin + "',Estado='" + Estado1.ToUpper() + "' where IdFicha='" + IdFicha + "'", Puente.RetornarConnexion());
                Comando1.ExecuteNonQuery();

                MessageBox.Show("ACTUALIZACIÓN EXITOSA");
                Comando1.Dispose();
                Puente.CerrarConnexion();
            }
            catch (Exception ex)
            {
                MessageBox.Show("El dato ingresado no existe");
            }
        }
Example #14
0
        public static void IngresarInstructor(String Documento, String Nombre, String Apellido, String Direccion, String Telefono, String Celular, String Profesion, String Estado)
        {
            try
            {
                SqlCommand   Commando;
                ConnectionBD Puente;
                Puente   = new ConnectionBD();
                Commando = new SqlCommand("insert into Instructor(DocumentoInstructor,NombreInstructor,ApellidoInstructor,Direccion,Telefono,Celular,Profesion,Estado)  values('" + Documento.ToUpper() + "','"
                                          + Nombre.ToUpper() + "','" + Apellido.ToUpper() + "','"
                                          + Direccion.ToUpper() + "','" + Telefono.ToUpper() + "','" + Celular.ToUpper()
                                          + "','" + Profesion.ToUpper() + "','" + Estado + "')", Puente.RetornarConnexion());
                Commando.ExecuteNonQuery();

                MessageBox.Show("INGRESO EXITOSO");
                Commando.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show("INGRESO ERRONEO");
            }
        }
Example #15
0
        //public static void IngresarProceso(String TxtNumeroProceso, DateTime DateFecha,DateTime FechaRadicacion, String ComboBoxTipoProceso, String ComboBoxTipoNovedad, String TxtConceptoNovedad, String TxtDocAprendiz)
        public static void IngresarProceso(string idProceso, string tipoProceso, DateTime dateFecha, string fechaRadicacion, string tipoNovedad, string conceptoNovedad, string documentoAprendiz)
        {
            try
            {
                SqlCommand   Commando;
                ConnectionBD Puente;
                Puente   = new ConnectionBD();
                Commando = new SqlCommand("insert into Proceso(TipoProceso,Fecha,FechaRadicacion,TipoNovedad,ConceptoNovedad,DocumentoAprendiz) values('"
                                          + TipoProceso.ToUpper() + "','" + DateFecha + "','" + DateFechaRadicacion + "','" + TipoNovedad.ToUpper() +
                                          "','" + ConceptoNovedad.ToUpper() + "','" + DocumentoAprendiz.ToUpper() + "')",
                                          Puente.RetornarConnexion());
                Commando.ExecuteNonQuery();

                MessageBox.Show("INGRESO EXITOSO");

                Commando.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show("INGRESO ERRONEO");
            }
        }
Example #16
0
        private void TxtDocAprendiz_Leave(object sender, EventArgs e)
        {
            ConnectionBD Puente;

            Puente = new ConnectionBD();
            SqlCommand Commando = new SqlCommand("select Genero from Aprendiz where DocumentoAprendiz= '" + TxtDocAprendiz.Text + "'", Puente.RetornarConnexion());

            lector = Commando.ExecuteReader();
            while (lector.Read())
            {
                label1.Text = lector.GetString(0);
                lector.NextResult();
            }
            lector.Close();
            if (label1.Text.Length == 0)
            {
                // MessageBox.Show("EL APRENDIZ NO ESTA REGISTRADO");
                Limpiar();
            }

            ConnectionBD Puente1;

            Puente1 = new ConnectionBD();
            SqlCommand Commando2 = new SqlCommand("select Estado from Aprendiz where DocumentoAprendiz= '" + TxtDocAprendiz.Text + "'", Puente.RetornarConnexion());

            lector1 = Commando2.ExecuteReader();
            while (lector1.Read())
            {
                Estado.Text = lector1.GetString(0);
                lector1.NextResult();
            }
            lector1.Close();
            if (Estado.Text.Equals("INACTIVO"))
            {
                MessageBox.Show("El aprendiz esta inactivo, no se le permite realizar el proceso", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                Limpiar();
            }
        }
Example #17
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 #18
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");
     }
 }