protected void btnBuscar_Click(object sender, EventArgs e) { this.lblErrorLegajo.Text = ""; this.lblError.Text = ""; if (this.txtLegajo.Text.Length < 4) { this.lblErrorLegajo.Text = "Mínimo 4 dígitos"; } else { try { int legajo = int.Parse(this.txtLegajo.Text); this.txtLegajo.Text = ""; UsuarioLogic ul = new UsuarioLogic(); Usuario user = ul.BuscarPorLegajo(legajo); if (user != null) { this.panelLegajo.Visible = false; this.lblCorreo.Text = "¿Es " + user.Persona.Email + " su correo?"; this.btnConfirmar.Text = "Confirmar"; this.panelCorreo.Visible = true; Session["userARecuperar"] = user; } else { this.lblError.Text = "No existe persona con legajo " + legajo; } } catch (Exception) { this.lblErrorLegajo.Text = "El legajo debe ser numérico"; } } }