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()); } }
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"); } }
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"); } }
// 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"); } }