protected void btnBuscar_OnClick(object sender, EventArgs e) { try { try { List <Usuario> usuarios = _servicioUsuarios.BuscarUsuarios(txtUserName.Text.Trim()); if (usuarios.Any()) { if (!_servicioUsuarios.ObtenerDetalleUsuario(usuarios.First().Id).Activo) { _servicioUsuarios.ReenviarActivacion(usuarios.First().Id); ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "ScriptOpen", "MostrarPopup(\"#modalRegistroExito\");", true); return; } Response.Redirect("~/FrmRecuperar.aspx?ldata=" + QueryString.Encrypt(usuarios.First().Id.ToString())); } else { throw new Exception("Usuario no valido !!!"); } } catch (Exception ex) { if (_lstError == null) { _lstError = new List <string>(); } _lstError.Add(ex.Message); Alerta = _lstError; } } catch (Exception ex) { if (_lstError == null) { _lstError = new List <string>(); } _lstError.Add(ex.Message); Alerta = _lstError; } }
protected void btnBuscar_OnClick(object sender, EventArgs e) { try { Usuario userData = _servicioUsuarios.BuscarUsuario(txtUserName.Text.Trim()); if (userData != null) { Response.Redirect("~/FrmRecuperar.aspx?ldata=" + QueryString.Encrypt(userData.Id.ToString())); } } catch (Exception ex) { if (_lstError == null) { _lstError = new List <string>(); } _lstError.Add(ex.Message); AlertaGeneral = _lstError; } }
protected void rbtnLstUsuarios_OnSelectedIndexChanged(object sender, EventArgs e) { try { if (!_servicioUsuarios.ObtenerDetalleUsuario(int.Parse(rbtnLstUsuarios.SelectedValue)).Activo) { throw new Exception("Debe primero confirmar su cuenta"); } Response.Redirect("FrmRecuperar.aspx?ldata=" + QueryString.Encrypt(rbtnLstUsuarios.SelectedValue)); //Response.Redirect("~/FrmRecuperar.aspx?ldata=" + QueryString.Encrypt(rbtnLstUsuarios.SelectedValue)); } catch (Exception ex) { if (_lstError == null) { _lstError = new List <string>(); } _lstError.Add(ex.Message); AlertaGeneral = _lstError; } }