コード例 #1
0
  public long insertNoPhoto(penjualanlogDTO _se) {
    this.insertStmt.bindString(1, _se.getUserId());
    this.insertStmt.bindString(2, _se.getCustName());
    this.insertStmt.bindString(3, _se.getAddress());
    this.insertStmt.bindString(4, _se.getRemark());
    this.insertStmt.bindString(5, _se.getTopId());
    this.insertStmt.bindString(6, _se.getDate());
    this.insertStmt.bindString(7, _se.getIdentitasTypeId());
    this.insertStmt.bindString(8, _se.getIdentitasName());
    this.insertStmt.bindString(9, _se.getIdentitasNo());
    this.insertStmt.bindString(10, _se.getBirthday());
    this.insertStmt.bindString(11, _se.getExpiredDate());
    //		this.insertStmt.bindString(12, _se.getPictureName());
    //		this.insertStmt.bindBlob(13, _se.getIdentitasPicture());

    return this.insertStmt.executeInsert();
  }
コード例 #2
0
  public ArrayList<penjualanlogDTO> selectByUser(String user_id) {
    ArrayList<penjualanlogDTO> list = new ArrayList<penjualanlogDTO>();
    Cursor cursor =
        this.db.query(
            TABLE_NAME,
            new String[] {
              "id"
                  + ", user_id"
                  + ", cust_name"
                  + ", address"
                  + ", remark"
                  + ", top_id"
                  + ", date"
                  + ", identitas_type_id"
                  + ", identitas_name"
                  + ", identitas_no"
                  + ", birthday"
                  + ", expired_date"
                  + ", picture_name"
                  + ", identitas_picture"
            },
            "user_id=?",
            new String[] {String.valueOf(user_id)},
            null,
            null,
            "date asc");
    if (cursor.moveToFirst()) {
      do {
        penjualanlogDTO jd = new penjualanlogDTO();
        jd.setId(cursor.getLong(0));
        jd.setUserId(cursor.getString(1));
        jd.setCustName(cursor.getString(2));
        jd.setAddress(cursor.getString(3));
        jd.setRemark(cursor.getString(4));
        jd.setTopId(cursor.getString(5));
        jd.setDate(cursor.getString(6));
        jd.setIdentitasTypeId(cursor.getString(7));
        jd.setIdentitasName(cursor.getString(8));
        jd.setIdentitasNo(cursor.getString(9));
        jd.setBirthday(cursor.getString(10));
        jd.setExpiredDate(cursor.getString(11));
        jd.setPictureName(cursor.getString(12));
        jd.setIdentitasPicture(cursor.getBlob(13));

        list.add(jd);
      } while (cursor.moveToNext());
    }
    if (cursor != null && !cursor.isClosed()) {
      cursor.close();
    }
    return list;
  }