コード例 #1
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;
 }
コード例 #2
0
 public Account getAccountFromCursor(Cursor cur) {
   Account acct = new Account();
   acct.ID = cur.getInt(0);
   acct.serviceId = cur.getInt(1);
   acct.name = cur.getString(2);
   String iAge = cur.getString(3);
   acct.lastUpdate = (iAge != null) ? new Date(Long.parseLong(iAge)) : null;
   acct.curBalAmt = cur.getDouble(4);
   iAge = cur.getString(5);
   acct.curBalDate = (iAge != null) ? new Date(Long.parseLong(iAge)) : null;
   acct.availBalAmt = cur.getDouble(6);
   iAge = cur.getString(7);
   acct.availBalDate = (iAge != null) ? new Date(Long.parseLong(iAge)) : null;
   iAge = cur.getString(8);
   acct.lastTrans = (iAge != null) ? new Date(Long.parseLong(iAge)) : null;
   return acct;
 }