Beispiel #1
0
        private void btnProfesor_Click(object sender, EventArgs e)
        {
            if (profesor == null)
            {
                profesor = new Eprofesores();
            }

            profesor.a      = "Buscar";
            profesor.cedula = txtProfesor.Text;


            if (Accceso_Profesores.BuscarProfesores(profesor))
            {
                gvDatosProfesor.DataSource = Accceso_Profesores.datos;

                id_profesor      = int.Parse(gvDatosProfesor.CurrentRow.Cells["id_profesor"].Value.ToString());
                txtNombre.Text   = gvDatosProfesor.CurrentRow.Cells["nombre"].Value.ToString();
                txtApellido.Text = gvDatosProfesor.CurrentRow.Cells["apellido"].Value.ToString();
                txtCedula.Text   = gvDatosProfesor.CurrentRow.Cells["cedula"].Value.ToString();
                txtTel.Text      = gvDatosProfesor.CurrentRow.Cells["telefono"].Value.ToString();
                txtDire.Text     = gvDatosProfesor.CurrentRow.Cells["direccion"].Value.ToString();
            }
            else
            {
                MessageBox.Show("ESTE PROFESOR NO EXISTE", "PARA CONTINUAR:", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 private void BtnVerTodos_Click(object sender, EventArgs e)
 {
     profesor.a      = "TODOS";
     profesor.cedula = "";
     if (Accceso_Profesores.BuscarProfesores(profesor))
     {
         gvDatos.DataSource = Accceso_Profesores.datos;
     }
     else
     {
         MessageBox.Show("NO EXISTEN PROFESORES!");
     }
 }
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     profesor.a      = "Buscar";
     profesor.cedula = txtCedula.Text;
     if (Accceso_Profesores.BuscarProfesores(profesor))
     {
         gvDatos.DataSource = Accceso_Profesores.datos;
     }
     else
     {
         MessageBox.Show("NO SE ENCUENTRA ESTE PROFESOR");
         txtCedula.Clear();
         txtCedula.Focus();
     }
 }