Skip to content
Snippets Groups Projects
Commit dc036c85 authored by Rafi's avatar Rafi
Browse files

When an employee is deleted from the database there shifts are deleted locally now.

parent e086eb89
No related branches found
No related tags found
1 merge request!6Changed update implementation for employees so rather than sending the whole...
...@@ -62,8 +62,15 @@ public class ReceiveThread extends Thread { ...@@ -62,8 +62,15 @@ public class ReceiveThread extends Thread {
} }
private void removeEmployee(String employeeID) { private void removeEmployee(String employeeID) {
int intID = -1;
try { try {
this.client.employees.remove(Integer.parseInt(employeeID)); intID = Integer.parseInt(employeeID);
this.client.employees.remove(intID);
for (Shift shift : this.client.shifts.values()) {
if (shift.getEmployeeID() == intID) {
this.client.shifts.remove(shift.getShiftID());
}
}
} catch (Exception exception) { } catch (Exception exception) {
exception.printStackTrace(); exception.printStackTrace();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment