예제 #1
0
 public long addOrUpdateCellGroup(CellGroup cellGroup) {
   ContentValues content = new ContentValues();
   content.put("status", cellGroup.getStatus());
   content.put("name", cellGroup.getName());
   content.put("type", cellGroup.getType());
   return addOrUpdate(cellGroup.getId(), CellGroup.NAME, content);
 }
예제 #2
0
 public int toggleCellGroup(CellGroup group) {
   ContentValues content = new ContentValues();
   content.put(
       "status",
       group.getStatus() == CellGroup.STATUS.ENABLED.getValue()
           ? CellGroup.STATUS.DISABLED.getValue()
           : CellGroup.STATUS.ENABLED.getValue());
   return getWritableDatabase().update(CellGroup.NAME, content, "id=" + group.getId(), null);
 }