Skip to content
Snippets Groups Projects
Commit b388c129 authored by Rafi Zereselasie (raz070)'s avatar Rafi Zereselasie (raz070)
Browse files

Added an error/success message while adding a new shift.

parent bbd74854
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,8 @@ public class Controller {
ComboBox editEmployeeBox;
@FXML
CheckBox editEmployeeManager;
@FXML
Label addShiftError;
......@@ -166,7 +168,7 @@ public class Controller {
LocalDate date = addShiftDatePicker.getValue();
System.out.println(date.toString());
model.addShift(model.getIDbyIndex(index),date.toString(),Integer.parseInt(startTime),Integer.parseInt(endTime));
addShiftError.setText(model.addShift(model.getIDbyIndex(index),date.toString(),Integer.parseInt(startTime),Integer.parseInt(endTime)));
System.out.println(model.getIDbyIndex(index) + "20210101" + Integer.parseInt(startTime) + Integer.parseInt(endTime));
//System.out.println(employee + startTime + endTime + date);
......
......@@ -276,7 +276,7 @@ public class Model {
writer.println("addShift/" + id + "/" + date + "/" + start + "/" + end + "/" + " ");
notifySubscribers();
return "New shift added";
return "Shift added";
}
......
......@@ -37,6 +37,7 @@
</HBox>
</children>
</HBox>
<Label fx:id="addShiftError" prefHeight="50.0" prefWidth="300.0" textAlignment="CENTER" />
<Button fx:id="addShiftSubmitButton" mnemonicParsing="false" onMouseClicked="#addShiftSubmitClicked" text="Submit" />
</children>
</VBox>
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