public int updateGradebook(Gradebook gradebook) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues values = new ContentValues(); values.put(GRADETYPE, gradebook.getgrade_type()); if (gradebook.getparameters() != null) updateParameters(gradebook.getparameters()); return db.update( TABLE_GRADEBOOK, values, C_ID + "= ?", new String[] {String.valueOf(gradebook.getcid())}); }
// Adding a Gradebook public void addGradebook(Gradebook gradebook) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues values = new ContentValues(); values.put(C_ID, gradebook.getcid()); values.put(GRADETYPE, gradebook.getgrade_type()); db.insert(TABLE_GRADEBOOK, null, values); db.close(); addParameters(gradebook.getparameters()); }
public void deleteGradebook(Gradebook gradebook) { SQLiteDatabase db = this.getWritableDatabase(); db.delete(TABLE_GRADEBOOK, C_ID + "=?", new String[] {String.valueOf(gradebook.getcid())}); db.close(); deleteParameters(gradebook.getparameters()); }