Professional Documents
Culture Documents
JButton(Submit)
JButton(Back To Dashboard)
JBuuton(Back to Gift Card
Menu)
JButton(Check Another One)
Name
Assigned
butsub
butback
butgcm
Properties Modified
butcao
Coding for BACK TO DASHBOARD Button :Refer to FRAME NO. IRTRS_07 (BACK TO DASHBOARD BUTTON)
String Query1 = "SELECT txnid,balance from giftcard where id = '"+gc+"' && gifpin
= '"+gifpin+"';";
ResultSet rs1=stmt1.executeQuery(Query1);
if (rs1.next()){String balance1 = rs1.getString("balance");
String txnid1 = rs1.getString("txnid");
lblgcb.setText(""+balance1);
lbltxn.setText(""+txnid1);}
try {Class.forName("java.sql.DriverManager");
Connection con2 = (Connection)
DriverManager.getConnection
("jdbc:mysql://localhost:3306/irtrc","root","654321");
Statement stmt2 = (Statement) con2.createStatement();
String Query ="SELECT txn_desc,debit,balance FROM giftcard_txn where gcno =
'"+gc+"';";
ResultSet rs=stmt2.executeQuery(Query);
while (rs.next()){String txn_desc = rs.getString("txn_desc");
String debit = rs.getString("debit");
String balance = rs.getString("balance");
model.addRow(new Object[] {txn_desc,debit,balance});
lblgcb.setVisible(true);
lbltxn.setVisible(true);
gcb.setVisible(true);
txn.setVisible(true);
txtgc.setEditable(false);
txtgifpin.setEditable(false);butback.setVisible(false);butsub.setEnabled(false);
butbtd.setVisible(true);butcao.setVisible(true);
butgcm.setVisible(true);}}
catch (Exception e) {JOptionPane.showMessageDialog (this,e.getMessage());}}
catch (Exception e) {JOptionPane.showMessageDialog (this,e.getMessage());}}
else{JOptionPane.showMessageDialog(this,"Invalid Credentials Entered. ");}}}
catch (Exception e) {JOptionPane.showMessageDialog (this,e.getMessage());}}}}}
}
Coding for CHECK ANOTHER ONE Button :private void butcaoActionPerformed(java.awt.event.ActionEvent evt) {
dispose(); new checkgc().setVisible(true);}
Coding for BACK TO GIFT CARD MENU Button :private void butgcmActionPerformed(java.awt.event.ActionEvent evt) {
dispose(); new giftcard().setVisible(true);}