Skip to content

Commit

Permalink
Merge pull request #36 from ahmedsiam0/add-orders-button
Browse files Browse the repository at this point in the history
Add order button
  • Loading branch information
ahmedsiam0 authored Dec 21, 2023
2 parents e927b21 + e39621b commit 8d3b1da
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/main/java/com/asu/librarysystem/CustomerController.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ public void switchToManagingCustomerProfile(ActionEvent event)throws IOException
}

}
@FXML
void switchToOrders(ActionEvent event) {
try {
customerViewNodes= FXMLLoader.load(MainApplication.class.getResource("orders-for-customer-view.fxml"));
customerStage= (Stage)((Node)event.getSource()).getScene().getWindow();
customerScene =new Scene(customerViewNodes);
customerStage.setScene(customerScene);
customerStage.show();
}catch (Exception switchingScenesException){
System.out.println(switchingScenesException.getMessage());
}
}

@FXML
void switchToCart(ActionEvent event) {
try {
Expand Down
7 changes: 6 additions & 1 deletion src/main/resources/com/asu/librarysystem/CustomerMain.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,18 @@
</Button>
</children>
</VBox>
<VBox layoutX="700.0" layoutY="188.0" prefHeight="322.0" prefWidth="401.0" spacing="220.0">
<VBox layoutX="700.0" layoutY="188.0" prefHeight="322.0" prefWidth="401.0" spacing="100.0">
<children>
<Button mnemonicParsing="false" onAction="#switchToManagingCustomerProfile" prefHeight="53.0" prefWidth="402.0" style="-fx-background-color: #F4EEE0;" text="managing profile" textFill="#00adb5">
<font>
<Font name="Georgia" size="22.0" />
</font>
</Button>
<Button layoutX="10.0" layoutY="10.0" mnemonicParsing="false" onAction="#switchToOrders" prefHeight="53.0" prefWidth="402.0" style="-fx-background-color: #F4EEE0;" text="orders" textFill="#00adb5">
<font>
<Font name="Georgia" size="22.0" />
</font>
</Button>
<Button mnemonicParsing="false" onAction="#logout" prefHeight="53.0" prefWidth="402.0" style="-fx-background-color: #F4EEE0;" text="logout" textFill="#00adb5">
<font>
<Font name="Georgia" size="22.0" />
Expand Down

0 comments on commit 8d3b1da

Please sign in to comment.