Skip to content
Snippets Groups Projects
Commit d1075f9d authored by Syed OMAR's avatar Syed OMAR
Browse files

Edit Service button on home page now works

parent eb454380
No related branches found
No related tags found
No related merge requests found
Pipeline #8265 canceled
......@@ -56,4 +56,50 @@ public class MainPageController {
e.printStackTrace();
}
}
@FXML
private void handleEditService(ActionEvent event) {
try {
Stage currentStage = (Stage) ((Node) event.getSource()).getScene().getWindow();
// Load DeleteServiceScene.fxml
FXMLLoader loader = new FXMLLoader(getClass().getResource("EditInfoScene.fxml"));
Parent root = loader.load();
// Create a new stage
Stage stage = new Stage();
stage.setTitle("Edit Your Services");
stage.setScene(new Scene(root));
stage.show();
// Close the Main Page
currentStage.close();
} catch (IOException e) {
e.printStackTrace();
}
}
@FXML
private void viewAllServices(ActionEvent event) {
try {
Stage currentStage = (Stage) ((Node) event.getSource()).getScene().getWindow();
// Load DeleteServiceScene.fxml
FXMLLoader loader = new FXMLLoader(getClass().getResource("ViewServicesScene.fxml"));
Parent root = loader.load();
// Create a new stage
Stage stage = new Stage();
stage.setTitle("View All Your Services");
stage.setScene(new Scene(root));
stage.show();
// Close the Main Page
currentStage.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
......@@ -21,7 +21,7 @@
<Button fx:id="deleteServiceButton" layoutX="10.0" layoutY="61.0" mnemonicParsing="false" onAction="#handleDeleteService" prefHeight="51.0" prefWidth="136.0" style="-fx-border-color: black; -fx-border-width: 0px 0px 2px 0px;" styleClass="backgroundColor" stylesheets="@LoginScene-Pane.css" text="Delete Service" />
<Button layoutX="10.0" layoutY="112.0" mnemonicParsing="false" prefHeight="51.0" prefWidth="136.0" style="-fx-border-color: black; -fx-border-width: 0px 0px 2px 0px;" styleClass="backgroundColor" stylesheets="@LoginScene-Pane.css" text="Delete All Service" />
<Button layoutX="10.0" layoutY="163.0" mnemonicParsing="false" prefHeight="51.0" prefWidth="136.0" style="-fx-border-color: black; -fx-border-width: 0px 0px 2px 0px;" styleClass="backgroundColor" stylesheets="@LoginScene-Pane.css" text="View All services" />
<Button mnemonicParsing="false" prefHeight="51.0" prefWidth="136.0" style="-fx-border-color: black; -fx-border-width: 0px 0px 2px 0px;" styleClass="backgroundColor" stylesheets="@LoginScene-Pane.css" text="Edit Info" />
<Button fx:id="editServiceButton" mnemonicParsing="false" onAction="#handleEditService" prefHeight="51.0" prefWidth="136.0" style="-fx-border-color: black; -fx-border-width: 0px 0px 2px 0px;" styleClass="backgroundColor" stylesheets="@LoginScene-Pane.css" text="Edit Info" />
</children>
</VBox>
</left>
......
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