Пример #1
0
  public String addToDB(Context context) {
    ContentValues values = new ContentValues();
    openDB(context, true);
    if (this.getFkExercises().compareTo(-1) != 0)
      values.put(EXERCISE_COLUMN_FKEXERCISE, this.getFkExercises());
    if (this.getFkBody().compareTo(-1) != 0) values.put(EXERCISE_COLUMN_FKBODY, this.getFkBody());
    values.put(EXERCISE_COLUMN_VALUES, this.getValue());
    if (this.getSets().compareTo(-1) != 0) values.put(EXERCISE_COLUMN_SETS, this.getSets());
    if (this.getIterations().compareTo(-1) != 0)
      values.put(EXERCISE_COLUMN_ITERATION, this.getIterations());

    myHelper.writeData(values, "t_history");

    myHelper.close();
    return null;
  }