Ejemplo n.º 1
0
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      View v = convertView;
      if (v == null) {
        LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        v = vi.inflate(R.layout.item_row, parent, false);
      }
      itemDTO o = items.get(position);
      if (o != null) {

        TextView tt = (TextView) v.findViewById(R.id.itemname);
        TextView bt = (TextView) v.findViewById(R.id.itemprices);
        TextView it = (TextView) v.findViewById(R.id.itemiccid);
        if (tt != null) {
          tt.setText("Name: " + o.getItem_name());
        }
        if (bt != null) {
          bt.setText("Prices: Rp. " + StringUtil.formatToCurrency(o.getPrice()));
        }
        if (it != null) {
          it.setText("ICCID:" + o.getIccid());
        }
      }
      return v;
    }
Ejemplo n.º 2
0
  public long insert(itemDTO itm) {
    final Calendar dd = Calendar.getInstance();
    SimpleDateFormat da = new SimpleDateFormat("yyyy-MM-dd");
    this.insertStmt.bindString(1, itm.getUser_id());
    this.insertStmt.bindString(2, String.valueOf(da.format(dd.getTime())));
    this.insertStmt.bindString(3, itm.getIccid());
    this.insertStmt.bindString(4, itm.getMdn());
    this.insertStmt.bindString(5, itm.getItem_name());
    this.insertStmt.bindString(6, itm.getItem_code());
    this.insertStmt.bindString(7, itm.getItem_group());
    this.insertStmt.bindString(8, itm.getPrice());
    this.insertStmt.bindString(9, itm.getItem_maping_id());
    this.insertStmt.bindString(10, itm.getPartner_id());
    this.insertStmt.bindString(11, "0");

    return this.insertStmt.executeInsert();
  }