Beispiel #1
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");
     }
 }