pasok
/*
* 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 nmTransaksi;
import Class.classkoneksi;
import com.mysql.jdbc.Connection;
import java.awt.Cursor;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JRootPane;
import javax.swing.table.DefaultTableModel;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.view.JasperViewer;
import net.sf.jasperreports.engine.util.JRLoader;
/**
*
* @author RPL
*/
public class Pasok extends javax.swing.JFrame {
private String idPasok;
private String diskon;
private boolean update = false;
/**
* Creates new form Pasok
*/
public Pasok() {
setUndecorated(true);
getRootPane().setWindowDecorationStyle(JRootPane.NONE);
initComponents();
this.setLocationRelativeTo(this);
}
private void getDistributor() {
try{
String SQL = "Select id_distributor from distributor order by id_distributor asc";
ResultSet rs = classkoneksi.executeQuery(SQL);
cboDistributor.removeAllItems();
cboDistributor.addItem("-");
while(rs.next()){
cboDistributor.addItem(rs.getString(1));
}
}catch (Exception e) {
}
}
private void getDetDistributor(){
try{
String idDistributor = cboDistributor.getSelectedItem().toString();
String SQL = "select nama_distributor,alamat "
+"from distributor where id_distributor ='"+idDistributor+"'";
ResultSet rs = classkoneksi.executeQuery(SQL);
if(rs.next()){
txtNama.setText(rs.getString(1));
txtAlamat.setText(rs.getString(2));
}
}catch (Exception e){
}
}
private void getBuku() {
try{
String SQL = "Select id_buku from tbl_buku order by id_buku asc";
ResultSet rs = classkoneksi.executeQuery(SQL);
cboBuku.removeAllItems();
cboBuku.addItem("-");
while(rs.next()){
cboBuku.addItem(rs.getString(1));
}
}catch (Exception e) {
}
}
private void getDetBuku(){
try{
String idBuku = cboBuku.getSelectedItem().toString();
String SQL = "select noisbn,judul,penulis,penerbit,tahun,stok,harga_jual "
+"from tbl_buku where id_buku ='"+idBuku+"'";
ResultSet rs = classkoneksi.executeQuery(SQL);
if(rs.next()){
txtIsbn.setText(rs.getString(1));
txtJudul.setText(rs.getString(2));
txtPenulis.setText(rs.getString(3));
txtPenerbit.setText(rs.getString(4));
txtTahun.setText(rs.getString(5));
txtStok.setText(rs.getString(6));
txtHarga.setText(rs.getString(7));
}
}catch (Exception e){
}
}
private void tglTransaksi(){
SimpleDateFormat df = new SimpleDateFormat("EEE, dd MMMM YYYY");
Date date = new Date();
String hasil = df.format(date);
txtTanggal.setText(hasil);
}
private void IdPasok() {
try{
String query = "select substring(id_pasok,4,6) as id from tbl_pasok order by id_pasok desc limit 0,1";
ResultSet rs = classkoneksi.executeQuery(query);
SimpleDateFormat df = new SimpleDateFormat("yyMM");
Date date = new Date();
String hasil = "PSK";
if(rs.first()) {
String str = "000";
String Id = rs.getString("id");
int no = Integer.valueOf(Id)+1;
String str_no = String.valueOf(no);
String idPasok = hasil +str.substring(0,3-str_no.length())+Integer.toString(no);
txtIdPasok.setText(idPasok);
} else {
String idPasok = hasil+"0001";
txtIdPasok.setText(idPasok);
}
} catch (Exception e) {
JOptionPane.showMessageDialog(rootPane, e);
System.out.println(e);
}
}
private int cekData(){
int i = 0;
if(cboBuku.getSelectedItem().equals("-")){
JOptionPane.showMessageDialog(rootPane, "Silahkan pilih buku.","Peringatan", JOptionPane.WARNING_MESSAGE);
}else if(cboDistributor.getSelectedItem().equals("-")){
JOptionPane.showMessageDialog(rootPane, "silahkan pilih id distributor.","Peringatan", JOptionPane.WARNING_MESSAGE);
}else if(txtJumlah.getText().isEmpty()){
JOptionPane.showMessageDialog(rootPane, "Jumlah tidak boleh kosong.","Peringatan", JOptionPane.WARNING_MESSAGE);
}else{
i=1;
}
return i;
}
private void simpan(){
int i = cekData();
if(i>0){
String idTransaksi = txtIdPasok.getText();
String idBuku = cboBuku.getSelectedItem().toString();
String idDistributor = cboDistributor.getSelectedItem().toString();
String jumlah = txtJumlah.getText();
SimpleDateFormat df = new SimpleDateFormat("YYYY-MM-dd");
Date date = new Date();
String tanggal = df.format(date);
String SQL = "insert into tbl_pasok value('"+idTransaksi+"','"+idDistributor+"','"+idBuku+"','"+jumlah+"','"+tanggal+"')";
int a = classkoneksi.execute(SQL);
if(i>0){
JOptionPane.showMessageDialog(rootPane, "Data berhasil di simpan.","Succses", JOptionPane.INFORMATION_MESSAGE);
}else{
JOptionPane.showMessageDialog(rootPane, "data gagal di simpan","Gagal", JOptionPane.WARNING_MESSAGE);
}
}
}
private void updateData(){
String idTransaksi = txtIdPasok.getText();
String idDistributor = cboDistributor.getSelectedItem().toString();
String idBuku = cboBuku.getSelectedItem().toString();
String idKasir = "17010001";
String jumlah = txtJumlah.getText();
String SQL = "update tbl_pasok set id_buku='"+idBuku+"',id_distributor='"+idDistributor+"',jumlah='"+jumlah+"' where "
+ "id_pasok = '"+idPasok+"'";
int i = classkoneksi.execute(SQL);
if(i>0){
JOptionPane.showMessageDialog(rootPane, "Data berhasil diubah.","Success",JOptionPane.INFORMATION_MESSAGE);
}else{
JOptionPane.showMessageDialog(rootPane, "Data gagal diubah.","Gagal",JOptionPane.WARNING_MESSAGE);
}
}
private void pushData(){
String SQL = "Select * from tbl_pasok where id_pasok = '"+this.getIdPasok()+"'";
try{
ResultSet rs = classkoneksi.executeQuery(SQL);
if(rs.next()){
txtIdPasok.setText(rs.getString(1));
cboDistributor.setSelectedItem(rs.getString(2));
cboBuku.setSelectedItem(rs.getString(3));
txtJumlah.setText(rs.getString(4));
txtTanggal.setText(rs.getString(5));
}
}catch(Exception e){
JOptionPane.showMessageDialog(rootPane, "kesalahan dalam database");
System.out.println(e);
}
}
private void cetak(){
{btnCetak.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
Connection cn = classkoneksi.setKoneksi();
try {
Statement st = cn.createStatement();
Map<String, Object> prs = new HashMap<String, Object>();
prs.put("idPasok", txtIdPasok.getText());
JasperReport JRpt =
JasperCompileManager.compileReport("src/Laporan/fakturPasok.jrxml");
JasperPrint JPrint = JasperFillManager.fillReport(JRpt, prs, cn);
JasperViewer view = new JasperViewer(JPrint, false);
javax.swing.JDialog dialog = new javax.swing.JDialog(new javax.swing.JFrame(),true);//the owner
dialog.setContentPane(view.getContentPane());
dialog.setSize(700,882);
dialog.setTitle("Laporan Transaksi");
dialog.setVisible(true);
dialog.setLocationRelativeTo(this);
} catch (Exception rptexcpt) {
System.out.println("Report Can't view because : " + rptexcpt);
}
btnCetak.setCursor(Cursor.getDefaultCursor());
}
}
public void bersih(){
txtNama.setText("");
txtAlamat.setText("");
txtJudul.setText("");
txtIsbn.setText("");
txtPenulis.setText("");
txtPenerbit.setText("");
txtTahun.setText("");
txtStok.setText("");
txtHarga.setText("");
txtJumlah.setText("");
}
/**
* 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">
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
btnSimpan = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jPanel3 = new javax.swing.JPanel();
cboDistributor = new javax.swing.JComboBox<String>();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
txtNama = new javax.swing.JTextField();
jScrollPane1 = new javax.swing.JScrollPane();
txtAlamat = new javax.swing.JTextArea();
jPanel4 = new javax.swing.JPanel();
jLabel4 = new javax.swing.JLabel();
cboBuku = new javax.swing.JComboBox();
jLabel11 = new javax.swing.JLabel();
txtIsbn = new javax.swing.JTextField();
txtJudul = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
txtPenulis = new javax.swing.JTextField();
jLabel12 = new javax.swing.JLabel();
txtPenerbit = new javax.swing.JTextField();
txtHarga = new javax.swing.JTextField();
jLabel9 = new javax.swing.JLabel();
txtStok = new javax.swing.JTextField();
jLabel13 = new javax.swing.JLabel();
txtTahun = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
txtJumlah = new javax.swing.JTextField();
jLabel10 = new javax.swing.JLabel();
txtTanggal = new javax.swing.JTextField();
jLabel14 = new javax.swing.JLabel();
txtIdPasok = new javax.swing.JTextField();
btnCetak = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
}
});
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Pasok"));
btnSimpan.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484900179_floppy_disk_save.png"))); // NOI18N
btnSimpan.setText("SIMPAN");
btnSimpan.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSimpanActionPerformed(evt);
}
});
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484900274_ic_cancel_48px.png"))); // NOI18N
jButton2.setText("BATAL");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484900317_common-logout-signout-exit-glyph.png"))); // NOI18N
jButton3.setText("KELUAR");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Distributor", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(153, 0, 0))); // NOI18N
cboDistributor.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cboDistributorActionPerformed(evt);
}
});
jLabel1.setText("Id Distributor :");
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel2.setText("Nama : ");
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel3.setText("Alamat : ");
txtAlamat.setColumns(20);
txtAlamat.setRows(5);
jScrollPane1.setViewportView(txtAlamat);
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cboDistributor, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE))
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtNama)))
.addContainerGap())
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cboDistributor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtNama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jLabel3)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jScrollPane1))
.addContainerGap())
);
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Buku", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(153, 0, 0)), "", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(153, 0, 0))); // NOI18N
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel4.setText("Buku : ");
cboBuku.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
cboBukuItemStateChanged(evt);
}
});
cboBuku.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cboBukuActionPerformed(evt);
}
});
jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel11.setText("No ISBN : ");
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel6.setText("Judul : ");
jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel7.setText("Penulis : ");
jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel12.setText("Penerbit : ");
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel9.setText("Harga : ");
jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel13.setText("Stok : ");
jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel5.setText("Tahun : ");
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel7)
.addComponent(jLabel4)
.addComponent(jLabel6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addComponent(cboBuku, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(10, 10, 10)
.addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtIsbn))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addComponent(txtPenulis, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel12)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtPenerbit))
.addComponent(txtJudul, javax.swing.GroupLayout.PREFERRED_SIZE, 374, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtTahun, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtStok, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(32, 32, 32)
.addComponent(jLabel9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtHarga)))
.addContainerGap(27, Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(cboBuku, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel11)
.addComponent(txtIsbn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(6, 6, 6)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(txtJudul, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(4, 4, 4)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(txtPenulis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtPenerbit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel12))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(txtTahun, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel13)
.addComponent(txtStok, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel9)
.addComponent(txtHarga, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 14, Short.MAX_VALUE))
);
jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel8.setText("Jumlah Pasok : ");
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel10.setText("Tanggal Pasok : ");
txtTanggal.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtTanggalActionPerformed(evt);
}
});
jLabel14.setText("Id Pasok");
btnCetak.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484901579_print.png"))); // NOI18N
btnCetak.setText("CETAK");
btnCetak.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCetakActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtJumlah, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtTanggal)))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnSimpan)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnCetak)
.addGap(18, 18, 18)
.addComponent(jButton3)))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(21, 21, 21)
.addComponent(jLabel14)
.addGap(18, 18, 18)
.addComponent(txtIdPasok, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(40, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel14)
.addComponent(txtIdPasok, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnSimpan)
.addComponent(jButton2))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel8)
.addComponent(txtJumlah, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel10)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtTanggal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnCetak)
.addComponent(jButton3)))))
.addContainerGap())
);
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()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>
private void cboBukuItemStateChanged(java.awt.event.ItemEvent evt) {
// TODO add your handling code here:
}
private void formWindowOpened(java.awt.event.WindowEvent evt) {
// TODO add your handling code here:
if(this.isUpdate()==true){
getDistributor();
getBuku();
pushData();
btnSimpan.setText("Update");
}else{
IdPasok();
getDistributor();
getBuku();
tglTransaksi();
btnSimpan.setText("Simpan");
}
}
private void cboBukuActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
getDetBuku();
}
private void cboDistributorActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
getDetDistributor();
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
this.dispose();
}
private void btnSimpanActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if(this.isUpdate() == true){
updateData();
}else{
simpan();
}
}
private void btnCetakActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
cetak();
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
bersih();
}
private void txtTanggalActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Pasok.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Pasok.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Pasok.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Pasok.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Pasok().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton btnCetak;
private javax.swing.JButton btnSimpan;
private javax.swing.JComboBox cboBuku;
private javax.swing.JComboBox<String> cboDistributor;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea txtAlamat;
private javax.swing.JTextField txtHarga;
private javax.swing.JTextField txtIdPasok;
private javax.swing.JTextField txtIsbn;
private javax.swing.JTextField txtJudul;
private javax.swing.JTextField txtJumlah;
private javax.swing.JTextField txtNama;
private javax.swing.JTextField txtPenerbit;
private javax.swing.JTextField txtPenulis;
private javax.swing.JTextField txtStok;
private javax.swing.JTextField txtTahun;
private javax.swing.JTextField txtTanggal;
// End of variables declaration
/**
* @return the idPasok
*/
public String getIdPasok() {
return idPasok;
}
/**
* @param idPasok the idPasok to set
*/
public void setIdPasok(String idPasok) {
this.idPasok = idPasok;
}
/**
* @return the diskon
*/
public String getDiskon() {
return diskon;
}
/**
* @param diskon the diskon to set
*/
public void setDiskon(String diskon) {
this.diskon = diskon;
}
/**
* @return the update
*/
public boolean isUpdate() {
return update;
}
/**
* @param update the update to set
*/
public void setUpdate(boolean update) {
this.update = update;
}
}
* 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 nmTransaksi;
import Class.classkoneksi;
import com.mysql.jdbc.Connection;
import java.awt.Cursor;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JRootPane;
import javax.swing.table.DefaultTableModel;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.view.JasperViewer;
import net.sf.jasperreports.engine.util.JRLoader;
/**
*
* @author RPL
*/
public class Pasok extends javax.swing.JFrame {
private String idPasok;
private String diskon;
private boolean update = false;
/**
* Creates new form Pasok
*/
public Pasok() {
setUndecorated(true);
getRootPane().setWindowDecorationStyle(JRootPane.NONE);
initComponents();
this.setLocationRelativeTo(this);
}
private void getDistributor() {
try{
String SQL = "Select id_distributor from distributor order by id_distributor asc";
ResultSet rs = classkoneksi.executeQuery(SQL);
cboDistributor.removeAllItems();
cboDistributor.addItem("-");
while(rs.next()){
cboDistributor.addItem(rs.getString(1));
}
}catch (Exception e) {
}
}
private void getDetDistributor(){
try{
String idDistributor = cboDistributor.getSelectedItem().toString();
String SQL = "select nama_distributor,alamat "
+"from distributor where id_distributor ='"+idDistributor+"'";
ResultSet rs = classkoneksi.executeQuery(SQL);
if(rs.next()){
txtNama.setText(rs.getString(1));
txtAlamat.setText(rs.getString(2));
}
}catch (Exception e){
}
}
private void getBuku() {
try{
String SQL = "Select id_buku from tbl_buku order by id_buku asc";
ResultSet rs = classkoneksi.executeQuery(SQL);
cboBuku.removeAllItems();
cboBuku.addItem("-");
while(rs.next()){
cboBuku.addItem(rs.getString(1));
}
}catch (Exception e) {
}
}
private void getDetBuku(){
try{
String idBuku = cboBuku.getSelectedItem().toString();
String SQL = "select noisbn,judul,penulis,penerbit,tahun,stok,harga_jual "
+"from tbl_buku where id_buku ='"+idBuku+"'";
ResultSet rs = classkoneksi.executeQuery(SQL);
if(rs.next()){
txtIsbn.setText(rs.getString(1));
txtJudul.setText(rs.getString(2));
txtPenulis.setText(rs.getString(3));
txtPenerbit.setText(rs.getString(4));
txtTahun.setText(rs.getString(5));
txtStok.setText(rs.getString(6));
txtHarga.setText(rs.getString(7));
}
}catch (Exception e){
}
}
private void tglTransaksi(){
SimpleDateFormat df = new SimpleDateFormat("EEE, dd MMMM YYYY");
Date date = new Date();
String hasil = df.format(date);
txtTanggal.setText(hasil);
}
private void IdPasok() {
try{
String query = "select substring(id_pasok,4,6) as id from tbl_pasok order by id_pasok desc limit 0,1";
ResultSet rs = classkoneksi.executeQuery(query);
SimpleDateFormat df = new SimpleDateFormat("yyMM");
Date date = new Date();
String hasil = "PSK";
if(rs.first()) {
String str = "000";
String Id = rs.getString("id");
int no = Integer.valueOf(Id)+1;
String str_no = String.valueOf(no);
String idPasok = hasil +str.substring(0,3-str_no.length())+Integer.toString(no);
txtIdPasok.setText(idPasok);
} else {
String idPasok = hasil+"0001";
txtIdPasok.setText(idPasok);
}
} catch (Exception e) {
JOptionPane.showMessageDialog(rootPane, e);
System.out.println(e);
}
}
private int cekData(){
int i = 0;
if(cboBuku.getSelectedItem().equals("-")){
JOptionPane.showMessageDialog(rootPane, "Silahkan pilih buku.","Peringatan", JOptionPane.WARNING_MESSAGE);
}else if(cboDistributor.getSelectedItem().equals("-")){
JOptionPane.showMessageDialog(rootPane, "silahkan pilih id distributor.","Peringatan", JOptionPane.WARNING_MESSAGE);
}else if(txtJumlah.getText().isEmpty()){
JOptionPane.showMessageDialog(rootPane, "Jumlah tidak boleh kosong.","Peringatan", JOptionPane.WARNING_MESSAGE);
}else{
i=1;
}
return i;
}
private void simpan(){
int i = cekData();
if(i>0){
String idTransaksi = txtIdPasok.getText();
String idBuku = cboBuku.getSelectedItem().toString();
String idDistributor = cboDistributor.getSelectedItem().toString();
String jumlah = txtJumlah.getText();
SimpleDateFormat df = new SimpleDateFormat("YYYY-MM-dd");
Date date = new Date();
String tanggal = df.format(date);
String SQL = "insert into tbl_pasok value('"+idTransaksi+"','"+idDistributor+"','"+idBuku+"','"+jumlah+"','"+tanggal+"')";
int a = classkoneksi.execute(SQL);
if(i>0){
JOptionPane.showMessageDialog(rootPane, "Data berhasil di simpan.","Succses", JOptionPane.INFORMATION_MESSAGE);
}else{
JOptionPane.showMessageDialog(rootPane, "data gagal di simpan","Gagal", JOptionPane.WARNING_MESSAGE);
}
}
}
private void updateData(){
String idTransaksi = txtIdPasok.getText();
String idDistributor = cboDistributor.getSelectedItem().toString();
String idBuku = cboBuku.getSelectedItem().toString();
String idKasir = "17010001";
String jumlah = txtJumlah.getText();
String SQL = "update tbl_pasok set id_buku='"+idBuku+"',id_distributor='"+idDistributor+"',jumlah='"+jumlah+"' where "
+ "id_pasok = '"+idPasok+"'";
int i = classkoneksi.execute(SQL);
if(i>0){
JOptionPane.showMessageDialog(rootPane, "Data berhasil diubah.","Success",JOptionPane.INFORMATION_MESSAGE);
}else{
JOptionPane.showMessageDialog(rootPane, "Data gagal diubah.","Gagal",JOptionPane.WARNING_MESSAGE);
}
}
private void pushData(){
String SQL = "Select * from tbl_pasok where id_pasok = '"+this.getIdPasok()+"'";
try{
ResultSet rs = classkoneksi.executeQuery(SQL);
if(rs.next()){
txtIdPasok.setText(rs.getString(1));
cboDistributor.setSelectedItem(rs.getString(2));
cboBuku.setSelectedItem(rs.getString(3));
txtJumlah.setText(rs.getString(4));
txtTanggal.setText(rs.getString(5));
}
}catch(Exception e){
JOptionPane.showMessageDialog(rootPane, "kesalahan dalam database");
System.out.println(e);
}
}
private void cetak(){
{btnCetak.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
Connection cn = classkoneksi.setKoneksi();
try {
Statement st = cn.createStatement();
Map<String, Object> prs = new HashMap<String, Object>();
prs.put("idPasok", txtIdPasok.getText());
JasperReport JRpt =
JasperCompileManager.compileReport("src/Laporan/fakturPasok.jrxml");
JasperPrint JPrint = JasperFillManager.fillReport(JRpt, prs, cn);
JasperViewer view = new JasperViewer(JPrint, false);
javax.swing.JDialog dialog = new javax.swing.JDialog(new javax.swing.JFrame(),true);//the owner
dialog.setContentPane(view.getContentPane());
dialog.setSize(700,882);
dialog.setTitle("Laporan Transaksi");
dialog.setVisible(true);
dialog.setLocationRelativeTo(this);
} catch (Exception rptexcpt) {
System.out.println("Report Can't view because : " + rptexcpt);
}
btnCetak.setCursor(Cursor.getDefaultCursor());
}
}
public void bersih(){
txtNama.setText("");
txtAlamat.setText("");
txtJudul.setText("");
txtIsbn.setText("");
txtPenulis.setText("");
txtPenerbit.setText("");
txtTahun.setText("");
txtStok.setText("");
txtHarga.setText("");
txtJumlah.setText("");
}
/**
* 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">
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
btnSimpan = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jPanel3 = new javax.swing.JPanel();
cboDistributor = new javax.swing.JComboBox<String>();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
txtNama = new javax.swing.JTextField();
jScrollPane1 = new javax.swing.JScrollPane();
txtAlamat = new javax.swing.JTextArea();
jPanel4 = new javax.swing.JPanel();
jLabel4 = new javax.swing.JLabel();
cboBuku = new javax.swing.JComboBox();
jLabel11 = new javax.swing.JLabel();
txtIsbn = new javax.swing.JTextField();
txtJudul = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
txtPenulis = new javax.swing.JTextField();
jLabel12 = new javax.swing.JLabel();
txtPenerbit = new javax.swing.JTextField();
txtHarga = new javax.swing.JTextField();
jLabel9 = new javax.swing.JLabel();
txtStok = new javax.swing.JTextField();
jLabel13 = new javax.swing.JLabel();
txtTahun = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
txtJumlah = new javax.swing.JTextField();
jLabel10 = new javax.swing.JLabel();
txtTanggal = new javax.swing.JTextField();
jLabel14 = new javax.swing.JLabel();
txtIdPasok = new javax.swing.JTextField();
btnCetak = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
}
});
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Pasok"));
btnSimpan.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484900179_floppy_disk_save.png"))); // NOI18N
btnSimpan.setText("SIMPAN");
btnSimpan.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSimpanActionPerformed(evt);
}
});
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484900274_ic_cancel_48px.png"))); // NOI18N
jButton2.setText("BATAL");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484900317_common-logout-signout-exit-glyph.png"))); // NOI18N
jButton3.setText("KELUAR");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Distributor", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(153, 0, 0))); // NOI18N
cboDistributor.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cboDistributorActionPerformed(evt);
}
});
jLabel1.setText("Id Distributor :");
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel2.setText("Nama : ");
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel3.setText("Alamat : ");
txtAlamat.setColumns(20);
txtAlamat.setRows(5);
jScrollPane1.setViewportView(txtAlamat);
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cboDistributor, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE))
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtNama)))
.addContainerGap())
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cboDistributor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtNama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jLabel3)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jScrollPane1))
.addContainerGap())
);
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Buku", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(153, 0, 0)), "", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(153, 0, 0))); // NOI18N
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel4.setText("Buku : ");
cboBuku.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
cboBukuItemStateChanged(evt);
}
});
cboBuku.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cboBukuActionPerformed(evt);
}
});
jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel11.setText("No ISBN : ");
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel6.setText("Judul : ");
jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel7.setText("Penulis : ");
jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel12.setText("Penerbit : ");
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel9.setText("Harga : ");
jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel13.setText("Stok : ");
jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel5.setText("Tahun : ");
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel7)
.addComponent(jLabel4)
.addComponent(jLabel6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addComponent(cboBuku, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(10, 10, 10)
.addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtIsbn))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addComponent(txtPenulis, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel12)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtPenerbit))
.addComponent(txtJudul, javax.swing.GroupLayout.PREFERRED_SIZE, 374, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtTahun, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtStok, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(32, 32, 32)
.addComponent(jLabel9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtHarga)))
.addContainerGap(27, Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(cboBuku, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel11)
.addComponent(txtIsbn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(6, 6, 6)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(txtJudul, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(4, 4, 4)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(txtPenulis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtPenerbit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel12))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(txtTahun, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel13)
.addComponent(txtStok, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel9)
.addComponent(txtHarga, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 14, Short.MAX_VALUE))
);
jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel8.setText("Jumlah Pasok : ");
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel10.setText("Tanggal Pasok : ");
txtTanggal.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtTanggalActionPerformed(evt);
}
});
jLabel14.setText("Id Pasok");
btnCetak.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484901579_print.png"))); // NOI18N
btnCetak.setText("CETAK");
btnCetak.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCetakActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtJumlah, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtTanggal)))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnSimpan)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnCetak)
.addGap(18, 18, 18)
.addComponent(jButton3)))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(21, 21, 21)
.addComponent(jLabel14)
.addGap(18, 18, 18)
.addComponent(txtIdPasok, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(40, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel14)
.addComponent(txtIdPasok, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnSimpan)
.addComponent(jButton2))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel8)
.addComponent(txtJumlah, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel10)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtTanggal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnCetak)
.addComponent(jButton3)))))
.addContainerGap())
);
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()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>
private void cboBukuItemStateChanged(java.awt.event.ItemEvent evt) {
// TODO add your handling code here:
}
private void formWindowOpened(java.awt.event.WindowEvent evt) {
// TODO add your handling code here:
if(this.isUpdate()==true){
getDistributor();
getBuku();
pushData();
btnSimpan.setText("Update");
}else{
IdPasok();
getDistributor();
getBuku();
tglTransaksi();
btnSimpan.setText("Simpan");
}
}
private void cboBukuActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
getDetBuku();
}
private void cboDistributorActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
getDetDistributor();
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
this.dispose();
}
private void btnSimpanActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if(this.isUpdate() == true){
updateData();
}else{
simpan();
}
}
private void btnCetakActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
cetak();
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
bersih();
}
private void txtTanggalActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Pasok.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Pasok.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Pasok.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Pasok.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Pasok().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton btnCetak;
private javax.swing.JButton btnSimpan;
private javax.swing.JComboBox cboBuku;
private javax.swing.JComboBox<String> cboDistributor;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea txtAlamat;
private javax.swing.JTextField txtHarga;
private javax.swing.JTextField txtIdPasok;
private javax.swing.JTextField txtIsbn;
private javax.swing.JTextField txtJudul;
private javax.swing.JTextField txtJumlah;
private javax.swing.JTextField txtNama;
private javax.swing.JTextField txtPenerbit;
private javax.swing.JTextField txtPenulis;
private javax.swing.JTextField txtStok;
private javax.swing.JTextField txtTahun;
private javax.swing.JTextField txtTanggal;
// End of variables declaration
/**
* @return the idPasok
*/
public String getIdPasok() {
return idPasok;
}
/**
* @param idPasok the idPasok to set
*/
public void setIdPasok(String idPasok) {
this.idPasok = idPasok;
}
/**
* @return the diskon
*/
public String getDiskon() {
return diskon;
}
/**
* @param diskon the diskon to set
*/
public void setDiskon(String diskon) {
this.diskon = diskon;
}
/**
* @return the update
*/
public boolean isUpdate() {
return update;
}
/**
* @param update the update to set
*/
public void setUpdate(boolean update) {
this.update = update;
}
}
Comments
Post a Comment