private void NapItemDuocChon()
{
if (tableNhanVien.getSelectedRow() < 0) {
return;
}
int row = tableNhanVien.getSelectedRow();
tfMaNhanVien.setText(tableNhanVien.getValueAt(row, 0).toString()); tfHoTen.setText((String)tableNhanVien.getValueAt(row, 1));
dtpNgaySinh.setDate((Date)tableNhanVien.getValueAt(row, 2)); tfDienThoai.setText((String)tableNhanVien.getValueAt(row, 3)); tfDiaChi.setText((String)tableNhanVien.getValueAt(row, 4));
//cot 5???
//dtpNgaySinh.requestFocus();
}
public void ThemXoaSua(String sqlCommand)
{
Statement st;
try
{
st = con.createStatement();
int n = st.executeUpdate(sqlCommand);
if(n>0)
JOptionPane.showMessageDialog(null,"Thực thi thành công!");
Trang 2else
JOptionPane.showMessageDialog(null,"Thực thi không thành công!");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null,"Loi thuc thi cau SQL:\n" + sqlCommand); }
}