Example #1
0
        private void Btn_agregar_Click(object sender, EventArgs e)
        {
            FrmAlumno frmAlumno = new FrmAlumno();

            frmAlumno.ShowDialog();
            bool a = miCatedra + frmAlumno.Alumno;

            if (frmAlumno.DialogResult == DialogResult.OK)
            {
                this.ActualizarListadoAlumnos();
            }
        }
Example #2
0
        private void btn_modificar_Click(object sender, EventArgs e)
        {
            int index = listBox_alumnos.SelectedIndex;

            if (index >= 0)
            {
                FrmAlumno frmAlumno = new FrmAlumno(miCatedra.Alumnos[index]);

                frmAlumno.ShowDialog();

                if (frmAlumno.DialogResult == DialogResult.OK)
                {
                    miCatedra.Alumnos.RemoveAt(index);
                    miCatedra.Alumnos.Insert(index, frmAlumno.Alumno);

                    ActualizarListadoAlumnos();
                }
            }
        }