Advertisement
Wisnugroho28

CRUDInventory

Dec 11th, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.51 KB | None | 0 0
  1. private void bttambahActionPerformed(java.awt.event.ActionEvent evt) {                                        
  2.         // TODO add your handling code here:
  3.         if(bttambah.getText().equalsIgnoreCase("tambah")){
  4.             bttambah.setText("Refresh");
  5.             bersih();
  6.             SiapIsi(true);
  7.             idcloth();
  8.  
  9.             //txidcloth.setEnabled(true);
  10.             bttambah.setEnabled(true);
  11.             btsimpan.setEnabled(true);
  12.             bthapus.setEnabled(false);
  13.             btedit.setEnabled(false);
  14.         } else{
  15.             bttambah.setText("Tambah");
  16.             bersih();
  17.             SiapIsi(false);
  18.             TombolNormal();
  19.             tabelinventory();
  20.         }
  21.     }                                        
  22.  
  23.     private void btsimpanActionPerformed(java.awt.event.ActionEvent evt) {                                        
  24.         // TODO add your handling code here:
  25.         if(txidcloth.getText().isEmpty()
  26.             ||txnama.getText().isEmpty()
  27.             ||txjenis.getText().isEmpty()
  28.             ||txstok.getText().isEmpty()
  29.             ||txhargamodal.getText().isEmpty()
  30.             ||txhargajual.getText().isEmpty()
  31.             ||txincome.getText().isEmpty()){
  32.  
  33.             JOptionPane.showMessageDialog(null, "LENGKAPI INPUTAN DATA!!!","",JOptionPane.INFORMATION_MESSAGE);
  34.         } else{
  35.  
  36.             if(bttambah.getText().equalsIgnoreCase("Refresh")){
  37.                 if(bttambah.getText().equalsIgnoreCase("Refresh")){
  38.                     simpan();
  39.                 } else{
  40.                     JOptionPane.showMessageDialog(null, "SIMPAN DATA GAGAL, PERIKSA KEMBALI :( ","",JOptionPane.INFORMATION_MESSAGE);
  41.                 }
  42.             }
  43.             if(btedit.getText().equalsIgnoreCase("batal")){
  44.                 if(btedit.getText().equalsIgnoreCase("batal")){
  45.                     edit();
  46.                 } else{
  47.                     JOptionPane.showMessageDialog(null, "EDIT DATA GAGAL, PERIKSA KEMBALI :( ","",JOptionPane.INFORMATION_MESSAGE);
  48.                 }
  49.             }
  50.             bersih();
  51.             SiapIsi(false);
  52.             bttambah.setText("Tambah");
  53.             btedit.setText("Edit");
  54.             TombolNormal();
  55.  
  56.         }
  57.     }                                        
  58.  
  59.     private void bteditActionPerformed(java.awt.event.ActionEvent evt) {                                      
  60.         // TODO add your handling code here:
  61.         if(btedit.getText().equalsIgnoreCase("edit")){
  62.             btedit.setText("Batal");
  63.             SiapIsi(true);
  64.             bttambah.setEnabled(false);
  65.             btsimpan.setEnabled(true);
  66.             bthapus.setEnabled(false);
  67.             btedit.setEnabled(true);
  68.         } else{
  69.             btedit.setText("Edit");
  70.             bersih();
  71.             SiapIsi(false);
  72.             TombolNormal();
  73.  
  74.         }
  75.     }                                      
  76.  
  77.     private void bthapusActionPerformed(java.awt.event.ActionEvent evt) {                                        
  78.         // TODO add your handling code here:
  79.         int pesan=JOptionPane.showConfirmDialog(null, "YAKIN DATA AKAN DIHAPUS ?","Konfirmasi",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);
  80.         if(pesan==JOptionPane.YES_OPTION){
  81.             if(pesan==JOptionPane.YES_OPTION){
  82.                 hapus();
  83.                 bersih();
  84.                 SiapIsi(false);
  85.                 TombolNormal();
  86.             } else{
  87.                 JOptionPane.showMessageDialog(null, "HAPUS DATA GAGAL :(");
  88.             }
  89.  
  90.         }
  91.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement