private void btnAlumnoNuevo_Click(object sender, EventArgs e)
{
bool error = true;
if (!checkData(txtAlumnoNuevoNombre, lblAlumnoNuevoNombreError)) error = false;
if (!checkData(txtAlumnoNuevoApellido, lblAlumnoNuevoApellidoError)) error = false;
if (!checkData(txtAlumnoNuevoDNI, lblAlumnoNuevoDniError)) error = false;
if (!checkData(txtAlumnoNuevoLegajo, lblAlumnoNuevoLegajoError)) error = false;
if (!checkData(txtAlumnoNuevoDescripcion, lblAlumnoNuevoDescripcionError)) error = false;
if (txtAlumnoNuevoUsuario.Text.Length == 0)
{
error = false;
lblAlumnoNuevoUsuarioError.Text = "Seleccionar Usuario";
}
if (error)
{
if ((Alumno.Select("where DNI = " + txtAlumnoNuevoDNI.Text).Count == 0)&&(alumnoModificado.Nombre.Length != 0))
{
Alumno.Add(new Alumno(txtAlumnoNuevoNombre.Text, txtAlumnoNuevoApellido.Text, txtAlumnoNuevoLegajo.Text, txtAlumnoNuevoDNI.Text, nuevoUsuario.Id));
lblAlumnoNuevoError.Text = "ALUMNO GUARDADO CON EXITO ";
}
else
{
MessageBox.Show("El DNI del alumno ya existe");
}
}
}