Exemplo n.º 1
0
        private void btnMateria_Click(object sender, EventArgs e)
        {
            if (materia == null)
            {
                materia = new Ematerias();
            }

            materia.a           = "Buscar";
            materia.cod_materia = txtMateria.Text;
            materia.nombre      = txtMateria.Text;

            if (Acceso_Materias.BuscarMaterias(materia))
            {
                gvDatosMateria.DataSource = Acceso_Materias.datos;

                id_materia     = int.Parse(gvDatosMateria.CurrentRow.Cells["id_materia"].Value.ToString());
                txtCod.Text    = gvDatosMateria.CurrentRow.Cells["cod_materia"].Value.ToString();
                txtNom.Text    = gvDatosMateria.CurrentRow.Cells["nombre"].Value.ToString();
                txtDescri.Text = gvDatosMateria.CurrentRow.Cells["descripcion"].Value.ToString();
            }
            else
            {
                MessageBox.Show("ESTA MATERIA NO EXISTE", "PARA CONTINUAR:", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 2
0
        private void BtnVerTodos_Click(object sender, EventArgs e)
        {
            materia.a           = "Todos";
            materia.cod_materia = "";
            materia.nombre      = "";

            if (Acceso_Materias.BuscarMaterias(materia))
            {
                gvDatos.DataSource = Acceso_Materias.datos;
            }
            else
            {
                MessageBox.Show("NO SE ENCUENTRA ESTA MATERIA");
            }
        }
Exemplo n.º 3
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            materia.a           = "Buscar";
            materia.cod_materia = txtDescR.Text;
            materia.nombre      = txtDescR.Text;

            if (Acceso_Materias.BuscarMaterias(materia))
            {
                gvDatos.DataSource = Acceso_Materias.datos;
            }
            else
            {
                MessageBox.Show("NO SE ENCUENTRA ESTA MATERIA");
                txtDescR.Clear();
                txtDescR.Focus();
            }
        }