Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Change student prefekt
- public void updatePrefekt(JComboBox studentHome, JComboBox student) {
- try {
- String dorm = studentHome.getSelectedItem().toString();
- String newPrefekt = student.getSelectedItem().toString();
- String[] splitStr = newPrefekt.split("\\s+");
- String newPrefektId = getId(splitStr[0], splitStr[1]);
- String command = "UPDATE elevhem SET prefekt= " + newPrefektId + " WHERE elevhemsnamn= '" + dorm + "'";
- hwdb.update(command);
- } catch (InfException e) {
- System.out.println(e.getMessage());
- }
- }
- //Change forestandre for a dorm
- public void updateForestandare(JComboBox studentHome, JComboBox teacher) {
- try {
- String dorm = studentHome.getSelectedItem().toString();
- String newForestandare = teacher.getSelectedItem().toString();
- String[] splitStr = newForestandare.split("\\s+");
- String newFore = getIdTeacher(splitStr[0], splitStr[1]);
- String command = "UPDATE elevhem SET forestandare= " + newFore + " WHERE elevhemsnamn= '" + dorm + "'";
- hwdb.update(command);
- } catch (InfException e) {
- System.out.println(e.getMessage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement