public DataView[] Buscar(string strToSearch, int intPage, int intRecordsByPage)
 {
     try
     {
         strToSearch = (strToSearch == string.Empty)?"%":"%" + strToSearch + "%";
         System.UInt32 Id = 0;
         if (HttpContext.Current.User.Identity.IsAuthenticated)
         {
             clsUsuario thisUser = new clsUsuario(HttpContext.Current.User.Identity.Name);
             Id       = thisUser.Id;
             thisUser = null;
         }
         clsUsuario Usuario = new clsUsuario();
         DataTable  dt      = Usuario.buscarByTexto(strToSearch, strToSearch, strToSearch, strToSearch);
         clsUtiles  Utiles  = new clsUtiles();
         DataView[] dv      = Utiles.getPagina(dt, intPage, intRecordsByPage);
         dv[1].RowFilter = "Id<>" + Id;
         Usuario         = null;
         Utiles          = null;
         return(dv);
     }
     catch (System.Exception Ex)
     {
         System.Diagnostics.Debug.WriteLine(Ex.ToString());
         throw new System.Exception("Error al realizar la búsqueda de los usuarios");
     }
 }
Example #2
0
 public DataView[] Buscar(string paramTema, string paramRespondidaPor, bool paramSoloMisConsultas, string strToSearch, int intPage, int intRecordsByPage)
 {
     try
     {
         strToSearch        = (strToSearch == string.Empty)?"%":"%" + strToSearch + "%";
         paramTema          = (paramTema == string.Empty)?"!=0":paramTema;
         paramRespondidaPor = (paramRespondidaPor == string.Empty)?"!=0":paramRespondidaPor;
         string     IdUsuarioMaestrante = "!=0";
         clsUsuario thisUser            = new clsUsuario(HttpContext.Current.User.Identity.Name);
         if (paramSoloMisConsultas & thisUser.RolePrincipal == System.Convert.ToString(clsUsuario.enuRolesName.Maestrante))
         {
             IdUsuarioMaestrante = "=" + System.Convert.ToString(thisUser.Id);
         }
         thisUser = null;
         clsConsulta Consulta = new clsConsulta();
         DataTable   dt       = Consulta.Buscar(paramTema, paramRespondidaPor, IdUsuarioMaestrante, strToSearch);
         clsUtiles   Utiles   = new clsUtiles();
         DataView[]  dv       = Utiles.getPagina(dt, intPage, intRecordsByPage);
         Utiles = null;
         return(dv);
     }
     catch (System.Exception Ex)
     {
         System.Diagnostics.Debug.WriteLine(Ex.ToString());
         throw new System.Exception("Error al realizar la búsqueda de las consultas");
     }
 }
Example #3
0
 public DataView[] getListaUsuarios(clsUsuario.enuRolesName role, int intPage, int intRecordsByPage)
 {
     try
     {
         clsUsuario Usuario = new clsUsuario();
         clsUtiles  Utiles  = new clsUtiles();
         DataView[] dv      = Utiles.getPagina(Usuario.getAllRecords(role), intPage, intRecordsByPage);
         Usuario = null;
         Utiles  = null;
         return(dv);
     }
     catch (System.Exception Ex)
     {
         throw new System.Exception("Imposible recuperar la lista de los usuarios.", Ex);
     }
 }