empID=(int)employees[selectedIndex-1][1];
public void updateTable() { int selectedIndex=employeeCmb.getSelectedIndex(); int empID; if (selectedIndex==0) empID =-1; else empID=(int)employees[selectedIndex-1][1]; String adate=dateLbl.getText(); q.connectToDatabase(); empAppointments=q.getEmpAppointments_OA(empID,adate); int appCount=empAppointments.length; Object [][]empAppointments2 = new Object[appCount][4]; for (int i =0; i < appCount; i++) { for (int j=0; j < 4;j++) { empAppointments2[i][j]=empAppointments[i][j]; model=new DefaultTableModel(empAppointments2,colNames); table.setModel(model); q.disconnectFromDatabase(); // System.out.println(colNames); } } } public void actionPerformed(ActionEvent e) { if(e.getSource()==insBtn) { updateTable(); } else if (e.getSource()==nextBtn) { l=l+86400000; d=new Date(l); s=sdf.format(d); dateLbl.setText(s); } else if (e.getSource()==preBtn) { l=l-86400000; d=new Date(l); s=sdf.format(d); dateLbl.setText(s); } else if (e.getSource()==delBtn) { int deleted=q.deleteOneClient(4); } else if(e.getSource()==updBtn) { int inserted=q.insertOneClient("ali","rahim","123 Some Rd","ddd@eee","3456777"); } } public static void main(String[] args) { Queries q = new Queries(); new BookingCard(); } }
empID = Integer.parseInt(employees[selectedIndex-1][1]);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)