private void btnAddStudent_Click(object sender, EventArgs e) { Form1.Student AuxStudent = new Form1.Student(); AuxStudent.DNI = txtDNIstudent.Text; AuxStudent.name = txtNameStudent.Text; Principal.Estudiantes.Add(AuxStudent); }
private void btnValidateStudent_Click(object sender, EventArgs e) { Form1.Student AuxStudent = new Form1.Student(); AuxStudent = Principal.Estudiantes.Where(p => p.DNI == txtDNIStudent.Text).FirstOrDefault(); if (AuxStudent != null) { txtDisplayDNI.Text = AuxStudent.DNI; txtDisplayNombre.Text = AuxStudent.name; EstudianteActual = AuxStudent; } else { MessageBox.Show("el estudiante no exite"); txtDNIStudent.Focus(); } }