Skip to content

Commit

Permalink
some debug
Browse files Browse the repository at this point in the history
  • Loading branch information
almaho committed Jun 26, 2020
1 parent b6d7b0f commit ceea427
Show file tree
Hide file tree
Showing 23 changed files with 20 additions and 11 deletions.
16 changes: 10 additions & 6 deletions src/main/java/controller/BuyLogPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,16 @@ public void handle(MouseEvent e) {
}
}
};
for (BuyLog buyLog : Main.getAccount().getBuyLogList()) {
Button button = new Button();
button.setId(Integer.toString(buyLog.getCode()));
button.setText(Integer.toString(buyLog.getCode()));
button.addEventHandler(MouseEvent.MOUSE_CLICKED, eventHandler);
vBox.getChildren().add(button);
try {
for (BuyLog buyLog : Main.getAccount().getBuyLogList()) {
Button button = new Button();
button.setId(Integer.toString(buyLog.getCode()));
button.setText(Integer.toString(buyLog.getCode()));
button.addEventHandler(MouseEvent.MOUSE_CLICKED, eventHandler);
vBox.getChildren().add(button);
}
}catch (Exception e){

}
scrollPane.setContent(vBox);
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/controller/CartPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public void showProductPage(MouseEvent mouseEvent) throws IOException {


public void purchase(MouseEvent mouseEvent) {
try {
BuyerControl.purchase(Main.getAccount(), Discount.getDiscountByCode(Integer.parseInt(discountCodeText.getText())));
}catch (Exception e){
BuyerControl.purchase(Main.getAccount(), null);
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/controller/OffPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void back(MouseEvent mouseEvent) throws IOException {
public void showProductPage(MouseEvent mouseEvent) throws IOException {
if (chosenProduct != null){
Main.setProduct(chosenProduct);
Main.setScene("productPage");
Main.setScene("ProductPage");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/controller/ProductsPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void back(MouseEvent mouseEvent) throws IOException {
public void showProductPage(MouseEvent mouseEvent) throws IOException {
if (chosenProduct != null){
Main.setProduct(chosenProduct);
Main.setScene("productPage");
Main.setScene("ProductPage");
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/models/Buyer.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public Buyer(String username) {
super(username);
super.setAccountType(AccountType.BUYER);
allAccounts.add(this);
cart = new Cart();
}

public Cart getCart() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/models/Cart.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public void changeAmountOfProduct(Product product, int change) {

public int getTotalPrice() {
int total = 0;
for (Product product : amountOfProducts.keySet()) {
total = total + product.getPrice() * amountOfProducts.get(product);
for (Product product : products) {
total = total + product.getPrice() ;
}
return total;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fxml/ProductPage.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Image url="@../resources/background.png" />
</image></ImageView>
<HBox layoutX="126.0" layoutY="58.0" />
<Label accessibleRole="TEXT_FIELD" alignment="CENTER" contentDisplay="CENTER" layoutX="258.0" layoutY="6.0" onMouseClicked="#showProductPage" prefHeight="25.0" prefWidth="159.0" text="products page" />
<Label accessibleRole="TEXT_FIELD" alignment="CENTER" contentDisplay="CENTER" layoutX="258.0" layoutY="6.0" prefHeight="25.0" prefWidth="159.0" text="products page" />
<Button layoutX="47.0" layoutY="282.0" mnemonicParsing="false" onMouseClicked="#back" text="back" />
<VBox fx:id="userInfoVBox" layoutX="282.0" layoutY="58.0" prefHeight="175.0" prefWidth="100.0" />
<Button layoutX="473.0" layoutY="74.0" mnemonicParsing="false" onMouseClicked="#addCart" prefHeight="25.0" prefWidth="119.0" text="add to cart" />
Expand Down
Binary file modified target/classes/controller/BuyLogPage.class
Binary file not shown.
Binary file modified target/classes/controller/BuyerControl.class
Binary file not shown.
Binary file modified target/classes/controller/CartPage.class
Binary file not shown.
Binary file modified target/classes/controller/EditPage.class
Binary file not shown.
Binary file modified target/classes/controller/LoginRegister.class
Binary file not shown.
Binary file modified target/classes/controller/SellerControl.class
Binary file not shown.
Binary file modified target/classes/models/Account$1.class
Binary file not shown.
Binary file modified target/classes/models/Product.class
Binary file not shown.
Binary file modified target/classes/models/Request.class
Binary file not shown.
Binary file modified target/classes/view/OffsPage.class
Binary file not shown.
Binary file modified target/classes/view/SellerPage$1.class
Binary file not shown.
Binary file modified target/classes/view/SellerPage$2.class
Binary file not shown.
Binary file modified target/classes/view/SellerPage$3.class
Binary file not shown.
Binary file modified target/classes/view/SellerPage$4.class
Binary file not shown.
Binary file modified target/classes/view/SellerPage$5.class
Binary file not shown.
Binary file not shown.

0 comments on commit ceea427

Please sign in to comment.