public SpeakerWrapper getRecord(String _id) { SpeakerWrapper _objSpeakerWrapper = new SpeakerWrapper(); String query = "Select * from speakerList where ClientCode=? and EventCode=? and _id=?"; Cursor c = dbAdapter.selectRecordsFromDB( query, new String[] {MyUIApplication.ClientCode, MyUIApplication.EventCode, _id}); if (c.moveToFirst()) { do { _objSpeakerWrapper.id = c.getString(c.getColumnIndex("_id")); _objSpeakerWrapper.name = c.getString(c.getColumnIndex("name")); _objSpeakerWrapper.email = c.getString(c.getColumnIndex("email")); _objSpeakerWrapper.post = c.getString(c.getColumnIndex("post")); _objSpeakerWrapper.companyname = c.getString(c.getColumnIndex("companyname")); _objSpeakerWrapper.description = c.getString(c.getColumnIndex("description")); _objSpeakerWrapper.image = c.getString(c.getColumnIndex("image")); _objSpeakerWrapper.favourites = c.getString(c.getColumnIndex("favourites")); } while (c.moveToNext()); } return _objSpeakerWrapper; }
public ArrayList<SpeakerWrapper> getSortedRecord() { ArrayList<SpeakerWrapper> array = new ArrayList<SpeakerWrapper>(); String query = "Select * from speakerList where ClientCode=? and EventCode=? ORDER BY name ASC"; Cursor c = dbAdapter.selectRecordsFromDB( query, new String[] {MyUIApplication.ClientCode, MyUIApplication.EventCode}); if (c.moveToFirst()) { do { SpeakerWrapper _objSpeakerWrapper = new SpeakerWrapper(); _objSpeakerWrapper.id = c.getString(c.getColumnIndex("_id")); _objSpeakerWrapper.name = c.getString(c.getColumnIndex("name")); _objSpeakerWrapper.email = c.getString(c.getColumnIndex("email")); _objSpeakerWrapper.post = c.getString(c.getColumnIndex("post")); _objSpeakerWrapper.companyname = c.getString(c.getColumnIndex("companyname")); _objSpeakerWrapper.description = c.getString(c.getColumnIndex("description")); _objSpeakerWrapper.image = c.getString(c.getColumnIndex("image")); _objSpeakerWrapper.favourites = c.getString(c.getColumnIndex("favourites")); array.add(_objSpeakerWrapper); } while (c.moveToNext()); } return array; }