private void btnAgregar_Click(object sender, EventArgs e) { bool seSumo = false; FrmAlumno formAlumno = new FrmAlumno(); formAlumno.ShowDialog(); formAlumno.StartPosition = FormStartPosition.CenterScreen; formAlumno.FormBorderStyle = FormBorderStyle.FixedSingle; if (formAlumno.DialogResult == DialogResult.OK) { seSumo = this.miCatedra + formAlumno.MiAlumno; this.ActualizarListadoAlumnos(); } }
private void modificar_Click(object sender, EventArgs e) { int index = this.lista.SelectedIndex; if (this.lista.Enabled == true && index >= 0) { FrmAlumno frm = new FrmAlumno(); frm.legajo.Text = cat.Alumnos[index].Legajo.ToString(); frm.nombre.Text = cat.Alumnos[index].Nombre; frm.apellido.Text = cat.Alumnos[index].Apellido; frm.tipoExamen.Text = cat.Alumnos[index].Examen.ToString(); frm.legajo.Enabled = false; frm.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { cat.Alumnos[index] = frm.Alum; ActualizarListadoAlumnos(); } } }
private void btnModificar_Click(object sender, EventArgs e) { FrmAlumno frmAlumno = new FrmAlumno(); if (this.lbxAlumnos.SelectedIndex != -1) { frmAlumno.Modificar(miCatedra.GetAlumnos[this.lbxAlumnos.SelectedIndex]); frmAlumno.StartPosition = FormStartPosition.CenterScreen; frmAlumno.FormBorderStyle = FormBorderStyle.FixedSingle; frmAlumno.ShowDialog(); if (frmAlumno.DialogResult == DialogResult.OK) { miCatedra.GetAlumnos[this.lbxAlumnos.SelectedIndex] = frmAlumno.MiAlumno; ActualizarListadoAlumnos(); } } }
private void Agregar_Click(object sender, EventArgs e) { this.modificar.Enabled = false; FrmAlumno frm = new FrmAlumno(); frm.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { if (cat + frm.Alum) { MessageBox.Show(Alumno.Mostrar(frm.Alum)); ActualizarListadoAlumnos(); } else { MessageBox.Show("Error mismo legajo"); } } }