コード例 #1
0
  public SpeakerSeminarsWrapper getRecord(String urlLink, String id) {
    // TODO Auto-generated method stub
    SpeakerSeminarsWrapper _objSpeakerWrapper = null;

    String query =
        "Select * from  speakerSeminar where ClientCode=? and EventCode=? and _id=? and Title=?";

    Cursor c =
        dbAdapter.selectRecordsFromDB(
            query,
            new String[] {MyUIApplication.ClientCode, MyUIApplication.EventCode, id, urlLink});

    if (c.moveToFirst()) {
      do {
        _objSpeakerWrapper = new SpeakerSeminarsWrapper();

        _objSpeakerWrapper.id = c.getString(c.getColumnIndex("_id"));
        _objSpeakerWrapper.name = c.getString(c.getColumnIndex("name"));
        _objSpeakerWrapper.Title = c.getString(c.getColumnIndex("Title"));
        _objSpeakerWrapper.Day = c.getString(c.getColumnIndex("Day"));
        _objSpeakerWrapper.description = c.getString(c.getColumnIndex("description"));
        _objSpeakerWrapper.visited = c.getString(c.getColumnIndex("visited"));
        _objSpeakerWrapper.favourites = c.getString(c.getColumnIndex("favourites"));

      } while (c.moveToNext());
    }

    return _objSpeakerWrapper;
  }
コード例 #2
0
  public ArrayList<SpeakerSeminarsWrapper> getFavRecord() {
    ArrayList<SpeakerSeminarsWrapper> array = new ArrayList<SpeakerSeminarsWrapper>();

    String query1 =
        "Select  distinct title from  speakerSeminar where ClientCode=? and EventCode=? and favourites=?";

    Cursor c =
        dbAdapter.selectRecordsFromDB(
            query1, new String[] {MyUIApplication.ClientCode, MyUIApplication.EventCode, "true"});
    if (c.moveToFirst()) {
      do {
        String title = c.getString(c.getColumnIndex("Title"));

        String query = "Select * from  speakerSeminar where title=? limit 1";

        Cursor cursor = dbAdapter.selectRecordsFromDB(query, new String[] {title});
        if (cursor.moveToFirst()) {
          SpeakerSeminarsWrapper _objSpeakerWrapper = new SpeakerSeminarsWrapper();

          _objSpeakerWrapper.id = cursor.getString(cursor.getColumnIndex("_id"));
          _objSpeakerWrapper.name = cursor.getString(cursor.getColumnIndex("name"));
          _objSpeakerWrapper.Title = cursor.getString(cursor.getColumnIndex("Title"));
          _objSpeakerWrapper.Day = cursor.getString(cursor.getColumnIndex("Day"));
          _objSpeakerWrapper.description = cursor.getString(cursor.getColumnIndex("description"));
          _objSpeakerWrapper.visited = cursor.getString(cursor.getColumnIndex("visited"));
          _objSpeakerWrapper.favourites = cursor.getString(cursor.getColumnIndex("favourites"));

          array.add(_objSpeakerWrapper);
        }
      } while (c.moveToNext());
    }
    return array;
  }