Esempio n. 1
0
        private void Agregar_Click(object sender, EventArgs e)
        {
            if (txtNombres.Text.Equals(string.Empty) || txtApellidos.Text.Equals(string.Empty) || txtNivelAcademico.Text.Equals(string.Empty) ||
                txtEspecializacion.Text.Equals(string.Empty) || cmbEstado.SelectedItem.ToString().Equals(string.Empty))
            {
                MessageBox.Show("Hay campos  obligatorios vacios.");
            }
            else
            {
                Maestro nuevoAlumno = new Maestro()
                {
                    Nombres         = txtNombres.Text,
                    Apellidos       = txtApellidos.Text,
                    Especializacion = txtEspecializacion.Text,
                    NivelAcademico  = txtNivelAcademico.Text,
                    estado          = cmbEstado.SelectedItem.ToString().Equals("Activo") ? true : false,
                };

                clsMaestro maestro = new clsMaestro();
                if (maestro.AgregarMaestro(nuevoAlumno))
                {
                    MessageBox.Show("Maestro Creado exitosamente");
                    Utilidades.limpiarControles(this);
                }
                else
                {
                    MessageBox.Show(maestro.Mensaje);
                }
            }
        }
Esempio n. 2
0
        private void CargarCombos()
        {
            List <Maestro> lstMaestros;
            clsMaestro     maestro = new clsMaestro();

            lstMaestros            = maestro.BuscarMaestros("");
            cmbMaestros.DataSource = lstMaestros;
        }
Esempio n. 3
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            clsMaestro     maestro  = new clsMaestro();
            List <Maestro> Maestros = null;

            Maestros = maestro.BuscarMaestros(txtNombre.Text);
            if (Maestros.Count() > 0)
            {
                dgBusquedaMaestro.DataSource = Maestros;
            }
        }