Skip to content
Snippets Groups Projects
Commit f2be6d50 authored by eyan_'s avatar eyan_
Browse files

remove employee works, daily/weekly views not updating

parent 22a199df
No related branches found
No related tags found
No related merge requests found
Showing with 19 additions and 20 deletions
......@@ -46,6 +46,10 @@ public class Controller {
HBox addShiftEmployeeHBox;
@FXML
ComboBox removeEmployeeBox;
@FXML
ComboBox addShiftStartTimeBox;
@FXML
ComboBox addShiftEndTimeBox;
......@@ -130,8 +134,8 @@ public class Controller {
System.out.println("submit clicked");
String employee = (String) addShiftEmployeeBox.getValue();
int index = addShiftEmployeeBox.getSelectionModel().getSelectedIndex();
String startTime = addShiftStartTime.getText();
String endTime = addShiftEndTime.getText();
String startTime = (String) addShiftStartTimeBox.getValue();
String endTime = (String) addShiftEndTimeBox.getValue();
LocalDate date = addShiftDatePicker.getValue();
System.out.println(date.toString());
......@@ -331,7 +335,7 @@ public class Controller {
public void addEmployeeClicked(MouseEvent mouseEvent) {
String firstName = addFirstName.getText();
String lastName = addLastName.getText();
rafisWeirdClass.staff.addEmployee(firstName, lastName);
model.addEmployee(firstName, lastName);
System.out.println("Employee " + firstName + " " + lastName + " added to Staff. Welcome "
+ firstName + "!");
}
......@@ -344,9 +348,10 @@ public class Controller {
// Remove Employee
public void removeEmployeeClicked(MouseEvent mouseEvent) {
int index = removeEmployeeBox.getSelectionModel().getSelectedIndex();
int id = model.getIDbyIndex(index);
String id = String.valueOf(model.getIDbyIndex(index));
model.removeEmployee(id);
rafisWeirdClass.staff.removeEmployee(id);
removeEmployeeBox.getSelectionModel().clearSelection();
}
// View Employees
......
......@@ -26,13 +26,13 @@
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<Label text="Start Time" />
<ComboBox onMouseClicked="#addShiftTimeBoxClicked" prefWidth="150.0" />
<ComboBox fx:id="addShiftStartTimeBox" onMouseClicked="#addShiftTimeBoxClicked" prefWidth="150.0" />
</children>
</HBox>
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<Label text="End Time" />
<ComboBox onMouseClicked="#addShiftTimeBoxClicked" prefWidth="150.0" />
<ComboBox fx:id="addShiftEndTimeBox" onMouseClicked="#addShiftTimeBoxClicked" prefWidth="150.0" />
</children>
</HBox>
</children>
......
......@@ -6,7 +6,7 @@
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="489.0" prefWidth="100.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.schedulerapp.Controller">
<children>
<Button mnemonicParsing="false" onMouseClicked="#managerDailyScheduleClicked" prefHeight="163.0" prefWidth="100.0" text="Daily" />
<Button mnemonicParsing="false" onMouseClicked="#mangerScheduleClicked" prefHeight="163.0" prefWidth="100.0" text="Weekly" />
<Button mnemonicParsing="false" onMouseClicked="#managerScheduleClicked" prefHeight="163.0" prefWidth="100.0" text="Weekly" />
<Button mnemonicParsing="false" prefHeight="163.0" prefWidth="100.0" text="Pick-Ups" />
</children>
</VBox>
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -4,11 +4,9 @@
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.DatePicker?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.schedulerapp.Controller">
<children>
<HBox prefHeight="100.0" prefWidth="200.0">
......@@ -28,13 +26,13 @@
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<Label text="Start Time" />
<TextField fx:id="addShiftStartTime" />
<ComboBox fx:id="addShiftStartTimeBox" onMouseClicked="#addShiftTimeBoxClicked" prefWidth="150.0" />
</children>
</HBox>
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<Label text="End Time" />
<TextField fx:id="addShiftEndTime" />
<ComboBox fx:id="addShiftEndTimeBox" onMouseClicked="#addShiftTimeBoxClicked" prefWidth="150.0" />
</children>
</HBox>
</children>
......
......@@ -23,7 +23,7 @@
</HBox>
<HBox alignment="CENTER" prefHeight="35.0" prefWidth="800.0">
<children>
<Button alignment="CENTER" contentDisplay="CENTER" maxHeight="-Infinity" minHeight="-Infinity" mnemonicParsing="false" prefHeight="35.0" prefWidth="200.0" text="Schedule" />
<Button alignment="CENTER" contentDisplay="CENTER" maxHeight="-Infinity" minHeight="-Infinity" mnemonicParsing="false" onMouseClicked="#managerScheduleClicked" prefHeight="35.0" prefWidth="200.0" text="Schedule" />
<Button contentDisplay="CENTER" maxHeight="-Infinity" minHeight="-Infinity" mnemonicParsing="false" prefHeight="35.0" prefWidth="200.0" text="Payroll" />
<Button contentDisplay="CENTER" maxHeight="-Infinity" minHeight="-Infinity" mnemonicParsing="false" onMouseClicked="#staffManagerClicked" prefHeight="35.0" prefWidth="200.0" text="Staff" />
<Button alignment="CENTER" contentDisplay="CENTER" maxHeight="-Infinity" minHeight="-Infinity" mnemonicParsing="false" prefHeight="35.0" prefWidth="200.0" text="Requests" />
......
......@@ -2,8 +2,8 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
......@@ -23,16 +23,12 @@
</Label>
<HBox alignment="CENTER" minHeight="-Infinity" minWidth="-Infinity" prefHeight="140.0" prefWidth="700.0">
<children>
<Label text="Employee #: ">
<Label text="Employee: ">
<font>
<Font size="20.0" />
</font>
</Label>
<TextField minHeight="-Infinity" minWidth="-Infinity" prefWidth="300.0" fx:id="removeID">
<font>
<Font size="18.0" />
</font>
</TextField>
<ComboBox fx:id="removeEmployeeBox" onMouseClicked="#removeEmployeeBoxClicked" prefWidth="150.0" />
</children>
</HBox>
<HBox alignment="TOP_CENTER" minHeight="-Infinity" minWidth="-Infinity" prefHeight="200.0" prefWidth="700.0">
......
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