コード例 #1
0
 public void deleteTran(Account acct, String transID) {
   String[] args = {Integer.toString(acct.ID), transID};
   db.beginTransaction();
   try {
     db.delete("trans", "acct_id=? and trans_id=?", args);
     db.setTransactionSuccessful();
   } finally {
     db.endTransaction();
   }
 }
コード例 #2
0
 private void updateTran(Transaction trans) {
   db.beginTransaction();
   try {
     ContentValues newValue = tranValues(trans);
     String[] args = {Integer.toString(trans.ID)};
     db.update("trans", newValue, "_id=?", args);
     db.setTransactionSuccessful();
   } finally {
     db.endTransaction();
   }
 }
コード例 #3
0
 private void updateAccount(Account acct) {
   db.beginTransaction();
   try {
     ContentValues newValue = acctValues(acct);
     String[] args = {Integer.toString(acct.ID)};
     db.update("acct", newValue, "_id=?", args);
     db.setTransactionSuccessful();
   } finally {
     db.endTransaction();
   }
 }
コード例 #4
0
 private int addAccount(Account acct) {
   db.beginTransaction();
   int acct_id;
   try {
     ContentValues newValue = acctValues(acct);
     acct_id = (int) db.insertOrThrow("acct", "name", newValue);
     acct.ID = acct_id;
     db.setTransactionSuccessful();
   } finally {
     db.endTransaction();
   }
   return acct_id;
 }
コード例 #5
0
  private int addTran(Transaction trans) {
    db.beginTransaction();
    int tran_id;
    try {
      ContentValues newValue = tranValues(trans);
      tran_id = (int) db.insertOrThrow("trans", "acct_id", newValue);
      trans.ID = tran_id;

      db.setTransactionSuccessful();
    } finally {
      db.endTransaction();
    }
    return tran_id;
  }