ready for testing
This commit is contained in:
		
							parent
							
								
									88cc2680ad
								
							
						
					
					
						commit
						fa36d02929
					
				
					 15 changed files with 33 additions and 45 deletions
				
			
		|  | @ -1,19 +0,0 @@ | ||||||
| The Earthsea Cycle |  | ||||||
| The Chronicles of Narnia |  | ||||||
| The Mistborn Series |  | ||||||
| The Earthsea Cycle |  | ||||||
| The Kingkiller Chronicle |  | ||||||
| The Kingkiller Chronicle |  | ||||||
| The Kingkiller Chronicle |  | ||||||
| The Kingkiller Chronicle |  | ||||||
| The Kingkiller Chronicle |  | ||||||
| The Kingkiller Chronicle |  | ||||||
| The Kingkiller Chronicle |  | ||||||
| The Kingkiller Chronicle |  | ||||||
| The Kingkiller Chronicle |  | ||||||
| The Kingkiller Chronicle |  | ||||||
| The Kingkiller Chronicle |  | ||||||
| The Kingkiller Chronicle |  | ||||||
| The Kingkiller Chronicle |  | ||||||
| The Kingkiller Chronicle |  | ||||||
| The Wheel of Time |  | ||||||
|  | @ -76,12 +76,12 @@ public class CartController { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleCartButton() throws IOException { |     private void handleCartButton(ActionEvent event) throws IOException { | ||||||
|         App.setRoot("cart"); |         App.setRoot("cart"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleLoginButton() throws IOException { |     private void handleLoginButton(ActionEvent event) throws IOException { | ||||||
|         App.setRoot("login"); |         App.setRoot("login"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,10 +1,14 @@ | ||||||
| package com.example; | package com.example; | ||||||
| 
 | 
 | ||||||
|  | import java.io.BufferedReader; | ||||||
|  | import java.io.FileReader; | ||||||
|  | import java.io.FileWriter; | ||||||
| import java.io.IOException; | import java.io.IOException; | ||||||
| 
 | 
 | ||||||
| import javafx.event.ActionEvent; | import javafx.event.ActionEvent; | ||||||
| import javafx.fxml.FXML; | import javafx.fxml.FXML; | ||||||
| import javafx.scene.control.*; | import javafx.scene.control.*; | ||||||
|  | import javafx.scene.control.Alert.AlertType; | ||||||
| import javafx.scene.input.MouseEvent; | import javafx.scene.input.MouseEvent; | ||||||
| 
 | 
 | ||||||
| public class CheckOutController { | public class CheckOutController { | ||||||
|  | @ -78,12 +82,12 @@ public class CheckOutController { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleCartButton() throws IOException { |     private void handleCartButton(ActionEvent event) throws IOException { | ||||||
|         App.setRoot("cart"); |         App.setRoot("cart"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleLoginButton() throws IOException { |     private void handleLoginButton(ActionEvent event) throws IOException { | ||||||
|         App.setRoot("login"); |         App.setRoot("login"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -109,12 +113,13 @@ public class CheckOutController { | ||||||
| 
 | 
 | ||||||
|         // Validate the input fields |         // Validate the input fields | ||||||
|         if (fullName.isEmpty() || address.isEmpty() || city.isEmpty() || zip.isEmpty() || cardNumber.isEmpty() |         if (fullName.isEmpty() || address.isEmpty() || city.isEmpty() || zip.isEmpty() || cardNumber.isEmpty() | ||||||
|                 || cardHolderName.isEmpty() || expiryDate.isEmpty() || cvv.isEmpty()) { |                 || cardHolderName.isEmpty() || expiryDate.isEmpty() || cvv.isEmpty() || country.isEmpty()) { | ||||||
|             System.out.println("Please fill out all fields."); |             Alert alert = new Alert(AlertType.ERROR, "Please fill out all fields.", ButtonType.OK); | ||||||
|  |             alert.showAndWait(); | ||||||
|         } else { |         } else { | ||||||
|             System.out.println("Form submitted successfully."); |             Alert alert = new Alert(AlertType.INFORMATION, "Form submitted successfully.", ButtonType.OK); | ||||||
|             System.out.printf("Billing Info: %s, %s, %s, %s, %s\n", fullName, address, city, zip, country); |             alert.showAndWait(); | ||||||
|             System.out.printf("Credit Card Info: %s, %s, %s, CVV: %s\n", cardNumber, cardHolderName, expiryDate, cvv); |             FileWriter fileWriter = new FileWriter("cart.txt", false); | ||||||
|             App.setRoot("shop"); |             App.setRoot("shop"); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -130,7 +130,7 @@ public class LoginController { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleCartButton() throws IOException { |     private void handleCartButton(ActionEvent event) throws IOException { | ||||||
|         App.setRoot("cart"); |         App.setRoot("cart"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -153,12 +153,12 @@ public class RegisterController { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleCartButton() throws IOException { |     private void handleCartButton(ActionEvent event) throws IOException { | ||||||
|         App.setRoot("cart"); |         App.setRoot("cart"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleLoginButton() throws IOException { |     private void handleLoginButton(ActionEvent event) throws IOException { | ||||||
|         App.setRoot("login"); |         App.setRoot("login"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -3,6 +3,8 @@ package com.example; | ||||||
| import java.io.BufferedWriter; | import java.io.BufferedWriter; | ||||||
| import java.io.FileWriter; | import java.io.FileWriter; | ||||||
| import java.io.IOException; | import java.io.IOException; | ||||||
|  | 
 | ||||||
|  | import javafx.event.ActionEvent; | ||||||
| import javafx.fxml.FXML; | import javafx.fxml.FXML; | ||||||
| import javafx.scene.control.Button; | import javafx.scene.control.Button; | ||||||
| import javafx.scene.control.Label; | import javafx.scene.control.Label; | ||||||
|  | @ -43,53 +45,53 @@ public class ShopController { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleCartButton() throws IOException { |     private void handleCartButton(ActionEvent event) throws IOException { | ||||||
|         App.setRoot("cart"); |         App.setRoot("cart"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleLoginButton() throws IOException { |     private void handleLoginButton(ActionEvent event) throws IOException { | ||||||
|         App.setRoot("login"); |         App.setRoot("login"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     // Book Addition Handlers |     // Book Addition Handlers | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleAddToCartButton1() { |     private void handleAddToCartButton1(ActionEvent event) { | ||||||
|         addToCart("Lord of the Rings"); |         addToCart("Lord of the Rings"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleAddToCartButton2() { |     private void handleAddToCartButton2(ActionEvent event) { | ||||||
|         addToCart("The Wheel of Time"); |         addToCart("The Wheel of Time"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleAddToCartButton3() { |     private void handleAddToCartButton3(ActionEvent event) { | ||||||
|         addToCart("The Chronicles of Narnia"); |         addToCart("The Chronicles of Narnia"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleAddToCartButton4() { |     private void handleAddToCartButton4(ActionEvent event) { | ||||||
|         addToCart("The Earthsea Cycle"); |         addToCart("The Earthsea Cycle"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleAddToCartButton5() { |     private void handleAddToCartButton5(ActionEvent event) { | ||||||
|         addToCart("The First Law Trilogy"); |         addToCart("The First Law Trilogy"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleAddToCartButton6() { |     private void handleAddToCartButton6(ActionEvent event) { | ||||||
|         addToCart("The Kingkiller Chronicle"); |         addToCart("The Kingkiller Chronicle"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleAddToCartButton7() { |     private void handleAddToCartButton7(ActionEvent event) { | ||||||
|         addToCart("The Mistborn Series"); |         addToCart("The Mistborn Series"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @FXML |     @FXML | ||||||
|     private void handleAddToCartButton8() { |     private void handleAddToCartButton8(ActionEvent event) { | ||||||
|         addToCart("The Stormlight Archive"); |         addToCart("The Stormlight Archive"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -41,7 +41,7 @@ | ||||||
|             <Insets /> |             <Insets /> | ||||||
|          </BorderPane.margin> |          </BorderPane.margin> | ||||||
|          <children> |          <children> | ||||||
|             <Button fx:id="btnCheckOut" mnemonicParsing="false" onMouseClicked="#handleCheckOutButton" styleClass="btnCheckOut" text="Check out" GridPane.rowIndex="2" /> |             <Button fx:id="btnCheckOut" mnemonicParsing="false" onAction="#handleCheckOutButton" styleClass="btnCheckOut" text="Check out" GridPane.rowIndex="2" /> | ||||||
|             <Label fx:id="cartTitle" styleClass="cartTitle" text="Your cart" /> |             <Label fx:id="cartTitle" styleClass="cartTitle" text="Your cart" /> | ||||||
|             <TableView fx:id="cartContent" prefHeight="0.0" prefWidth="364.0" GridPane.rowIndex="1"> |             <TableView fx:id="cartContent" prefHeight="0.0" prefWidth="364.0" GridPane.rowIndex="1"> | ||||||
|                <columns> |                <columns> | ||||||
|  |  | ||||||
|  | @ -113,7 +113,7 @@ | ||||||
|                      <Label fx:id="cvvLabel" text="CVV:" textFill="WHITE" /> |                      <Label fx:id="cvvLabel" text="CVV:" textFill="WHITE" /> | ||||||
|                      <PasswordField fx:id="cvvField" /> |                      <PasswordField fx:id="cvvField" /> | ||||||
|                   </HBox> |                   </HBox> | ||||||
|                   <Button fx:id="submitButton" alignment="CENTER" contentDisplay="CENTER" prefWidth="150" style="-fx-alignment: #4CAF50; -fx-text-fill: white; -fx-font-size: 16px; -fx-font-weight: bold;" styleClass="cartBtn" text="Submit" GridPane.columnSpan="2" GridPane.rowIndex="9" /> |                   <Button fx:id="submitButton" alignment="CENTER" onAction="#handleSubmit" contentDisplay="CENTER" prefWidth="150" style="-fx-alignment: #4CAF50; -fx-text-fill: white; -fx-font-size: 16px; -fx-font-weight: bold;" styleClass="cartBtn" text="Submit" GridPane.columnSpan="2" GridPane.rowIndex="9" /> | ||||||
|                </children> |                </children> | ||||||
|                <columnConstraints> |                <columnConstraints> | ||||||
|                   <ColumnConstraints /> |                   <ColumnConstraints /> | ||||||
|  |  | ||||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							|  | @ -41,7 +41,7 @@ | ||||||
|             <Insets /> |             <Insets /> | ||||||
|          </BorderPane.margin> |          </BorderPane.margin> | ||||||
|          <children> |          <children> | ||||||
|             <Button fx:id="btnCheckOut" mnemonicParsing="false" onMouseClicked="#handleCheckOutButton" styleClass="btnCheckOut" text="Check out" GridPane.rowIndex="2" /> |             <Button fx:id="btnCheckOut" mnemonicParsing="false" onAction="#handleCheckOutButton" styleClass="btnCheckOut" text="Check out" GridPane.rowIndex="2" /> | ||||||
|             <Label fx:id="cartTitle" styleClass="cartTitle" text="Your cart" /> |             <Label fx:id="cartTitle" styleClass="cartTitle" text="Your cart" /> | ||||||
|             <TableView fx:id="cartContent" prefHeight="0.0" prefWidth="364.0" GridPane.rowIndex="1"> |             <TableView fx:id="cartContent" prefHeight="0.0" prefWidth="364.0" GridPane.rowIndex="1"> | ||||||
|                <columns> |                <columns> | ||||||
|  |  | ||||||
|  | @ -113,7 +113,7 @@ | ||||||
|                      <Label fx:id="cvvLabel" text="CVV:" textFill="WHITE" /> |                      <Label fx:id="cvvLabel" text="CVV:" textFill="WHITE" /> | ||||||
|                      <PasswordField fx:id="cvvField" /> |                      <PasswordField fx:id="cvvField" /> | ||||||
|                   </HBox> |                   </HBox> | ||||||
|                   <Button fx:id="submitButton" alignment="CENTER" contentDisplay="CENTER" prefWidth="150" style="-fx-alignment: #4CAF50; -fx-text-fill: white; -fx-font-size: 16px; -fx-font-weight: bold;" styleClass="cartBtn" text="Submit" GridPane.columnSpan="2" GridPane.rowIndex="9" /> |                   <Button fx:id="submitButton" alignment="CENTER" onAction="#handleSubmit" contentDisplay="CENTER" prefWidth="150" style="-fx-alignment: #4CAF50; -fx-text-fill: white; -fx-font-size: 16px; -fx-font-weight: bold;" styleClass="cartBtn" text="Submit" GridPane.columnSpan="2" GridPane.rowIndex="9" /> | ||||||
|                </children> |                </children> | ||||||
|                <columnConstraints> |                <columnConstraints> | ||||||
|                   <ColumnConstraints /> |                   <ColumnConstraints /> | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue