achmad.rifai.admin.ui.Sampah.java Source code

Java tutorial

Introduction

Here is the source code for achmad.rifai.admin.ui.Sampah.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package achmad.rifai.admin.ui;

import achmad.rifai.erp1.util.Db;

/**
 *
 * @author ai
 */
public class Sampah extends javax.swing.JDialog {
    private String id;
    private achmad.rifai.erp1.entity.BukuAbsen sAbsen;
    private achmad.rifai.erp1.entity.Barang sBarang;
    private achmad.rifai.erp1.entity.Rekening sAset;
    private achmad.rifai.erp1.entity.BulanBonus sBonus;
    private achmad.rifai.erp1.entity.Jabatan sJabatan;
    private achmad.rifai.erp1.entity.Jurnal sJurnal;
    private achmad.rifai.erp1.entity.Karyawan sKaryawan;
    private achmad.rifai.erp1.entity.Terima sTerima;
    private achmad.rifai.erp1.entity.Keluar sKeluar;
    private achmad.rifai.erp1.entity.Ledger sLedger;
    private achmad.rifai.erp1.entity.Pelanggan sPelanggan;
    private achmad.rifai.erp1.entity.Pembelian sPembelian;
    private achmad.rifai.erp1.entity.Penjualan sPenjualan;
    private achmad.rifai.erp1.entity.Pesan sPesan;
    private achmad.rifai.erp1.entity.Suplier sSuplier;
    private achmad.rifai.erp1.entity.Tracks sTracks;
    private achmad.rifai.erp1.entity.Tugas sTugas;

    /**
     * Creates new form Sampah
     */
    public Sampah(java.awt.Frame parent, boolean modal, String i) {
        super(parent, modal);
        id = i;
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblAbsen = new javax.swing.JTable();
        jScrollPane2 = new javax.swing.JScrollPane();
        tblBarang = new javax.swing.JTable();
        jScrollPane3 = new javax.swing.JScrollPane();
        tblAset = new javax.swing.JTable();
        jScrollPane4 = new javax.swing.JScrollPane();
        tblBonus = new javax.swing.JTable();
        jScrollPane5 = new javax.swing.JScrollPane();
        tblJabatan = new javax.swing.JTable();
        jScrollPane6 = new javax.swing.JScrollPane();
        tblJurnal = new javax.swing.JTable();
        jScrollPane7 = new javax.swing.JScrollPane();
        tblIncome = new javax.swing.JTable();
        jScrollPane8 = new javax.swing.JScrollPane();
        tblKaryawan = new javax.swing.JTable();
        jScrollPane9 = new javax.swing.JScrollPane();
        tblKeluar = new javax.swing.JTable();
        jScrollPane10 = new javax.swing.JScrollPane();
        tblLedger = new javax.swing.JTable();
        jScrollPane11 = new javax.swing.JScrollPane();
        tblPelanggan = new javax.swing.JTable();
        jScrollPane12 = new javax.swing.JScrollPane();
        tblPembelian = new javax.swing.JTable();
        jScrollPane13 = new javax.swing.JScrollPane();
        tblPenjualan = new javax.swing.JTable();
        jScrollPane14 = new javax.swing.JScrollPane();
        tblPesan = new javax.swing.JTable();
        jScrollPane15 = new javax.swing.JScrollPane();
        tblSuplier = new javax.swing.JTable();
        jScrollPane16 = new javax.swing.JScrollPane();
        tblPerilaku = new javax.swing.JTable();
        jScrollPane17 = new javax.swing.JScrollPane();
        tblTugas = new javax.swing.JTable();
        jTabbedPane2 = new javax.swing.JTabbedPane();
        jToolBar1 = new javax.swing.JToolBar();
        jButton1 = new javax.swing.JButton();
        rAbsen = new javax.swing.JButton();
        rBarang = new javax.swing.JButton();
        rAset = new javax.swing.JButton();
        rBonus = new javax.swing.JButton();
        rJabatan = new javax.swing.JButton();
        rJurnal = new javax.swing.JButton();
        rTerima = new javax.swing.JButton();
        rKaryawan = new javax.swing.JButton();
        rKeluar = new javax.swing.JButton();
        rLedger = new javax.swing.JButton();
        rPelanggan = new javax.swing.JButton();
        rPembelian = new javax.swing.JButton();
        jToolBar2 = new javax.swing.JToolBar();
        rPenjualan = new javax.swing.JButton();
        rPesan = new javax.swing.JButton();
        rSuplier = new javax.swing.JButton();
        rTracks = new javax.swing.JButton();
        rTugas = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Tempat Sampah");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }

            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        tblAbsen.setModel(
                new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblAbsen.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblAbsenMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tblAbsen);

        jTabbedPane1.addTab("Buku Absen", jScrollPane1);

        tblBarang
                .setModel(new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblBarang.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblBarangMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(tblBarang);

        jTabbedPane1.addTab("Barang", jScrollPane2);

        tblAset.setModel(
                new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblAset.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblAsetMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(tblAset);

        jTabbedPane1.addTab("Aset", jScrollPane3);

        tblBonus.setModel(
                new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblBonus.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblBonusMouseClicked(evt);
            }
        });
        jScrollPane4.setViewportView(tblBonus);

        jTabbedPane1.addTab("Bonus Pegawai", jScrollPane4);

        tblJabatan
                .setModel(new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblJabatan.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblJabatanMouseClicked(evt);
            }
        });
        jScrollPane5.setViewportView(tblJabatan);

        jTabbedPane1.addTab("Jabatan", jScrollPane5);

        tblJurnal
                .setModel(new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblJurnal.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblJurnalMouseClicked(evt);
            }
        });
        jScrollPane6.setViewportView(tblJurnal);

        jTabbedPane1.addTab("Jurnal", jScrollPane6);

        tblIncome
                .setModel(new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblIncome.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblIncomeMouseClicked(evt);
            }
        });
        jScrollPane7.setViewportView(tblIncome);

        jTabbedPane1.addTab("Pemasukan", jScrollPane7);

        tblKaryawan
                .setModel(new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblKaryawan.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblKaryawanMouseClicked(evt);
            }
        });
        jScrollPane8.setViewportView(tblKaryawan);

        jTabbedPane1.addTab("Karyawan", jScrollPane8);

        tblKeluar
                .setModel(new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblKeluar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblKeluarMouseClicked(evt);
            }
        });
        jScrollPane9.setViewportView(tblKeluar);

        jTabbedPane1.addTab("Expenses", jScrollPane9);

        tblLedger
                .setModel(new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblLedger.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblLedgerMouseClicked(evt);
            }
        });
        jScrollPane10.setViewportView(tblLedger);

        jTabbedPane1.addTab("Ledger", jScrollPane10);

        tblPelanggan
                .setModel(new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblPelanggan.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblPelangganMouseClicked(evt);
            }
        });
        jScrollPane11.setViewportView(tblPelanggan);

        jTabbedPane1.addTab("Pelanggan", jScrollPane11);

        tblPembelian
                .setModel(new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblPembelian.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblPembelianMouseClicked(evt);
            }
        });
        jScrollPane12.setViewportView(tblPembelian);

        jTabbedPane1.addTab("Pembelian", jScrollPane12);

        tblPenjualan
                .setModel(new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblPenjualan.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblPenjualanMouseClicked(evt);
            }
        });
        jScrollPane13.setViewportView(tblPenjualan);

        jTabbedPane1.addTab("Penjualan", jScrollPane13);

        tblPesan.setModel(
                new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblPesan.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblPesanMouseClicked(evt);
            }
        });
        jScrollPane14.setViewportView(tblPesan);

        jTabbedPane1.addTab("Pesan", jScrollPane14);

        tblSuplier
                .setModel(new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblSuplier.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblSuplierMouseClicked(evt);
            }
        });
        jScrollPane15.setViewportView(tblSuplier);

        jTabbedPane1.addTab("Suplier", jScrollPane15);

        tblPerilaku
                .setModel(new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblPerilaku.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblPerilakuMouseClicked(evt);
            }
        });
        jScrollPane16.setViewportView(tblPerilaku);

        jTabbedPane1.addTab("Perilaku", jScrollPane16);

        tblTugas.setModel(
                new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null } },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
        tblTugas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblTugasMouseClicked(evt);
            }
        });
        jScrollPane17.setViewportView(tblTugas);

        jTabbedPane1.addTab("Tugas", jScrollPane17);

        jToolBar1.setRollover(true);

        jButton1.setText("Kosongkan");
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton1);

        rAbsen.setText("Restore Buku Absen");
        rAbsen.setEnabled(false);
        rAbsen.setFocusable(false);
        rAbsen.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rAbsen.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rAbsen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rAbsenActionPerformed(evt);
            }
        });
        jToolBar1.add(rAbsen);

        rBarang.setText("Restore Barang");
        rBarang.setEnabled(false);
        rBarang.setFocusable(false);
        rBarang.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rBarang.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rBarang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rBarangActionPerformed(evt);
            }
        });
        jToolBar1.add(rBarang);

        rAset.setText("Restore Aset");
        rAset.setEnabled(false);
        rAset.setFocusable(false);
        rAset.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rAset.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rAset.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rAsetActionPerformed(evt);
            }
        });
        jToolBar1.add(rAset);

        rBonus.setText("Restore Bonus");
        rBonus.setEnabled(false);
        rBonus.setFocusable(false);
        rBonus.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rBonus.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rBonus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rBonusActionPerformed(evt);
            }
        });
        jToolBar1.add(rBonus);

        rJabatan.setText("Restore Jabatan");
        rJabatan.setEnabled(false);
        rJabatan.setFocusable(false);
        rJabatan.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rJabatan.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rJabatan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rJabatanActionPerformed(evt);
            }
        });
        jToolBar1.add(rJabatan);

        rJurnal.setText("Restore Jurnal");
        rJurnal.setEnabled(false);
        rJurnal.setFocusable(false);
        rJurnal.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rJurnal.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rJurnal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rJurnalActionPerformed(evt);
            }
        });
        jToolBar1.add(rJurnal);

        rTerima.setText("Restore Pemasukan");
        rTerima.setEnabled(false);
        rTerima.setFocusable(false);
        rTerima.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rTerima.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rTerima.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rTerimaActionPerformed(evt);
            }
        });
        jToolBar1.add(rTerima);

        rKaryawan.setText("Restore Karyawan");
        rKaryawan.setEnabled(false);
        rKaryawan.setFocusable(false);
        rKaryawan.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rKaryawan.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rKaryawan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rKaryawanActionPerformed(evt);
            }
        });
        jToolBar1.add(rKaryawan);

        rKeluar.setText("Restore Expenses");
        rKeluar.setEnabled(false);
        rKeluar.setFocusable(false);
        rKeluar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rKeluar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rKeluar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rKeluarActionPerformed(evt);
            }
        });
        jToolBar1.add(rKeluar);

        rLedger.setText("Restore Ledger");
        rLedger.setEnabled(false);
        rLedger.setFocusable(false);
        rLedger.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rLedger.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rLedger.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rLedgerActionPerformed(evt);
            }
        });
        jToolBar1.add(rLedger);

        rPelanggan.setText("Restore Pelanggan");
        rPelanggan.setEnabled(false);
        rPelanggan.setFocusable(false);
        rPelanggan.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rPelanggan.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rPelanggan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rPelangganActionPerformed(evt);
            }
        });
        jToolBar1.add(rPelanggan);

        rPembelian.setText("Restore Pembelian");
        rPembelian.setEnabled(false);
        rPembelian.setFocusable(false);
        rPembelian.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rPembelian.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rPembelian.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rPembelianActionPerformed(evt);
            }
        });
        jToolBar1.add(rPembelian);

        jTabbedPane2.addTab("Operation 1", jToolBar1);

        jToolBar2.setRollover(true);

        rPenjualan.setText("Restore Penjualan");
        rPenjualan.setEnabled(false);
        rPenjualan.setFocusable(false);
        rPenjualan.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rPenjualan.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rPenjualan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rPenjualanActionPerformed(evt);
            }
        });
        jToolBar2.add(rPenjualan);

        rPesan.setText("Restore Pesan");
        rPesan.setEnabled(false);
        rPesan.setFocusable(false);
        rPesan.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rPesan.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rPesan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rPesanActionPerformed(evt);
            }
        });
        jToolBar2.add(rPesan);

        rSuplier.setText("Restore Suplier");
        rSuplier.setEnabled(false);
        rSuplier.setFocusable(false);
        rSuplier.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rSuplier.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rSuplier.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rSuplierActionPerformed(evt);
            }
        });
        jToolBar2.add(rSuplier);

        rTracks.setText("Restore Perilaku");
        rTracks.setEnabled(false);
        rTracks.setFocusable(false);
        rTracks.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rTracks.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rTracks.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rTracksActionPerformed(evt);
            }
        });
        jToolBar2.add(rTracks);

        rTugas.setText("Restore Tugas");
        rTugas.setEnabled(false);
        rTugas.setFocusable(false);
        rTugas.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rTugas.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        rTugas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rTugasActionPerformed(evt);
            }
        });
        jToolBar2.add(rTugas);

        jTabbedPane2.addTab("Operation 2", jToolBar2);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup().addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jTabbedPane1).addComponent(jTabbedPane2))));
        layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup().addComponent(jTabbedPane2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 471, Short.MAX_VALUE)
                        .addContainerGap()));

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Menutup dialog tempat sampah");
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        this.setVisible(false);
        this.dispose();
    }//GEN-LAST:event_formWindowClosing

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        new Thread(() -> {
            try {
                hapusAll();
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
        }).start();
        disableAll();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
        new Thread(() -> {
            while (isVisible())
                reload();
        }).start();
    }//GEN-LAST:event_formWindowOpened

    private void tblAbsenMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblAbsenMouseClicked
        int x = tblAbsen.getSelectedRow();
        boolean b = tblAbsen.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sAbsen = achmad.rifai.erp1.entity.BukuAbsen.of(d, "" + tblAbsen.getValueAt(x, 0));
                d.close();
                rAbsen.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblAbsenMouseClicked

    private void rAbsenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rAbsenActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan data Absen " + sAbsen.getTgl());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.BukuAbsen b = achmad.rifai.erp1.entity.BukuAbsen.of(d, sAbsen.getTgl());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOBukuAbsen(d).update(sAbsen, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rAbsen.setEnabled(false);
        sAbsen = null;
    }//GEN-LAST:event_rAbsenActionPerformed

    private void tblBarangMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblBarangMouseClicked
        int x = tblBarang.getSelectedRow();
        boolean b = tblBarang.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sBarang = achmad.rifai.erp1.entity.Barang.of(d, "" + tblBarang.getValueAt(x, 0));
                d.close();
                rBarang.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblBarangMouseClicked

    private void rBarangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rBarangActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan barang " + sBarang.getKode());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.Barang b = achmad.rifai.erp1.entity.Barang.of(d, sBarang.getKode());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOBarang(d).update(sBarang, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rBarang.setEnabled(false);
        sBarang = null;
    }//GEN-LAST:event_rBarangActionPerformed

    private void tblAsetMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblAsetMouseClicked
        int x = tblAset.getSelectedRow();
        boolean b = tblAset.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sAset = achmad.rifai.erp1.entity.Rekening.of(d, "" + tblAset.getValueAt(x, 0));
                d.close();
                rAset.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblAsetMouseClicked

    private void rAsetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rAsetActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan aset " + sAset.getKode());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.Rekening b = achmad.rifai.erp1.entity.Rekening.of(d, sAset.getKode());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAORekening(d).update(sAset, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rAset.setEnabled(false);
        sAset = null;
    }//GEN-LAST:event_rAsetActionPerformed

    private void tblBonusMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblBonusMouseClicked
        int x = tblBonus.getSelectedRow();
        boolean b = tblBonus.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sBonus = achmad.rifai.erp1.entity.BulanBonus.of("" + tblBonus.getValueAt(x, 0), d);
                d.close();
                rBonus.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblBonusMouseClicked

    private void rBonusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rBonusActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan data bonus " + sBonus.getKode());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.BulanBonus b = achmad.rifai.erp1.entity.BulanBonus.of(sBonus.getKode(), d);
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOBulanBonus(d).update(sBonus, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rBonus.setEnabled(false);
        sBonus = null;
    }//GEN-LAST:event_rBonusActionPerformed

    private void tblJabatanMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblJabatanMouseClicked
        int x = tblJabatan.getSelectedRow();
        boolean b = tblJabatan.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sJabatan = achmad.rifai.erp1.entity.Jabatan.of(d, "" + tblJabatan.getValueAt(x, 0));
                d.close();
                rJabatan.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblJabatanMouseClicked

    private void rJabatanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rJabatanActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan data jabatan " + sJabatan.getNama());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.Jabatan b = achmad.rifai.erp1.entity.Jabatan.of(d, sJabatan.getNama());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOJabatan(d).update(sJabatan, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rJabatan.setEnabled(false);
        sJabatan = null;
    }//GEN-LAST:event_rJabatanActionPerformed

    private void tblJurnalMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblJurnalMouseClicked
        int x = tblJurnal.getSelectedRow();
        boolean b = tblJurnal.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sJurnal = achmad.rifai.erp1.entity.Jurnal.of(d, "" + tblJurnal.getValueAt(x, 0));
                d.close();
                rJurnal.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblJurnalMouseClicked

    private void rJurnalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rJurnalActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan data jurnal " + sJurnal.getKode());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.Jurnal b = achmad.rifai.erp1.entity.Jurnal.of(d, sJurnal.getKode());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOJurnal(d).update(sJurnal, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rJurnal.setEnabled(false);
        sJurnal = null;
    }//GEN-LAST:event_rJurnalActionPerformed

    private void tblKaryawanMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblKaryawanMouseClicked
        int x = tblKaryawan.getSelectedRow();
        boolean b = tblKaryawan.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sKaryawan = achmad.rifai.erp1.entity.Karyawan.of(d, "" + tblKaryawan.getValueAt(x, 0));
                d.close();
                rKaryawan.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblKaryawanMouseClicked

    private void rKaryawanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rKaryawanActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan data karyawan " + sKaryawan.getId());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.Karyawan b = achmad.rifai.erp1.entity.Karyawan.of(d, sKaryawan.getId());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOKaryawan(d).update(sKaryawan, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rKaryawan.setEnabled(false);
        sKaryawan = null;
    }//GEN-LAST:event_rKaryawanActionPerformed

    private void tblIncomeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblIncomeMouseClicked
        int x = tblIncome.getSelectedRow();
        boolean b = tblIncome.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sTerima = achmad.rifai.erp1.entity.Terima.of(d, "" + tblIncome.getValueAt(x, 0));
                d.close();
                rTerima.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblIncomeMouseClicked

    private void rTerimaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rTerimaActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan data income " + sTerima.getKode());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.Terima b = achmad.rifai.erp1.entity.Terima.of(d, sTerima.getKode());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOTerima(d).update(sTerima, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rTerima.setEnabled(false);
        sTerima = null;
    }//GEN-LAST:event_rTerimaActionPerformed

    private void tblKeluarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblKeluarMouseClicked
        int x = tblKeluar.getSelectedRow();
        boolean b = tblKeluar.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sKeluar = achmad.rifai.erp1.entity.Keluar.of(d, "" + tblKeluar.getValueAt(x, 0));
                d.close();
                rKeluar.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblKeluarMouseClicked

    private void rKeluarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rKeluarActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan data Expenses " + sKeluar.getKode());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.Keluar b = achmad.rifai.erp1.entity.Keluar.of(d, sKeluar.getKode());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOKeluar(d).update(sKeluar, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rKeluar.setEnabled(false);
        sKeluar = null;
    }//GEN-LAST:event_rKeluarActionPerformed

    private void tblLedgerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblLedgerMouseClicked
        int x = tblLedger.getSelectedRow();
        boolean b = tblLedger.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sLedger = achmad.rifai.erp1.entity.Ledger.of(d, "" + tblLedger.getValueAt(x, 0));
                d.close();
                rLedger.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblLedgerMouseClicked

    private void rLedgerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rLedgerActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan data ledger " + sLedger.getKode());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.Ledger b = achmad.rifai.erp1.entity.Ledger.of(d, sLedger.getKode());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOLedger(d).update(sLedger, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rLedger.setEnabled(false);
        sLedger = null;
    }//GEN-LAST:event_rLedgerActionPerformed

    private void tblPelangganMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblPelangganMouseClicked
        int x = tblPelanggan.getSelectedRow();
        boolean b = tblPelanggan.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sPelanggan = achmad.rifai.erp1.entity.Pelanggan.of(d, "" + tblPelanggan.getValueAt(x, 0));
                d.close();
                rPelanggan.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblPelangganMouseClicked

    private void rPelangganActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rPelangganActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan data pelanggan " + sPelanggan.getKode());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.Pelanggan b = achmad.rifai.erp1.entity.Pelanggan.of(d, sPelanggan.getKode());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOPelanggan(d).update(sPelanggan, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rPelanggan.setEnabled(false);
        sPelanggan = null;
    }//GEN-LAST:event_rPelangganActionPerformed

    private void tblPembelianMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblPembelianMouseClicked
        int x = tblPembelian.getSelectedRow();
        boolean b = tblPembelian.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sPembelian = achmad.rifai.erp1.entity.Pembelian.of(d, "" + tblPembelian.getValueAt(x, 0),
                        "" + tblPembelian.getValueAt(x, 1),
                        java.sql.Date.valueOf("" + tblPembelian.getValueAt(x, 2)));
                d.close();
                rPembelian.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblPembelianMouseClicked

    private void rPembelianActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rPembelianActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan data pembelian " + sPembelian.getStruk());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.Pembelian b = achmad.rifai.erp1.entity.Pembelian.of(d, sPembelian.getStruk(),
                    sPembelian.getSuplier(), sPembelian.getTgl());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOPembelian(d).update(sPembelian, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rPembelian.setEnabled(false);
        sPembelian = null;
    }//GEN-LAST:event_rPembelianActionPerformed

    private void tblPenjualanMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblPenjualanMouseClicked
        int x = tblPenjualan.getSelectedRow();
        boolean b = tblPenjualan.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sPenjualan = achmad.rifai.erp1.entity.Penjualan.of(d, "" + tblPenjualan.getValueAt(x, 0));
                d.close();
                rPenjualan.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblPenjualanMouseClicked

    private void rPenjualanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rPenjualanActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan data penjualan " + sPenjualan.getNota());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.Penjualan b = achmad.rifai.erp1.entity.Penjualan.of(d, sPenjualan.getNota());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOPenjualan(d).update(sPenjualan, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rPenjualan.setEnabled(false);
        sPenjualan = null;
    }//GEN-LAST:event_rPenjualanActionPerformed

    private void tblPesanMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblPesanMouseClicked
        int x = tblPesan.getSelectedRow();
        boolean b = tblPesan.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sPesan = achmad.rifai.erp1.entity.Pesan.of(d, "" + tblPesan.getValueAt(x, 0));
                d.close();
                rPesan.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblPesanMouseClicked

    private void rPesanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rPesanActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan data pesan " + sPesan.getKode());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.Pesan b = achmad.rifai.erp1.entity.Pesan.of(d, sPesan.getKode());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOPesan(d).update(sPesan, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rPesan.setEnabled(false);
        sPesan = null;
    }//GEN-LAST:event_rPesanActionPerformed

    private void tblSuplierMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblSuplierMouseClicked
        int x = tblSuplier.getSelectedRow();
        boolean b = tblSuplier.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sSuplier = achmad.rifai.erp1.entity.Suplier.of(d, "" + tblSuplier.getValueAt(x, 0));
                d.close();
                rSuplier.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblSuplierMouseClicked

    private void rSuplierActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rSuplierActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan data suplier " + sSuplier.getKode());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.Suplier b = achmad.rifai.erp1.entity.Suplier.of(d, sSuplier.getKode());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOSuplier(d).update(sSuplier, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rSuplier.setEnabled(false);
        sSuplier = null;
    }//GEN-LAST:event_rSuplierActionPerformed

    private void tblPerilakuMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblPerilakuMouseClicked
        int x = tblPerilaku.getSelectedRow();
        boolean b = tblPerilaku.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sTracks = achmad.rifai.erp1.entity.Tracks.of(d, "" + tblPerilaku.getValueAt(x, 0));
                d.close();
                rTracks.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblPerilakuMouseClicked

    private void rTracksActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rTracksActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan buku jejak " + sTracks.getKode());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.Tracks b = achmad.rifai.erp1.entity.Tracks.of(d, sTracks.getKode());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOTracks(d).update(sTracks, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rTracks.setEnabled(false);
        sTracks = null;
    }//GEN-LAST:event_rTracksActionPerformed

    private void tblTugasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblTugasMouseClicked
        int x = tblTugas.getSelectedRow();
        boolean b = tblTugas.isRowSelected(x);
        if (b)
            try {
                achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
                sTugas = achmad.rifai.erp1.entity.Tugas.of(d, "" + tblTugas.getValueAt(x, 0));
                d.close();
                rTugas.setEnabled(b);
            } catch (Exception ex) {
                achmad.rifai.erp1.util.Db.hindar(ex);
            }
    }//GEN-LAST:event_tblTugasMouseClicked

    private void rTugasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rTugasActionPerformed
        try {
            achmad.rifai.admin.util.Work.jejak(id, "Mengembalikan data tugas " + sTugas.getKode());
            achmad.rifai.erp1.util.Db d = achmad.rifai.erp1.util.Work.loadDB();
            achmad.rifai.erp1.entity.Tugas b = achmad.rifai.erp1.entity.Tugas.of(d, sTugas.getKode());
            b.setDeleted(false);
            new achmad.rifai.erp1.entity.dao.DAOTugas(d).update(sTugas, b);
            d.close();
        } catch (Exception ex) {
            achmad.rifai.erp1.util.Db.hindar(ex);
        }
        rTugas.setEnabled(false);
        sTugas = null;
    }//GEN-LAST:event_rTugasActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane13;
    private javax.swing.JScrollPane jScrollPane14;
    private javax.swing.JScrollPane jScrollPane15;
    private javax.swing.JScrollPane jScrollPane16;
    private javax.swing.JScrollPane jScrollPane17;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JToolBar jToolBar2;
    private javax.swing.JButton rAbsen;
    private javax.swing.JButton rAset;
    private javax.swing.JButton rBarang;
    private javax.swing.JButton rBonus;
    private javax.swing.JButton rJabatan;
    private javax.swing.JButton rJurnal;
    private javax.swing.JButton rKaryawan;
    private javax.swing.JButton rKeluar;
    private javax.swing.JButton rLedger;
    private javax.swing.JButton rPelanggan;
    private javax.swing.JButton rPembelian;
    private javax.swing.JButton rPenjualan;
    private javax.swing.JButton rPesan;
    private javax.swing.JButton rSuplier;
    private javax.swing.JButton rTerima;
    private javax.swing.JButton rTracks;
    private javax.swing.JButton rTugas;
    private javax.swing.JTable tblAbsen;
    private javax.swing.JTable tblAset;
    private javax.swing.JTable tblBarang;
    private javax.swing.JTable tblBonus;
    private javax.swing.JTable tblIncome;
    private javax.swing.JTable tblJabatan;
    private javax.swing.JTable tblJurnal;
    private javax.swing.JTable tblKaryawan;
    private javax.swing.JTable tblKeluar;
    private javax.swing.JTable tblLedger;
    private javax.swing.JTable tblPelanggan;
    private javax.swing.JTable tblPembelian;
    private javax.swing.JTable tblPenjualan;
    private javax.swing.JTable tblPerilaku;
    private javax.swing.JTable tblPesan;
    private javax.swing.JTable tblSuplier;
    private javax.swing.JTable tblTugas;
    // End of variables declaration//GEN-END:variables

    private void reload() {
        try {
            Db d = achmad.rifai.erp1.util.Work.loadDB();
            pertama(d);
            kedua(d);
            ketiga(d);
            d.close();
            Thread.sleep(5000);
        } catch (Exception ex) {
            Db.hindar(ex);
        }
    }

    private void loadAbsen(Db d) throws Exception {
        javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(new String[] { "Tanggal" },
                0) {
            @Override
            public boolean isCellEditable(int row, int column) {
                return false;
            }
        };
        tblAbsen.setModel(m);
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("bukuabsen").find();
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        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.BukuAbsen b = new achmad.rifai.erp1.entity.BukuAbsen(json);
            if (b.isDeleted())
                m.addRow(new Object[] { b.getTgl() });
        }
    }

    private void loadBarang(Db d) throws Exception {
        javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
                new String[] { "KODE", "NAMA", "HARGA", "STOK" }, 0) {
            @Override
            public boolean isCellEditable(int row, int column) {
                return false;
            }
        };
        tblBarang.setModel(m);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("barang").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.Barang b = new achmad.rifai.erp1.entity.Barang(json);
            if (b.isDeleted())
                m.addRow(new Object[] { b.getKode(), b.getNama(), b.getHarga(),
                        "" + b.getStok() + " " + b.getSatuan() });
        }
    }

    private void loadAset(Db d) throws Exception {
        javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
                new String[] { "Kode", "Golongan", "Posisi", "Keterangan" }, 0) {
            @Override
            public boolean isCellEditable(int row, int column) {
                return false;
            }
        };
        tblAset.setModel(m);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("rekening").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.Rekening re = new achmad.rifai.erp1.entity.Rekening(json);
            if (re.isDeleted())
                m.addRow(new Object[] { re.getKode(), re.getGolongan(), re.getPosisi(), re.getKet() });
        }
    }

    private void loadBonus(Db d) throws Exception {
        javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
                new Object[] { "Kode", "Pegawai", "Bulan", "Tahun" }, 0) {
            private Class[] c = new Class[] { String.class, String.class, java.time.Month.class,
                    java.time.Year.class };

            @Override
            public boolean isCellEditable(int i, int i1) {
                return false;
            }

            @Override
            public Class<?> getColumnClass(int i) {
                return c[i];
            }
        };
        tblBonus.setModel(m);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("bulanbonus").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.BulanBonus b = new achmad.rifai.erp1.entity.BulanBonus(json);
            if (b.isDeleted())
                m.addRow(new Object[] { b.getKode(), b.getPeg(), b.getBln(), b.getThn() });
        }
    }

    private void loadJabatan(Db d) throws Exception {
        javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
                new String[] { "NAMA", "GAJI", "KAPASITAS" }, 0) {
            @Override
            public boolean isCellEditable(int row, int column) {
                return false;
            }
        };
        tblJabatan.setModel(m);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("jabatan").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.Jabatan j = new achmad.rifai.erp1.entity.Jabatan(json);
            if (j.isDeleted())
                m.addRow(new Object[] { j.getNama(), j.getGaji(), j.getKapasitas() });
        }
    }

    private void pertama(Db d) throws Exception {
        loadAbsen(d);
        loadBarang(d);
        loadAset(d);
        loadBonus(d);
        loadJabatan(d);
    }

    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
            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() });
        }
    }

    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
            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() });
        }
    }

    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
            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() });
        }
    }

    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
            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() });
        }
    }

    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
            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() });
        }
    }

    private void kedua(Db d) throws Exception {
        loadJurnal(d);
        loadIncome(d);
        loadKaryawan(d);
        loadExpenses(d);
        loadLedger(d);
    }

    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
            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() });
        }
    }

    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
            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() });
        }
    }

    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
            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() });
        }
    }

    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
            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() });
        }
    }

    private void loadSuplier(Db d) throws Exception {
        javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
                new String[] { "Kode", "Nama" }, 0) {
            @Override
            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() });
        }
    }

    private void ketiga(Db d) throws Exception {
        loadPelanggan(d);
        loadPembelian(d);
        loadPenjualan(d);
        loadPesan(d);
        loadSuplier(d);
        loadPerilaku(d);
        loadTugas(d);
    }

    private void loadPerilaku(Db d) throws Exception {
        javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
                new String[] { "Kode", "Pelaku", "Bulan", "Tahun" }, 0) {
            @Override
            public boolean isCellEditable(int row, int column) {
                return false;
            }
        };
        tblPerilaku.setModel(m);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("tracks").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.Tracks t = new achmad.rifai.erp1.entity.Tracks(json);
            if (t.isDeleted())
                m.addRow(new Object[] { t.getKode(), t.getId(), t.getBln(), t.getTahun() });
        }
    }

    private void loadTugas(Db d) throws Exception {
        javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
                new String[] { "KODE", "URUTAN", "TANGGAL", "Keterangan", "Dibatalkan", "Ditunda" }, 0) {
            private Class[] c = new Class[] { String.class, String.class, java.sql.Date.class, String.class,
                    Boolean.class, Boolean.class };

            @Override
            public Class<?> getColumnClass(int x) {
                return c[x];
            }

            @Override
            public boolean isCellEditable(int row, int column) {
                return false;
            }
        };
        tblTugas.setModel(m);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("tugas").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.Tugas t = new achmad.rifai.erp1.entity.Tugas(json);
            if (t.isDeleted())
                m.addRow(new Object[] { t.getKode(), t.getNo(), t.getTgl(), t.getKet(), t.isBatal(),
                        t.isPending() });
        }
    }

    private void hapusAll() throws Exception {
        achmad.rifai.admin.util.Work.jejak(id, "Mengosongkan tempat sampah");
        Db d = achmad.rifai.erp1.util.Work.loadDB();
        hpsPertama(d);
        hpsKedua(d);
        hpsKetiga(d);
        d.close();
        this.setVisible(false);
    }

    private void disableAll() {
        this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
        jTabbedPane1.setEnabled(false);
        jTabbedPane2.setEnabled(false);
    }

    private void hpsPertama(Db d) throws Exception {
        hpsAbsen(d);
        hpsBarang(d);
        hpsAset(d);
        hpsBonus(d);
        hpsJabatan(d);
    }

    private void hpsKedua(Db d) throws Exception {
        hpsJurnal(d);
        hpsIncome(d);
        hpsKaryawan(d);
        hpsExpenses(d);
        hpsLedger(d);
    }

    private void hpsKetiga(Db d) throws Exception {
        hpsPelanggan(d);
        hpsPembelian(d);
        hpsPenjualan(d);
        hpsPesan(d);
        hpsSuplier(d);
        hpsPerilaku(d);
        hpsTugas(d);
    }

    private void hpsAbsen(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("absen").find();
        achmad.rifai.erp1.entity.dao.DAOBukuAbsen dao = new achmad.rifai.erp1.entity.dao.DAOBukuAbsen(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.BukuAbsen b = new achmad.rifai.erp1.entity.BukuAbsen(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }

    private void hpsBarang(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("barang").find();
        achmad.rifai.erp1.entity.dao.DAOBarang dao = new achmad.rifai.erp1.entity.dao.DAOBarang(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.Barang b = new achmad.rifai.erp1.entity.Barang(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }

    private void hpsAset(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("rekening").find();
        achmad.rifai.erp1.entity.dao.DAORekening dao = new achmad.rifai.erp1.entity.dao.DAORekening(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.Rekening b = new achmad.rifai.erp1.entity.Rekening(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }

    private void hpsBonus(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("bulanbonus").find();
        achmad.rifai.erp1.entity.dao.DAOBulanBonus dao = new achmad.rifai.erp1.entity.dao.DAOBulanBonus(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.BulanBonus b = new achmad.rifai.erp1.entity.BulanBonus(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }

    private void hpsJabatan(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("jabatan").find();
        achmad.rifai.erp1.entity.dao.DAOJabatan dao = new achmad.rifai.erp1.entity.dao.DAOJabatan(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.Jabatan b = new achmad.rifai.erp1.entity.Jabatan(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }

    private void hpsJurnal(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("jurnal").find();
        achmad.rifai.erp1.entity.dao.DAOJurnal dao = new achmad.rifai.erp1.entity.dao.DAOJurnal(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.Jurnal b = new achmad.rifai.erp1.entity.Jurnal(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }

    private void hpsIncome(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("terima").find();
        achmad.rifai.erp1.entity.dao.DAOTerima dao = new achmad.rifai.erp1.entity.dao.DAOTerima(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.Terima b = new achmad.rifai.erp1.entity.Terima(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }

    private void hpsKaryawan(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("karyawan").find();
        achmad.rifai.erp1.entity.dao.DAOKaryawan dao = new achmad.rifai.erp1.entity.dao.DAOKaryawan(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.Karyawan b = new achmad.rifai.erp1.entity.Karyawan(s);
            if (b.isDeleted())
                dao.truedelete(b);
        }
    }

    private void hpsExpenses(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("keluar").find();
        achmad.rifai.erp1.entity.dao.DAOKeluar dao = new achmad.rifai.erp1.entity.dao.DAOKeluar(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.Keluar b = new achmad.rifai.erp1.entity.Keluar(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }

    private void hpsLedger(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("ledger").find();
        achmad.rifai.erp1.entity.dao.DAOLedger dao = new achmad.rifai.erp1.entity.dao.DAOLedger(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.Ledger b = new achmad.rifai.erp1.entity.Ledger(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }

    private void hpsPelanggan(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("pelanggan").find();
        achmad.rifai.erp1.entity.dao.DAOPelanggan dao = new achmad.rifai.erp1.entity.dao.DAOPelanggan(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.Pelanggan b = new achmad.rifai.erp1.entity.Pelanggan(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }

    private void hpsPembelian(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("pembelian").find();
        achmad.rifai.erp1.entity.dao.DAOPembelian dao = new achmad.rifai.erp1.entity.dao.DAOPembelian(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.Pembelian b = new achmad.rifai.erp1.entity.Pembelian(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }

    private void hpsPenjualan(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("penjualan").find();
        achmad.rifai.erp1.entity.dao.DAOPenjualan dao = new achmad.rifai.erp1.entity.dao.DAOPenjualan(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.Penjualan b = new achmad.rifai.erp1.entity.Penjualan(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }

    private void hpsPesan(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("pesan").find();
        achmad.rifai.erp1.entity.dao.DAOPesan dao = new achmad.rifai.erp1.entity.dao.DAOPesan(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.Pesan b = new achmad.rifai.erp1.entity.Pesan(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }

    private void hpsSuplier(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("suplier").find();
        achmad.rifai.erp1.entity.dao.DAOSuplier dao = new achmad.rifai.erp1.entity.dao.DAOSuplier(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.Suplier b = new achmad.rifai.erp1.entity.Suplier(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }

    private void hpsPerilaku(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("tracks").find();
        achmad.rifai.erp1.entity.dao.DAOTracks dao = new achmad.rifai.erp1.entity.dao.DAOTracks(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.Tracks b = new achmad.rifai.erp1.entity.Tracks(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }

    private void hpsTugas(Db d) throws Exception {
        com.mongodb.DBCursor c = d.getD().getCollectionFromString("tugas").find();
        achmad.rifai.erp1.entity.dao.DAOTugas dao = new achmad.rifai.erp1.entity.dao.DAOTugas(d);
        achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
        while (c.hasNext()) {
            com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
            String s = "";
            for (int x = 0; x < l.size(); x++)
                s += r.decrypt("" + l.get(x));
            achmad.rifai.erp1.entity.Tugas b = new achmad.rifai.erp1.entity.Tugas(s);
            if (b.isDeleted())
                dao.trueDelete(b);
        }
    }
}