Example #1
0
 private ContentValues tranValues(Transaction trans) {
   ContentValues newValue = new ContentValues();
   newValue.put("acct_id", trans.acct.ID);
   newValue.put("trans_id", trans.transID);
   newValue.put("serv_trans_id", trans.servTransID);
   newValue.put("type", trans.type);
   newValue.put("amt", trans.amt);
   newValue.put(
       "post_date", trans.postDate == null ? null : Long.toString(trans.postDate.getTime()));
   newValue.put(
       "init_date", trans.initDate == null ? null : Long.toString(trans.initDate.getTime()));
   newValue.put(
       "avail_date", trans.availDate == null ? null : Long.toString(trans.availDate.getTime()));
   return newValue;
 }
Example #2
0
  private ContentValues acctValues(Account acct) {
    ContentValues newValue = new ContentValues();

    if (acct.service != null) {
      if (acct.service.ID != 0) newValue.put("service_id", acct.service.ID);
    } else {
      if (acct.serviceId != 0) newValue.put("service_id", acct.serviceId);
    }
    newValue.put("name", acct.name);
    newValue.put(
        "last_update", acct.lastUpdate == null ? null : Long.toString(acct.lastUpdate.getTime()));
    newValue.put("curbal_amt", acct.curBalAmt);
    newValue.put(
        "curbal_date", acct.curBalDate == null ? null : Long.toString(acct.curBalDate.getTime()));
    newValue.put("availbal_amt", acct.availBalAmt);
    newValue.put(
        "availbal_date",
        acct.availBalDate == null ? null : Long.toString(acct.availBalDate.getTime()));
    newValue.put(
        "last_trans", acct.lastTrans == null ? null : Long.toString(acct.lastTrans.getTime()));
    return newValue;
  }
Example #3
0
 public ContentValues toContentValues() {
   ContentValues cv = new ContentValues();
   cv.put(Table.COLUMN_FILENAME, getFilename());
   if (getLocalUri() != null) {
     cv.put(Table.COLUMN_LOCAL_URI, getLocalUri().toString());
   }
   if (getImageUrl() != null) {
     cv.put(Table.COLUMN_IMAGE_URL, getImageUrl().toString());
   }
   if (getDateUploaded() != null) {
     cv.put(Table.COLUMN_UPLOADED, getDateUploaded().getTime());
   }
   cv.put(Table.COLUMN_LENGTH, getDataLength());
   cv.put(Table.COLUMN_TIMESTAMP, getTimestamp().getTime());
   cv.put(Table.COLUMN_STATE, getState());
   cv.put(Table.COLUMN_TRANSFERRED, transferred);
   cv.put(Table.COLUMN_SOURCE, source);
   cv.put(Table.COLUMN_DESCRIPTION, description);
   cv.put(Table.COLUMN_CREATOR, creator);
   cv.put(Table.COLUMN_MULTIPLE, isMultiple ? 1 : 0);
   return cv;
 }