コード例 #1
0
 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())});
 }
コード例 #2
0
 // 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());
 }
コード例 #3
0
 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());
 }