Exemplo n.º 1
0
 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;
     }
 }
Exemplo n.º 2
0
 protected void btnBuscar_OnClick(object sender, EventArgs e)
 {
     try
     {
         List <Usuario> usuarios = _servicioUsuarios.BuscarUsuarios(txtUserName.Text.Trim());
         rbtnLstUsuarios.DataSource     = usuarios;
         rbtnLstUsuarios.DataTextField  = "NombreCompleto";
         rbtnLstUsuarios.DataValueField = "Id";
         rbtnLstUsuarios.DataBind();
     }
     catch (Exception ex)
     {
         if (_lstError == null)
         {
             _lstError = new List <string>();
         }
         _lstError.Add(ex.Message);
         AlertaGeneral = _lstError;
     }
 }