public static List <Usuario> GetUsuarioListForSearch(string whereSql) { if (string.IsNullOrEmpty(whereSql)) { whereSql = "1 = 1"; } List <Usuario> theList = new List <Usuario>(); Usuario theUser = null; UsuarioTableAdapter theAdapter = new UsuarioTableAdapter(); try { UsuarioDS.UsuarioDataTable table = theAdapter.GetUsuarioForSearch(whereSql); if (table != null && table.Rows.Count > 0) { foreach (UsuarioDS.UsuarioRow row in table.Rows) { theUser = FillUserRecord(row); theList.Add(theUser); } } } catch (Exception q) { log.Error("el error ocurrio mientras obtenia la lista de los usuarios de la base de datos", q); return(null); } return(theList); }