Example usage for com.mongodb BasicDBList get

List of usage examples for com.mongodb BasicDBList get

Introduction

In this page you can find the example usage for com.mongodb BasicDBList get.

Prototype

public Object get(final String key) 

Source Link

Document

Gets a value at an index.

Usage

From source file:achmad.rifai.admin.ui.Sampah.java

private void loadJurnal(Db d) throws Exception {
    javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
            new String[] { "Kode", "No", "Tanggal", "Keterangan", "Debit", "Kredit" }, 0) {
        @Override/*www .ja v a 2 s  . c om*/
        public boolean isCellEditable(int row, int column) {
            return false;
        }
    };
    tblJurnal.setModel(m);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("jurnal").find();
    while (c.hasNext()) {
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) c.next().get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        achmad.rifai.erp1.entity.Jurnal j = new achmad.rifai.erp1.entity.Jurnal(json);
        if (j.isDeleted())
            m.addRow(new Object[] { j.getKode(), j.getNo(), j.getTgl(), j.getKet(), j.getDebit(),
                    j.getKredit() });
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void loadIncome(Db d) throws Exception {
    javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
            new String[] { "KODE", "Tanggal", "Jurnal", "Jumlah" }, 0) {
        @Override/*  ww w  .j ava2s .co m*/
        public boolean isCellEditable(int row, int column) {
            return false;
        }
    };
    tblIncome.setModel(m);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("terima").find();
    while (c.hasNext()) {
        com.mongodb.DBObject o = c.next();
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) o.get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        achmad.rifai.erp1.entity.Terima t = new achmad.rifai.erp1.entity.Terima(json);
        if (t.isDeleted())
            m.addRow(new Object[] { t.getKode(), t.getTgl(), t.getJurnal(), t.getUang() });
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void loadKaryawan(Db d) throws Exception {
    javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(new String[] { "ID", "NAMA",
            "PASSWORD", "TANGGAL DITERIMA", "JABATAN", "E-MAIL", "TELP", "DICEKAL?", "SEDANG LOGIN?" }, 0) {
        @Override//from www .  j a  v  a  2 s . c  o  m
        public boolean isCellEditable(int row, int column) {
            return false;
        }
    };
    tblKaryawan.setModel(m);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("karyawan").find();
    while (c.hasNext()) {
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) c.next().get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        achmad.rifai.erp1.entity.Karyawan k = new achmad.rifai.erp1.entity.Karyawan(json);
        if (k.isDeleted())
            m.addRow(new Object[] { k.getId(), k.getNama(), k.getPass(), k.getHiredate(), k.getJabatan(),
                    k.getEmail(), k.getTelp(), k.isBlocked(), k.isMasuk() });
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void loadExpenses(Db d) throws Exception {
    javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
            new String[] { "KODE", "JURNAL", "TANGGAL", "UANG" }, 0) {
        @Override/*from w ww.j  av a  2s.  c o  m*/
        public boolean isCellEditable(int row, int column) {
            return false;
        }
    };
    tblKeluar.setModel(m);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("keluar").find();
    while (c.hasNext()) {
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) c.next().get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        achmad.rifai.erp1.entity.Keluar k = new achmad.rifai.erp1.entity.Keluar(json);
        if (k.isDeleted())
            m.addRow(new Object[] { k.getKode(), k.getJurnal(), k.getTgl(), k.getUang() });
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void loadLedger(Db d) throws Exception {
    javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
            new String[] { "Kode", "Tanggal", "Ket", "No", "Debit", "Kredit" }, 0) {
        @Override/*w  w  w  .  j a v  a 2 s . c  o m*/
        public boolean isCellEditable(int row, int column) {
            return false;
        }
    };
    tblLedger.setModel(m);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("ledger").find();
    while (c.hasNext()) {
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) c.next().get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        achmad.rifai.erp1.entity.Ledger l = new achmad.rifai.erp1.entity.Ledger(json);
        if (l.isDeleted())
            m.addRow(new Object[] { l.getKode(), l.getTgl(), l.getKet(), l.getNo(), l.getDebit(),
                    l.getKredit() });
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void loadPelanggan(Db d) throws Exception {
    javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
            new String[] { "Kode", "Nama", "Dicekal" }, 0) {
        private Class[] c = new Class[] { String.class, String.class, Boolean.class };

        @Override//from w  w  w . j  a  va  2  s .co  m
        public Class<?> getColumnClass(int x) {
            return c[x];
        }

        @Override
        public boolean isCellEditable(int row, int column) {
            return false;
        }
    };
    tblPelanggan.setModel(m);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("pelanggan").find();
    while (c.hasNext()) {
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) c.next().get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        achmad.rifai.erp1.entity.Pelanggan p = new achmad.rifai.erp1.entity.Pelanggan(json);
        if (p.isDeleted())
            m.addRow(new Object[] { p.getKode(), p.getNama(), p.isBlocked() });
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void loadPembelian(Db d) throws Exception {
    javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
            new String[] { "STRUK", "SUPLIER", "TANGGAL", "UANG YANG DIKELUARKAN" }, 0) {
        @Override// ww  w .j a v  a  2 s  . c  om
        public boolean isCellEditable(int row, int column) {
            return false;
        }
    };
    tblPembelian.setModel(m);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("pembelian").find();
    while (c.hasNext()) {
        com.mongodb.DBObject o = c.next();
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) o.get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        achmad.rifai.erp1.entity.Pembelian p = new achmad.rifai.erp1.entity.Pembelian(json);
        if (p.isDeleted())
            m.addRow(new Object[] { p.getStruk(), p.getSuplier(), p.getTgl(), p.getHarga() });
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void loadPenjualan(Db d) throws Exception {
    javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
            new String[] { "Nota", "Pelanggan", "Tanggal", "Total", "UANG YANG DIBAYAR", "Keterangan" }, 0) {
        @Override//  ww w .j  av a 2s .c o m
        public boolean isCellEditable(int row, int column) {
            return false;
        }
    };
    tblPenjualan.setModel(m);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("penjualan").find();
    while (c.hasNext()) {
        com.mongodb.DBObject o = c.next();
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) o.get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        achmad.rifai.erp1.entity.Penjualan p = new achmad.rifai.erp1.entity.Penjualan(json);
        if (p.isDeleted())
            m.addRow(new Object[] { p.getNota(), p.getPelanggan(), p.getTgl(), p.getTotal(), p.getTerbayar(),
                    p.getKet() });
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void loadPesan(Db d) throws Exception {
    javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
            new String[] { "Kode", "Isi Pesan", "Pengirim", "Waktu" }, 0) {
        @Override/*w  ww. j  a  va2s . com*/
        public boolean isCellEditable(int row, int column) {
            return false;
        }
    };
    tblPesan.setModel(m);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("pesan").find();
    while (c.hasNext()) {
        com.mongodb.DBObject o = c.next();
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) o.get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        achmad.rifai.erp1.entity.Pesan p = new achmad.rifai.erp1.entity.Pesan(json);
        if (p.isDeleted())
            m.addRow(new Object[] { p.getKode(), p.getPesan(), p.getPengirim(), p.getWaktu() });
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void loadSuplier(Db d) throws Exception {
    javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
            new String[] { "Kode", "Nama" }, 0) {
        @Override//from  w  w w  . j  a  v  a  2s . c o  m
        public boolean isCellEditable(int row, int column) {
            return false;
        }
    };
    tblSuplier.setModel(m);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("suplier").find();
    while (c.hasNext()) {
        com.mongodb.DBObject o = c.next();
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) o.get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        achmad.rifai.erp1.entity.Suplier s = new achmad.rifai.erp1.entity.Suplier(json);
        if (s.isDeleted())
            m.addRow(new Object[] { s.getKode(), s.getNama() });
    }
}