diff --git a/src/main/java/controller/ManagerAccountController.java b/src/main/java/controller/ManagerAccountController.java index 22d500eb..ca1c5735 100644 --- a/src/main/java/controller/ManagerAccountController.java +++ b/src/main/java/controller/ManagerAccountController.java @@ -112,7 +112,6 @@ public static void processEditCategoryEachForAttributes( } public static void processAddCategoryEach(String category, String parentCategory, String imageName) throws CategoryNotExistsException { - ValidationController.checkCategoryExistence(category); ValidationController.checkCategoryExistence(parentCategory);//if parentCategoryNull ((Manager) LoginPageController.loggedInAccount).addCategory(category, Category.getCategoryByName(parentCategory), imageName); } diff --git a/src/main/java/graphicView/productMenu/ProductsMenu.java b/src/main/java/graphicView/productMenu/ProductsMenu.java index 49f58740..99eedf29 100644 --- a/src/main/java/graphicView/productMenu/ProductsMenu.java +++ b/src/main/java/graphicView/productMenu/ProductsMenu.java @@ -508,7 +508,7 @@ public void processShowProducts() throws FileNotFoundException, FilterNotExistsE productName.setOnMouseClicked(mouseEvent -> { try { ProductsPageController.setSelectedProduct(Product.getProductByName(productName.getText())); - openProductPage(Main.window.getScene(), Product.getProductByName(productName.getText())); + openProductPage(Main.window.getScene(), Product.getProductByName(productName.getText())); } catch (FileNotFoundException e) { e.printStackTrace(); } diff --git a/src/main/java/graphicView/userRegion/userAccount/managerAccount/AddCategoryPage.java b/src/main/java/graphicView/userRegion/userAccount/managerAccount/AddCategoryPage.java new file mode 100644 index 00000000..5ec3726f --- /dev/null +++ b/src/main/java/graphicView/userRegion/userAccount/managerAccount/AddCategoryPage.java @@ -0,0 +1,26 @@ +package graphicView.userRegion.userAccount.managerAccount; + +import graphicView.userRegion.userAccount.PurchaserAccountPage; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; +import main.Main; + +import java.io.IOException; + +public class AddCategoryPage { + static Stage primaryStage; + + public static void display() throws IOException { + Main.setMediaPlayer("The Swimmer.mp3"); + primaryStage = new Stage(); + Parent root = FXMLLoader.load(AddCategoryPage.class.getResource("/graphicView/userRegion/userAccount/managerAccount/AddCategory.fxml")); + primaryStage.setTitle("Hello World"); + Scene scene = new Scene(root); + primaryStage.setScene(scene); + primaryStage.setMaximized(true); + Main.setAccountRegionStage(primaryStage); + primaryStage.show(); + } +} diff --git a/src/main/java/graphicView/userRegion/userAccount/managerAccount/AddCategoryPageController.java b/src/main/java/graphicView/userRegion/userAccount/managerAccount/AddCategoryPageController.java new file mode 100644 index 00000000..3df58580 --- /dev/null +++ b/src/main/java/graphicView/userRegion/userAccount/managerAccount/AddCategoryPageController.java @@ -0,0 +1,48 @@ +package graphicView.userRegion.userAccount.managerAccount; + +import controller.LoginPageController; +import controller.ManagerAccountController; +import exception.CategoryNotExistsException; +import graphicView.mainMenu.MainMenu; +import graphicView.userRegion.loginPanel.LoginPanelController; +import javafx.fxml.FXML; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.paint.Color; +import main.Main; + +import java.io.IOException; + +public class AddCategoryPageController { + public TextField categoryName; + public TextField parentName; + public TextField imageName; + public Label alertMessage; + + @FXML + public void logout() throws IOException { + AddCategoryPage.primaryStage.close(); + LoginPageController.logout(); + LoginPanelController.setLoggedInAccount(null); + MainMenu.display(Main.window); + } + @FXML + public void back() throws IOException { + AddCategoryPage.primaryStage.close(); + ViewAllCategoriesPage.display(); + } + @FXML + public void add(){ + String name = categoryName.getText(); + String parent = parentName.getText(); + String image = imageName.getText(); + try { + ManagerAccountController.processAddCategoryEach(name,parent,image); + alertMessage.setTextFill(Color.GREEN); + alertMessage.setText("Add Category successful!"); + } catch (CategoryNotExistsException e) { + alertMessage.setTextFill(Color.RED); + alertMessage.setText(e.getMessage()); + } + } +} diff --git a/src/main/java/graphicView/userRegion/userAccount/managerAccount/AddManagerPage.java b/src/main/java/graphicView/userRegion/userAccount/managerAccount/AddManagerPage.java new file mode 100644 index 00000000..414a560c --- /dev/null +++ b/src/main/java/graphicView/userRegion/userAccount/managerAccount/AddManagerPage.java @@ -0,0 +1,26 @@ +package graphicView.userRegion.userAccount.managerAccount; + +import graphicView.userRegion.userAccount.PurchaserAccountPage; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; +import main.Main; + +import java.io.IOException; + +public class AddManagerPage { + static Stage primaryStage; + + public static void display() throws IOException { + Main.setMediaPlayer("The Swimmer.mp3"); + primaryStage = new Stage(); + Parent root = FXMLLoader.load(PurchaserAccountPage.class.getResource("/graphicView/userRegion/userAccount/managerAccount/AddManager.fxml")); + primaryStage.setTitle("Hello World"); + Scene scene = new Scene(root); + primaryStage.setScene(scene); + primaryStage.setMaximized(true); + Main.setAccountRegionStage(primaryStage); + primaryStage.show(); + } +} diff --git a/src/main/java/graphicView/userRegion/userAccount/managerAccount/AddManagerPageController.java b/src/main/java/graphicView/userRegion/userAccount/managerAccount/AddManagerPageController.java new file mode 100644 index 00000000..ba96ac3e --- /dev/null +++ b/src/main/java/graphicView/userRegion/userAccount/managerAccount/AddManagerPageController.java @@ -0,0 +1,74 @@ +package graphicView.userRegion.userAccount.managerAccount; + +import controller.LoginPageController; +import graphicView.mainMenu.MainMenu; +import graphicView.userRegion.loginPanel.LoginPanelController; +import javafx.fxml.FXML; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import main.Main; +import model.account.Manager; + +import java.io.IOException; + +import static javafx.scene.paint.Color.GREEN; + +public class AddManagerPageController { + public TextField newFirstName; + public TextField newLastName; + public TextField newUserName; + public TextField newPassWord; + public TextField newEmail; + public TextField newPhoneNumber; + public Label alertMessage; + + @FXML + public void addManager(){ + String firstName = newFirstName.getText(); + String lastName = newLastName.getText(); + String userName = newUserName.getText(); + String passWord = newPassWord.getText(); + String email = newEmail.getText(); + String phoneNumber = newPhoneNumber.getText(); + if(!firstName.matches("[a-zA-Z]+")){ + alertMessage.setText("Please enter a valid first name!"); + return; + } + if(!lastName.matches("[a-zA-Z]+")){ + alertMessage.setText("Please enter a valid last name!"); + return; + } + if (!userName.matches("\\w{8,}")) { + alertMessage.setText("Please enter a valid username!"); + return; + } + if (!passWord.matches("\\w{8,}")) { + alertMessage.setText("Please enter a valid password!"); + return; + } + if (!email.matches("\\w+[@]\\w+[.]\\w+")) { + alertMessage.setText("Please enter a valid email!"); + return; + } + if(!phoneNumber.matches("09\\d\\d\\d\\d\\d\\d\\d\\d\\d")){ + alertMessage.setText("Please enter a valid tel!"); + return; + } + Manager manager = new Manager(userName,firstName,lastName,email,phoneNumber,passWord); + alertMessage.setText(""); + alertMessage.setTextFill(GREEN); + alertMessage.setText("create new manager successful"); + } + @FXML + public void logout() throws IOException { + AddManagerPage.primaryStage.close(); + LoginPageController.logout(); + LoginPanelController.setLoggedInAccount(null); + MainMenu.display(Main.window); + } + @FXML + public void back() throws IOException { + AddManagerPage.primaryStage.close(); + ManagerAccountPage.display(); + } +} diff --git a/src/main/java/graphicView/userRegion/userAccount/managerAccount/CategoryPage.java b/src/main/java/graphicView/userRegion/userAccount/managerAccount/CategoryPage.java new file mode 100644 index 00000000..481a09bf --- /dev/null +++ b/src/main/java/graphicView/userRegion/userAccount/managerAccount/CategoryPage.java @@ -0,0 +1,26 @@ +package graphicView.userRegion.userAccount.managerAccount; + +import graphicView.userRegion.userAccount.PurchaserAccountPage; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; +import main.Main; + +import java.io.IOException; + +public class CategoryPage { + static Stage primaryStage; + + public static void display() throws IOException { + Main.setMediaPlayer("The Swimmer.mp3"); + primaryStage = new Stage(); + Parent root = FXMLLoader.load(CategoryPage.class.getResource("/graphicView/userRegion/userAccount/managerAccount/CategoryPage.fxml")); + primaryStage.setTitle("Hello World"); + Scene scene = new Scene(root); + primaryStage.setScene(scene); + primaryStage.setMaximized(true); + Main.setAccountRegionStage(primaryStage); + primaryStage.show(); + } +} diff --git a/src/main/java/graphicView/userRegion/userAccount/managerAccount/CategoryPageController.java b/src/main/java/graphicView/userRegion/userAccount/managerAccount/CategoryPageController.java new file mode 100644 index 00000000..335ff97f --- /dev/null +++ b/src/main/java/graphicView/userRegion/userAccount/managerAccount/CategoryPageController.java @@ -0,0 +1,117 @@ +package graphicView.userRegion.userAccount.managerAccount; + +import controller.LoginPageController; +import graphicView.mainMenu.MainMenu; +import graphicView.userRegion.loginPanel.LoginPanelController; +import javafx.beans.property.SimpleStringProperty; +import javafx.beans.property.StringProperty; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.scene.control.Label; +import javafx.scene.control.TableColumn; +import javafx.scene.control.TableView; +import javafx.scene.control.cell.PropertyValueFactory; +import main.Main; +import model.Category; + +import java.io.IOException; +import java.net.URL; +import java.util.ResourceBundle; + +public class CategoryPageController implements Initializable { + private static Category currentCategory; + @FXML + public Label categoryName; + @FXML + public TableView attributesTable; + @FXML + public TableColumn attributesColumn; + @FXML + public TableView subProductsTable; + @FXML + public TableColumn subProductsColumn; + + + public static void setCurrentCategory(Category currentCategory) { + CategoryPageController.currentCategory = currentCategory; + } + + public static Category getCurrentCategory() { + return currentCategory; + } + + ObservableList getAttributes() { + ObservableList allAttributes = FXCollections.observableArrayList(); + for (String attribute : CategoryPageController.currentCategory.getAttributes()) { + allAttributes.add(new Attribute(attribute)); + } + return allAttributes; + } + + ObservableList getProducts() { + ObservableList allProducts = FXCollections.observableArrayList(); + for (model.product.Product subProduct : CategoryPageController.currentCategory.getAllSubProducts()) { + allProducts.add(new Product(subProduct.getName())); + } + return allProducts; + } + + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + categoryName.setText(CategoryPageController.currentCategory.getName()); + attributesColumn.setCellValueFactory(new PropertyValueFactory<>("attributes")); + attributesTable.setItems(getAttributes()); + subProductsColumn.setCellValueFactory(new PropertyValueFactory<>("subProducts")); + subProductsTable.setItems(getProducts()); + } + + @FXML + public void logout() throws IOException { + LoginPageController.logout(); + LoginPanelController.setLoggedInAccount(null); + CategoryPage.primaryStage.close(); + MainMenu.display(Main.window); + } + + @FXML + public void back() throws IOException { + CategoryPage.primaryStage.close(); + ViewAllCategoriesPage.display(); + } + + @FXML + public void edit() throws IOException { + CategoryPage.primaryStage.close(); + EditCategoryPage.display(); + } + + public class Attribute { + private final StringProperty attributes; + + public Attribute(String attributes) { + this.attributes = new SimpleStringProperty(attributes); + } + + public StringProperty attributesProperty() { + return attributes; + } + } + + public class Product { + private final StringProperty subProducts; + + public Product(String productName) { + this.subProducts = new SimpleStringProperty(productName); + } + + public String getSubProducts() { + return subProducts.get(); + } + + public StringProperty subProductsProperty() { + return subProducts; + } + } +} diff --git a/src/main/java/graphicView/userRegion/userAccount/managerAccount/EditCategoryPage.java b/src/main/java/graphicView/userRegion/userAccount/managerAccount/EditCategoryPage.java new file mode 100644 index 00000000..c48bd0df --- /dev/null +++ b/src/main/java/graphicView/userRegion/userAccount/managerAccount/EditCategoryPage.java @@ -0,0 +1,25 @@ +package graphicView.userRegion.userAccount.managerAccount; + +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; +import main.Main; + +import java.io.IOException; + +public class EditCategoryPage { + static Stage primaryStage; + + public static void display() throws IOException { + Main.setMediaPlayer("The Swimmer.mp3"); + primaryStage = new Stage(); + Parent root = FXMLLoader.load(EditCategoryPage.class.getResource("/graphicView/userRegion/userAccount/managerAccount/EditCategory.fxml")); + primaryStage.setTitle("Hello World"); + Scene scene = new Scene(root); + primaryStage.setScene(scene); + primaryStage.setMaximized(true); + Main.setAccountRegionStage(primaryStage); + primaryStage.show(); + } +} diff --git a/src/main/java/graphicView/userRegion/userAccount/managerAccount/EditCategoryPageController.java b/src/main/java/graphicView/userRegion/userAccount/managerAccount/EditCategoryPageController.java new file mode 100644 index 00000000..a76bcfcb --- /dev/null +++ b/src/main/java/graphicView/userRegion/userAccount/managerAccount/EditCategoryPageController.java @@ -0,0 +1,45 @@ +package graphicView.userRegion.userAccount.managerAccount; + +import controller.LoginPageController; +import controller.ManagerAccountController; +import exception.CategoryAlreadyExistsException; +import exception.CategoryNotExistsException; +import graphicView.mainMenu.MainMenu; +import graphicView.userRegion.loginPanel.LoginPanelController; +import javafx.beans.property.StringProperty; +import javafx.fxml.FXML; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import main.Main; + +import java.io.IOException; + +public class EditCategoryPageController { + @FXML + public TextField newName; + @FXML + public Label alertMessage; + + @FXML + public void logout() throws IOException { + LoginPageController.logout(); + LoginPanelController.setLoggedInAccount(null); + EditCategoryPage.primaryStage.close(); + MainMenu.display(Main.window); + } + + @FXML + public void back() throws IOException { + EditCategoryPage.primaryStage.close(); + CategoryPage.display(); + } + + @FXML + public void edit() throws CategoryNotExistsException, CategoryAlreadyExistsException { + String name = newName.getText(); + ManagerAccountController.processEditCategoryEachForName( + CategoryPageController.getCurrentCategory().getName() , name); + alertMessage.setText("Edit category name successful!"); + } + +} diff --git a/src/main/java/graphicView/userRegion/userAccount/managerAccount/ManagerAccountPageController.java b/src/main/java/graphicView/userRegion/userAccount/managerAccount/ManagerAccountPageController.java index 41c213cd..3b4c1fcb 100644 --- a/src/main/java/graphicView/userRegion/userAccount/managerAccount/ManagerAccountPageController.java +++ b/src/main/java/graphicView/userRegion/userAccount/managerAccount/ManagerAccountPageController.java @@ -145,4 +145,18 @@ public void edit() throws IOException { ManagerAccountPage.primaryStage.close(); ManagerEditInfoPage.display(); } + @FXML + public void addManager() throws IOException { + ManagerAccountPage.primaryStage.close(); + AddManagerPage.display(); + } + @FXML + public void addSupporter(){ + ManagerAccountPage.primaryStage.close(); + } + @FXML + public void viewAllCategories() throws IOException { + ManagerAccountPage.primaryStage.close(); + ViewAllCategoriesPage.display(); + } } diff --git a/src/main/java/graphicView/userRegion/userAccount/managerAccount/ViewAllAccountsPageController.java b/src/main/java/graphicView/userRegion/userAccount/managerAccount/ViewAllAccountsPageController.java index f18427f3..13ec1426 100644 --- a/src/main/java/graphicView/userRegion/userAccount/managerAccount/ViewAllAccountsPageController.java +++ b/src/main/java/graphicView/userRegion/userAccount/managerAccount/ViewAllAccountsPageController.java @@ -20,6 +20,7 @@ import java.io.IOException; import java.net.URL; +import java.util.ArrayList; import java.util.ResourceBundle; public class ViewAllAccountsPageController implements Initializable { @@ -34,7 +35,7 @@ public class ViewAllAccountsPageController implements Initializable { @FXML public TableColumn removeUserButton; @FXML - public TableColumn addMangerButton; + public TableColumn isUserOnline; @FXML @@ -51,17 +52,18 @@ public void back() throws IOException { } @FXML public void checkout() throws UsernameNotExistsException { - for (Account account : getAccount()) { + for (Account account : allAccounts) { if(account.removeUser.isSelected()){ - ManagerAccountController.processDeleteUserEach(account.userName.toString()); + ManagerAccountController.processDeleteUserEach(account.userName.getValue()); } } } ObservableList getAccount(){ ObservableList allAccounts = FXCollections.observableArrayList(); for (model.account.Account account : model.account.Account.getAllAccounts()) { - allAccounts.add(new Account(account.getFirstName()+" "+account.getLastName(), - account.getEMail(),account.getTelephoneNumber())); + allAccounts.add(new Account(account.getUserName(), + account.getEMail(), + account.getTelephoneNumber() , account.isLoggedIn())); } return allAccounts; } @@ -73,16 +75,16 @@ public void initialize(URL url, ResourceBundle resourceBundle) { AccountEmail.setCellValueFactory(new PropertyValueFactory<>("email")); AccountPhone.setCellValueFactory(new PropertyValueFactory<>("phoneNumber")); removeUserButton.setCellValueFactory(new PropertyValueFactory<>("removeUser")); - addMangerButton.setCellValueFactory(new PropertyValueFactory<>("addManager")); + isUserOnline.setCellValueFactory(new PropertyValueFactory<>("isOnline")); viewAllAccountsTable.setItems(getAccount()); } + private ArrayList allAccounts = new ArrayList<>(); public class Account{ private StringProperty userName; private StringProperty email; private StringProperty phoneNumber; private CheckBox removeUser; - private CheckBox addManager; - + private StringProperty isOnline; public String getUserName() { return userName.get(); } @@ -111,16 +113,25 @@ public CheckBox getRemoveUser() { return removeUser; } - public CheckBox getAddManager() { - return addManager; + public String getIsOnline() { + return isOnline.get(); + } + + public StringProperty isOnlineProperty() { + return isOnline; } - Account(String userName , String email , String phoneNumber){ + Account(String userName , String email , String phoneNumber , boolean isOnline){ this.userName = new SimpleStringProperty(userName); this.email = new SimpleStringProperty(email); this.phoneNumber = new SimpleStringProperty(phoneNumber); this.removeUser = new CheckBox(); - this.addManager = new CheckBox(); + if(isOnline){ + this.isOnline = new SimpleStringProperty("yes"); + } + else + this.isOnline = new SimpleStringProperty("no"); + allAccounts.add(this); } } diff --git a/src/main/java/graphicView/userRegion/userAccount/managerAccount/ViewAllCategoriesPage.java b/src/main/java/graphicView/userRegion/userAccount/managerAccount/ViewAllCategoriesPage.java new file mode 100644 index 00000000..509ac9d3 --- /dev/null +++ b/src/main/java/graphicView/userRegion/userAccount/managerAccount/ViewAllCategoriesPage.java @@ -0,0 +1,26 @@ +package graphicView.userRegion.userAccount.managerAccount; + +import graphicView.userRegion.userAccount.PurchaserAccountPage; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; +import main.Main; + +import java.io.IOException; + +public class ViewAllCategoriesPage { + static Stage primaryStage; + + public static void display() throws IOException { + Main.setMediaPlayer("The Swimmer.mp3"); + primaryStage = new Stage(); + Parent root = FXMLLoader.load(PurchaserAccountPage.class.getResource("/graphicView/userRegion/userAccount/managerAccount/ViewAllCategories.fxml")); + primaryStage.setTitle("Hello World"); + Scene scene = new Scene(root); + primaryStage.setScene(scene); + primaryStage.setMaximized(true); + Main.setAccountRegionStage(primaryStage); + primaryStage.show(); + } +} diff --git a/src/main/java/graphicView/userRegion/userAccount/managerAccount/ViewAllCategoriesPageController.java b/src/main/java/graphicView/userRegion/userAccount/managerAccount/ViewAllCategoriesPageController.java new file mode 100644 index 00000000..5e7863c3 --- /dev/null +++ b/src/main/java/graphicView/userRegion/userAccount/managerAccount/ViewAllCategoriesPageController.java @@ -0,0 +1,92 @@ +package graphicView.userRegion.userAccount.managerAccount; + +import controller.LoginPageController; +import exception.FilterNotExistsException; +import graphicView.mainMenu.MainMenu; +import graphicView.productMenu.ProductsMenu; +import graphicView.userRegion.loginPanel.LoginPanelController; +import javafx.beans.property.StringProperty; +import javafx.event.Event; +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.scene.Scene; +import javafx.scene.control.*; +import javafx.scene.control.cell.PropertyValueFactory; +import javafx.scene.layout.Background; +import javafx.scene.layout.BackgroundFill; +import javafx.scene.layout.Pane; +import javafx.scene.paint.Color; +import main.Main; +import model.Category; +import model.product.Product; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.ResourceBundle; + +public class ViewAllCategoriesPageController{ + @FXML + public MenuButton allCategoriesButton; + + @FXML + public void onCategories() { + allCategoriesButton.getItems().clear(); + for (Category category : Category.getAllParents()) { + Menu menu = new Menu(category.getName()); + allCategoriesButton.getItems().add(menu); + menu.setOnAction(actionEvent -> { + try { + ViewAllCategoriesPage.primaryStage.close(); + CategoryPageController.setCurrentCategory(category); + CategoryPage.display(); + } catch (IOException e) { + e.printStackTrace(); + } + }); + for (Category subCategory : category.getSubCategories()) { + MenuItem subMenu = new MenuItem(subCategory.getName()); + subMenu.setOnAction(actionEvent -> { + try { + ViewAllCategoriesPage.primaryStage.close(); + CategoryPageController.setCurrentCategory(subCategory); + CategoryPage.display(); + } catch (IOException e) { + e.printStackTrace(); + } + }); + menu.getItems().add(subMenu); + for (Category subSubCategory : subCategory.getSubCategories()) { + Menu subSubMenu = new Menu(subSubCategory.getName()); + subSubMenu.setOnAction(actionEvent -> { + try { + ViewAllCategoriesPage.primaryStage.close(); + CategoryPageController.setCurrentCategory(subSubCategory); + CategoryPage.display(); + } catch (IOException e) { + e.printStackTrace(); + } + }); + } + } + } + } + @FXML + public void logout() throws IOException { + LoginPageController.logout(); + LoginPanelController.setLoggedInAccount(null); + ViewAllCategoriesPage.primaryStage.close(); + MainMenu.display(Main.window); + } + @FXML + public void back() throws IOException { + ViewAllCategoriesPage.primaryStage.close(); + ManagerAccountPage.display(); + } + @FXML + public void addCategory() throws IOException { + ViewAllCategoriesPage.primaryStage.close(); + AddCategoryPage.display(); + } +} diff --git a/src/main/java/main/Main.java b/src/main/java/main/Main.java index 877a275e..cb47ea6d 100644 --- a/src/main/java/main/Main.java +++ b/src/main/java/main/Main.java @@ -2,6 +2,7 @@ import controller.LoginPageController; import graphicView.mainMenu.MainMenu; +import graphicView.userRegion.userAccount.managerAccount.CategoryPageController; import graphicView.userRegion.userAccount.managerRequestions.addOff.AddOffRequest; import graphicView.userRegion.userAccount.managerRequestions.addProduct.AddProductRequest; import graphicView.userRegion.userAccount.managerRequestions.addSeller.AddSellerRequest; @@ -12,6 +13,7 @@ import javafx.stage.Stage; import javafx.util.Duration; import model.Category; +import model.CodedDiscount; import model.account.Account; import model.account.Manager; import model.account.Purchaser; @@ -25,6 +27,7 @@ import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; +import java.util.Date; import java.util.HashMap; public class Main extends Application { @@ -39,13 +42,13 @@ public static MediaPlayer getMediaPlayer() { } public static void setMediaPlayer(String songName) { - Main.mediaPlayer = new MediaPlayer(new Media(new File("src/main/resources/media/sound/" + songName).toURI().toString())); - Main.mediaPlayer.setAutoPlay(true); - Main.mediaPlayer.setOnEndOfMedia(new Runnable() { - public void run() { - mediaPlayer.seek(Duration.ZERO); - } - }); +// Main.mediaPlayer = new MediaPlayer(new Media(new File("src/main/resources/media/sound/" + songName).toURI().toString())); +// Main.mediaPlayer.setAutoPlay(true); +// Main.mediaPlayer.setOnEndOfMedia(new Runnable() { +// public void run() { +// mediaPlayer.seek(Duration.ZERO); +// } +// }); } public static void setAccountRegionStage(Stage accountRegionStage) { @@ -82,15 +85,31 @@ public static void main(String[] args) throws FileNotFoundException { // LoginPageController.setLoggedInAccount(manager); Seller seller1 = new Seller("amiramir", "Alex", "dd", "ya@yahoo.com", "2441", "amiramir", "izo", "street5", "6777"); - Category category1 = new Category("car", null, "ali");Category category2 = new Category("digital", null, "aff"); + Category category1 = new Category("car", null, "ali"); + Category category2 = new Category("kala", null, "aff"); + ArrayList attributes = new ArrayList<>(); + attributes.add("good"); + attributes.add("new"); + category2.setAttributes(attributes); Product product1 = new Product(category1, "peraid", "saipa", 12000, "good Product!", "12"); Product product2 = new Product(category2, "bmw", "bmw", 10000, "good", "32"); Product product3 = new Product(category2, "peris", "aipr", 80000, "nice", "ado"); HashMap productIntegerHashMap = new HashMap<>(); + ArrayList subProducts = new ArrayList<>(); + subProducts.add(product1); + subProducts.add(product2); + category2.setAllSubProducts(subProducts); productIntegerHashMap.put(product1,1); productIntegerHashMap.put(product3,2); productIntegerHashMap.put(product2,3); + Purchaser purchaser = new Purchaser("amirabbas","amirabbas","mohammadi","" + + "amir@gmail.com","09306304297","amirabbas","aas"); + CodedDiscount codedDiscount = new CodedDiscount(new Date(190,10,25),new Date(190,11,20) + ,50,5000); + ArrayList allCodedDiscount = new ArrayList<>(); + allCodedDiscount.add(codedDiscount); + purchaser.setAllDiscountCodes(allCodedDiscount); seller1.setProductsToSell(productIntegerHashMap); launch(args); diff --git a/src/main/java/model/Category.java b/src/main/java/model/Category.java index 4855b142..f27a769d 100644 --- a/src/main/java/model/Category.java +++ b/src/main/java/model/Category.java @@ -30,6 +30,7 @@ public Category(String name, Category parent, String imageName) { parent.getSubCategories().add(this); updateAllParent(parent); } + allCategories.add(this); createAndUpdateJson(this); } diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 96c7c50e..7cda5263 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -31,7 +31,7 @@ opens model.offer to com.google.gson; opens model.buyLog to com.google.gson; opens model.comment to com.google.gson; - opens graphicView.userRegion.userAccount.managerAccount to javafx.fxml ; + opens graphicView.userRegion.userAccount.managerAccount to javafx.fxml , javafx.base; opens graphicView.userRegion.userAccount.sellerAccount to javafx.fxml; // opens java.lang.reflect to com.jfoenix; } \ No newline at end of file diff --git a/src/main/resources/Accounts/Accounts/alialiali.json b/src/main/resources/Accounts/Accounts/alialiali.json new file mode 100644 index 00000000..0b2576c1 --- /dev/null +++ b/src/main/resources/Accounts/Accounts/alialiali.json @@ -0,0 +1 @@ +{"userName":"alialiali","firstName":"ali","lastName":"ali","eMail":"aab@gmail.com","telephoneNumber":"09306304297","password":"alialiali","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/src/main/resources/Accounts/Accounts/amirabbas.json b/src/main/resources/Accounts/Accounts/amirabbas.json new file mode 100644 index 00000000..0331357f --- /dev/null +++ b/src/main/resources/Accounts/Accounts/amirabbas.json @@ -0,0 +1 @@ +{"sellerSelectedForEachProduct":{},"userName":"amirabbas","firstName":"amirabbas","lastName":"mohammadi","eMail":"amir@gmail.com","telephoneNumber":"09306304297","password":"amirabbas","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/src/main/resources/Accounts/Accounts/ggggggggg.json b/src/main/resources/Accounts/Accounts/ggggggggg.json new file mode 100644 index 00000000..2f782760 --- /dev/null +++ b/src/main/resources/Accounts/Accounts/ggggggggg.json @@ -0,0 +1 @@ +{"userName":"ggggggggg","firstName":"gggggggg","lastName":"gggggggg","eMail":"gggg@gmail.com","telephoneNumber":"09306304297","password":"gggggggg","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/src/main/resources/Accounts/Accounts/tmbaxtmbax.json b/src/main/resources/Accounts/Accounts/tmbaxtmbax.json new file mode 100644 index 00000000..998e60ab --- /dev/null +++ b/src/main/resources/Accounts/Accounts/tmbaxtmbax.json @@ -0,0 +1 @@ +{"userName":"tmbaxtmbax","firstName":"tmbaxtmbax","lastName":"tmbaxtmbax","eMail":"tmbax@tmbax.tmbax","telephoneNumber":"09120604351","password":"tmbaxtmbax","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/src/main/resources/Accounts/Managers/alialiali.json b/src/main/resources/Accounts/Managers/alialiali.json new file mode 100644 index 00000000..0b2576c1 --- /dev/null +++ b/src/main/resources/Accounts/Managers/alialiali.json @@ -0,0 +1 @@ +{"userName":"alialiali","firstName":"ali","lastName":"ali","eMail":"aab@gmail.com","telephoneNumber":"09306304297","password":"alialiali","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/src/main/resources/Accounts/Managers/ggggggggg.json b/src/main/resources/Accounts/Managers/ggggggggg.json new file mode 100644 index 00000000..2f782760 --- /dev/null +++ b/src/main/resources/Accounts/Managers/ggggggggg.json @@ -0,0 +1 @@ +{"userName":"ggggggggg","firstName":"gggggggg","lastName":"gggggggg","eMail":"gggg@gmail.com","telephoneNumber":"09306304297","password":"gggggggg","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/src/main/resources/Accounts/Managers/tmbaxtmbax.json b/src/main/resources/Accounts/Managers/tmbaxtmbax.json new file mode 100644 index 00000000..998e60ab --- /dev/null +++ b/src/main/resources/Accounts/Managers/tmbaxtmbax.json @@ -0,0 +1 @@ +{"userName":"tmbaxtmbax","firstName":"tmbaxtmbax","lastName":"tmbaxtmbax","eMail":"tmbax@tmbax.tmbax","telephoneNumber":"09120604351","password":"tmbaxtmbax","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/src/main/resources/Accounts/Purchasers/amirabbas.json b/src/main/resources/Accounts/Purchasers/amirabbas.json new file mode 100644 index 00000000..42c27053 --- /dev/null +++ b/src/main/resources/Accounts/Purchasers/amirabbas.json @@ -0,0 +1 @@ +{"cart":{},"sellerSelectedForEachProduct":{},"address":"aas","purchaseAddress":"","purchaseTel":"","userName":"amirabbas","firstName":"amirabbas","lastName":"mohammadi","eMail":"amir@gmail.com","telephoneNumber":"09306304297","password":"amirabbas","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/src/main/resources/Categories/breakinbad.json b/src/main/resources/Categories/breakinbad.json new file mode 100644 index 00000000..9478a3b4 --- /dev/null +++ b/src/main/resources/Categories/breakinbad.json @@ -0,0 +1 @@ +{"name":"breakinbad","subCategories":[],"allSubProducts":[],"attributes":["good","new"],"imageName":""} \ No newline at end of file diff --git a/src/main/resources/Categories/car.json b/src/main/resources/Categories/car.json index c2cade65..17214cd0 100644 --- a/src/main/resources/Categories/car.json +++ b/src/main/resources/Categories/car.json @@ -1 +1 @@ -{"name":"car","subCategories":[],"allSubProducts":[{"productID":"Product_21659976","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peraid","companyName":"saipa","price":12000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good Product!","allRating":[],"generatedDate":"Jul 21, 2020, 6:12:44 AM","viewTimes":0,"imageName":"12"}],"attributes":[]} \ No newline at end of file +{"name":"car","subCategories":[],"allSubProducts":[{"productID":"Product_84955838","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peraid","companyName":"saipa","price":12000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good Product!","allRating":[],"generatedDate":"Jul 24, 2020, 12:23:46 PM","viewTimes":0,"imageName":"12"}],"attributes":[]} \ No newline at end of file diff --git a/src/main/resources/Categories/digital.json b/src/main/resources/Categories/digital.json index 204fb66b..dcac9b94 100644 --- a/src/main/resources/Categories/digital.json +++ b/src/main/resources/Categories/digital.json @@ -1 +1 @@ -{"name":"digital","subCategories":[],"allSubProducts":[{"productID":"Product_29932688","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"bmw","companyName":"bmw","price":10000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good","allRating":[],"generatedDate":"Jul 21, 2020, 6:12:44 AM","viewTimes":0,"imageName":"32"},{"productID":"Product_819019","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peris","companyName":"aipr","price":80000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"nice","allRating":[],"generatedDate":"Jul 21, 2020, 6:12:44 AM","viewTimes":0,"imageName":"ado"}],"attributes":[]} \ No newline at end of file +{"name":"digital","subCategories":[{"name":"breakinbad","subCategories":[],"allSubProducts":[],"attributes":["good","new"],"imageName":""},{"name":"tablet","subCategories":[],"allSubProducts":[],"attributes":["good","new"],"imageName":"asdfasdf"}],"allSubProducts":[{"productID":"Product_84609607","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"bmw","companyName":"bmw","price":10000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good","allRating":[],"generatedDate":"Jul 24, 2020, 6:03:09 AM","viewTimes":0,"imageName":"32"},{"productID":"Product_87237260","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peris","companyName":"aipr","price":80000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"nice","allRating":[],"generatedDate":"Jul 24, 2020, 6:03:09 AM","viewTimes":0,"imageName":"ado"}],"attributes":["good","new"]} \ No newline at end of file diff --git a/src/main/resources/Categories/ff.json b/src/main/resources/Categories/ff.json new file mode 100644 index 00000000..f50b96ce --- /dev/null +++ b/src/main/resources/Categories/ff.json @@ -0,0 +1 @@ +{"name":"ff","subCategories":[],"allSubProducts":[],"attributes":[],"imageName":"asdf"} \ No newline at end of file diff --git a/src/main/resources/Categories/kala.json b/src/main/resources/Categories/kala.json new file mode 100644 index 00000000..ec30ba21 --- /dev/null +++ b/src/main/resources/Categories/kala.json @@ -0,0 +1 @@ +{"name":"kala","subCategories":[],"allSubProducts":[{"productID":"Product_53372724","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"bmw","companyName":"bmw","price":10000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good","allRating":[],"generatedDate":"Jul 24, 2020, 12:23:46 PM","viewTimes":0,"imageName":"32"},{"productID":"Product_84918791","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peris","companyName":"aipr","price":80000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"nice","allRating":[],"generatedDate":"Jul 24, 2020, 12:23:46 PM","viewTimes":0,"imageName":"ado"}],"attributes":["good","new"]} \ No newline at end of file diff --git a/src/main/resources/Categories/kia.json b/src/main/resources/Categories/kia.json new file mode 100644 index 00000000..e4617017 --- /dev/null +++ b/src/main/resources/Categories/kia.json @@ -0,0 +1 @@ +{"name":"kia","subCategories":[],"allSubProducts":[],"attributes":[],"imageName":"asdgasg"} \ No newline at end of file diff --git a/src/main/resources/Categories/tablet.json b/src/main/resources/Categories/tablet.json new file mode 100644 index 00000000..ed76c86c --- /dev/null +++ b/src/main/resources/Categories/tablet.json @@ -0,0 +1 @@ +{"name":"tablet","subCategories":[],"allSubProducts":[],"attributes":["good","new"],"imageName":"asdfasdf"} \ No newline at end of file diff --git a/src/main/resources/Products/bmw.json b/src/main/resources/Products/bmw.json index f39a1fe2..24210100 100644 --- a/src/main/resources/Products/bmw.json +++ b/src/main/resources/Products/bmw.json @@ -1 +1 @@ -{"productID":"Product_29932688","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"bmw","companyName":"bmw","price":10000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good","allRating":[],"generatedDate":"Jul 21, 2020, 6:12:44 AM","viewTimes":0,"imageName":"32"} \ No newline at end of file +{"productID":"Product_53372724","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"bmw","companyName":"bmw","price":10000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good","allRating":[],"generatedDate":"Jul 24, 2020, 12:23:46 PM","viewTimes":0,"imageName":"32"} \ No newline at end of file diff --git a/src/main/resources/Products/peraid.json b/src/main/resources/Products/peraid.json index 67852729..936f2645 100644 --- a/src/main/resources/Products/peraid.json +++ b/src/main/resources/Products/peraid.json @@ -1 +1 @@ -{"productID":"Product_21659976","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peraid","companyName":"saipa","price":12000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good Product!","allRating":[],"generatedDate":"Jul 21, 2020, 6:12:44 AM","viewTimes":0,"imageName":"12"} \ No newline at end of file +{"productID":"Product_84955838","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peraid","companyName":"saipa","price":12000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good Product!","allRating":[],"generatedDate":"Jul 24, 2020, 12:23:46 PM","viewTimes":0,"imageName":"12"} \ No newline at end of file diff --git a/src/main/resources/Products/peris.json b/src/main/resources/Products/peris.json index 050c0614..be3fb7bf 100644 --- a/src/main/resources/Products/peris.json +++ b/src/main/resources/Products/peris.json @@ -1 +1 @@ -{"productID":"Product_819019","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peris","companyName":"aipr","price":80000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"nice","allRating":[],"generatedDate":"Jul 21, 2020, 6:12:44 AM","viewTimes":0,"imageName":"ado"} \ No newline at end of file +{"productID":"Product_84918791","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peris","companyName":"aipr","price":80000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"nice","allRating":[],"generatedDate":"Jul 24, 2020, 12:23:46 PM","viewTimes":0,"imageName":"ado"} \ No newline at end of file diff --git a/src/main/resources/graphicView/productsMenu/productsMenu.fxml b/src/main/resources/graphicView/productsMenu/productsMenu.fxml index effd36e4..b507b2f3 100644 --- a/src/main/resources/graphicView/productsMenu/productsMenu.fxml +++ b/src/main/resources/graphicView/productsMenu/productsMenu.fxml @@ -7,7 +7,7 @@ - + diff --git a/src/main/resources/graphicView/userRegion/userAccount/managerAccount/AddCategory.fxml b/src/main/resources/graphicView/userRegion/userAccount/managerAccount/AddCategory.fxml new file mode 100644 index 00000000..2c85c123 --- /dev/null +++ b/src/main/resources/graphicView/userRegion/userAccount/managerAccount/AddCategory.fxml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + - - - + + - + + + + + + + + + + + diff --git a/target/classes/Accounts/Accounts/alialiali.json b/target/classes/Accounts/Accounts/alialiali.json new file mode 100644 index 00000000..0b2576c1 --- /dev/null +++ b/target/classes/Accounts/Accounts/alialiali.json @@ -0,0 +1 @@ +{"userName":"alialiali","firstName":"ali","lastName":"ali","eMail":"aab@gmail.com","telephoneNumber":"09306304297","password":"alialiali","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/target/classes/Accounts/Accounts/amirabbas.json b/target/classes/Accounts/Accounts/amirabbas.json new file mode 100644 index 00000000..0331357f --- /dev/null +++ b/target/classes/Accounts/Accounts/amirabbas.json @@ -0,0 +1 @@ +{"sellerSelectedForEachProduct":{},"userName":"amirabbas","firstName":"amirabbas","lastName":"mohammadi","eMail":"amir@gmail.com","telephoneNumber":"09306304297","password":"amirabbas","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/target/classes/Accounts/Accounts/ggggggggg.json b/target/classes/Accounts/Accounts/ggggggggg.json new file mode 100644 index 00000000..2f782760 --- /dev/null +++ b/target/classes/Accounts/Accounts/ggggggggg.json @@ -0,0 +1 @@ +{"userName":"ggggggggg","firstName":"gggggggg","lastName":"gggggggg","eMail":"gggg@gmail.com","telephoneNumber":"09306304297","password":"gggggggg","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/target/classes/Accounts/Accounts/tmbaxtmbax.json b/target/classes/Accounts/Accounts/tmbaxtmbax.json new file mode 100644 index 00000000..998e60ab --- /dev/null +++ b/target/classes/Accounts/Accounts/tmbaxtmbax.json @@ -0,0 +1 @@ +{"userName":"tmbaxtmbax","firstName":"tmbaxtmbax","lastName":"tmbaxtmbax","eMail":"tmbax@tmbax.tmbax","telephoneNumber":"09120604351","password":"tmbaxtmbax","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/target/classes/Accounts/Managers/alialiali.json b/target/classes/Accounts/Managers/alialiali.json new file mode 100644 index 00000000..0b2576c1 --- /dev/null +++ b/target/classes/Accounts/Managers/alialiali.json @@ -0,0 +1 @@ +{"userName":"alialiali","firstName":"ali","lastName":"ali","eMail":"aab@gmail.com","telephoneNumber":"09306304297","password":"alialiali","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/target/classes/Accounts/Managers/ggggggggg.json b/target/classes/Accounts/Managers/ggggggggg.json new file mode 100644 index 00000000..2f782760 --- /dev/null +++ b/target/classes/Accounts/Managers/ggggggggg.json @@ -0,0 +1 @@ +{"userName":"ggggggggg","firstName":"gggggggg","lastName":"gggggggg","eMail":"gggg@gmail.com","telephoneNumber":"09306304297","password":"gggggggg","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/target/classes/Accounts/Managers/tmbaxtmbax.json b/target/classes/Accounts/Managers/tmbaxtmbax.json new file mode 100644 index 00000000..998e60ab --- /dev/null +++ b/target/classes/Accounts/Managers/tmbaxtmbax.json @@ -0,0 +1 @@ +{"userName":"tmbaxtmbax","firstName":"tmbaxtmbax","lastName":"tmbaxtmbax","eMail":"tmbax@tmbax.tmbax","telephoneNumber":"09120604351","password":"tmbaxtmbax","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/target/classes/Accounts/Purchasers/amirabbas.json b/target/classes/Accounts/Purchasers/amirabbas.json new file mode 100644 index 00000000..42c27053 --- /dev/null +++ b/target/classes/Accounts/Purchasers/amirabbas.json @@ -0,0 +1 @@ +{"cart":{},"sellerSelectedForEachProduct":{},"address":"aas","purchaseAddress":"","purchaseTel":"","userName":"amirabbas","firstName":"amirabbas","lastName":"mohammadi","eMail":"amir@gmail.com","telephoneNumber":"09306304297","password":"amirabbas","balance":0.0,"allDiscountCodes":[],"sellLogListHistory":[],"buyLogListHistory":[],"isLoggedIn":false} \ No newline at end of file diff --git a/target/classes/Categories/breakinbad.json b/target/classes/Categories/breakinbad.json new file mode 100644 index 00000000..9478a3b4 --- /dev/null +++ b/target/classes/Categories/breakinbad.json @@ -0,0 +1 @@ +{"name":"breakinbad","subCategories":[],"allSubProducts":[],"attributes":["good","new"],"imageName":""} \ No newline at end of file diff --git a/target/classes/Categories/car.json b/target/classes/Categories/car.json index dc7efe1d..bb7deac5 100644 --- a/target/classes/Categories/car.json +++ b/target/classes/Categories/car.json @@ -1 +1 @@ -{"name":"car","subCategories":[],"allSubProducts":[{"productID":"Product_83955570","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peraid","companyName":"saipa","price":12000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good Product!","allRating":[],"generatedDate":"Jul 21, 2020, 6:11:30 AM","viewTimes":0,"imageName":"12"}],"attributes":[]} \ No newline at end of file +{"name":"car","subCategories":[],"allSubProducts":[{"productID":"Product_37682471","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peraid","companyName":"saipa","price":12000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good Product!","allRating":[],"generatedDate":"Jul 24, 2020, 6:45:57 AM","viewTimes":0,"imageName":"12"}],"attributes":[]} \ No newline at end of file diff --git a/target/classes/Categories/digital.json b/target/classes/Categories/digital.json index 6e4fd619..dcac9b94 100644 --- a/target/classes/Categories/digital.json +++ b/target/classes/Categories/digital.json @@ -1 +1 @@ -{"name":"digital","subCategories":[],"allSubProducts":[{"productID":"Product_48001161","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"bmw","companyName":"bmw","price":10000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good","allRating":[],"generatedDate":"Jul 21, 2020, 6:11:30 AM","viewTimes":0,"imageName":"32"},{"productID":"Product_67516083","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peris","companyName":"aipr","price":80000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"nice","allRating":[],"generatedDate":"Jul 21, 2020, 6:11:30 AM","viewTimes":0,"imageName":"ado"}],"attributes":[]} \ No newline at end of file +{"name":"digital","subCategories":[{"name":"breakinbad","subCategories":[],"allSubProducts":[],"attributes":["good","new"],"imageName":""},{"name":"tablet","subCategories":[],"allSubProducts":[],"attributes":["good","new"],"imageName":"asdfasdf"}],"allSubProducts":[{"productID":"Product_84609607","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"bmw","companyName":"bmw","price":10000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good","allRating":[],"generatedDate":"Jul 24, 2020, 6:03:09 AM","viewTimes":0,"imageName":"32"},{"productID":"Product_87237260","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peris","companyName":"aipr","price":80000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"nice","allRating":[],"generatedDate":"Jul 24, 2020, 6:03:09 AM","viewTimes":0,"imageName":"ado"}],"attributes":["good","new"]} \ No newline at end of file diff --git a/target/classes/Categories/ff.json b/target/classes/Categories/ff.json new file mode 100644 index 00000000..f50b96ce --- /dev/null +++ b/target/classes/Categories/ff.json @@ -0,0 +1 @@ +{"name":"ff","subCategories":[],"allSubProducts":[],"attributes":[],"imageName":"asdf"} \ No newline at end of file diff --git a/target/classes/Categories/kala.json b/target/classes/Categories/kala.json new file mode 100644 index 00000000..b34c73c4 --- /dev/null +++ b/target/classes/Categories/kala.json @@ -0,0 +1 @@ +{"name":"kala","subCategories":[],"allSubProducts":[{"productID":"Product_69823390","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"bmw","companyName":"bmw","price":10000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good","allRating":[],"generatedDate":"Jul 24, 2020, 6:45:57 AM","viewTimes":0,"imageName":"32"},{"productID":"Product_27804364","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peris","companyName":"aipr","price":80000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"nice","allRating":[],"generatedDate":"Jul 24, 2020, 6:45:58 AM","viewTimes":0,"imageName":"ado"}],"attributes":["good","new"]} \ No newline at end of file diff --git a/target/classes/Categories/kia.json b/target/classes/Categories/kia.json new file mode 100644 index 00000000..e4617017 --- /dev/null +++ b/target/classes/Categories/kia.json @@ -0,0 +1 @@ +{"name":"kia","subCategories":[],"allSubProducts":[],"attributes":[],"imageName":"asdgasg"} \ No newline at end of file diff --git a/target/classes/Categories/tablet.json b/target/classes/Categories/tablet.json new file mode 100644 index 00000000..ed76c86c --- /dev/null +++ b/target/classes/Categories/tablet.json @@ -0,0 +1 @@ +{"name":"tablet","subCategories":[],"allSubProducts":[],"attributes":["good","new"],"imageName":"asdfasdf"} \ No newline at end of file diff --git a/target/classes/Products/bmw.json b/target/classes/Products/bmw.json index 39380afb..9f1a714a 100644 --- a/target/classes/Products/bmw.json +++ b/target/classes/Products/bmw.json @@ -1 +1 @@ -{"productID":"Product_48001161","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"bmw","companyName":"bmw","price":10000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good","allRating":[],"generatedDate":"Jul 21, 2020, 6:11:30 AM","viewTimes":0,"imageName":"32"} \ No newline at end of file +{"productID":"Product_69823390","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"bmw","companyName":"bmw","price":10000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good","allRating":[],"generatedDate":"Jul 24, 2020, 6:45:57 AM","viewTimes":0,"imageName":"32"} \ No newline at end of file diff --git a/target/classes/Products/peraid.json b/target/classes/Products/peraid.json index cdca5103..ac1c7df2 100644 --- a/target/classes/Products/peraid.json +++ b/target/classes/Products/peraid.json @@ -1 +1 @@ -{"productID":"Product_83955570","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peraid","companyName":"saipa","price":12000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good Product!","allRating":[],"generatedDate":"Jul 21, 2020, 6:11:30 AM","viewTimes":0,"imageName":"12"} \ No newline at end of file +{"productID":"Product_37682471","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peraid","companyName":"saipa","price":12000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"good Product!","allRating":[],"generatedDate":"Jul 24, 2020, 6:45:57 AM","viewTimes":0,"imageName":"12"} \ No newline at end of file diff --git a/target/classes/Products/peris.json b/target/classes/Products/peris.json index 85b94b54..0bce00f2 100644 --- a/target/classes/Products/peris.json +++ b/target/classes/Products/peris.json @@ -1 +1 @@ -{"productID":"Product_67516083","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peris","companyName":"aipr","price":80000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"nice","allRating":[],"generatedDate":"Jul 21, 2020, 6:11:30 AM","viewTimes":0,"imageName":"ado"} \ No newline at end of file +{"productID":"Product_27804364","status":"IN_CREATION_PROGRESS","categoryAttributes":{},"name":"peris","companyName":"aipr","price":80000.0,"allSellers":[],"isAvailable":false,"allComments":[],"explanationText":"nice","allRating":[],"generatedDate":"Jul 24, 2020, 6:45:58 AM","viewTimes":0,"imageName":"ado"} \ No newline at end of file diff --git a/target/classes/controller/ManagerAccountController.class b/target/classes/controller/ManagerAccountController.class index 802eff59..408fd04c 100644 Binary files a/target/classes/controller/ManagerAccountController.class and b/target/classes/controller/ManagerAccountController.class differ diff --git a/target/classes/graphicView/productsMenu/productsMenu.fxml b/target/classes/graphicView/productsMenu/productsMenu.fxml index effd36e4..b507b2f3 100644 --- a/target/classes/graphicView/productsMenu/productsMenu.fxml +++ b/target/classes/graphicView/productsMenu/productsMenu.fxml @@ -7,7 +7,7 @@ - + diff --git a/target/classes/graphicView/userRegion/userAccount/managerAccount/AddCategory.fxml b/target/classes/graphicView/userRegion/userAccount/managerAccount/AddCategory.fxml new file mode 100644 index 00000000..2c85c123 --- /dev/null +++ b/target/classes/graphicView/userRegion/userAccount/managerAccount/AddCategory.fxml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + - - - + + - + + + + + + + + + + + diff --git a/target/classes/graphicView/userRegion/userAccount/managerAccount/ViewAllCategoriesPage.class b/target/classes/graphicView/userRegion/userAccount/managerAccount/ViewAllCategoriesPage.class new file mode 100644 index 00000000..a310e178 Binary files /dev/null and b/target/classes/graphicView/userRegion/userAccount/managerAccount/ViewAllCategoriesPage.class differ diff --git a/target/classes/graphicView/userRegion/userAccount/managerAccount/ViewAllCategoriesPageController.class b/target/classes/graphicView/userRegion/userAccount/managerAccount/ViewAllCategoriesPageController.class new file mode 100644 index 00000000..103252b7 Binary files /dev/null and b/target/classes/graphicView/userRegion/userAccount/managerAccount/ViewAllCategoriesPageController.class differ diff --git a/target/classes/main/Main$1.class b/target/classes/main/Main$1.class deleted file mode 100644 index f8f0b93e..00000000 Binary files a/target/classes/main/Main$1.class and /dev/null differ diff --git a/target/classes/main/Main.class b/target/classes/main/Main.class index d759e237..67c0bab3 100644 Binary files a/target/classes/main/Main.class and b/target/classes/main/Main.class differ diff --git a/target/classes/model/Category.class b/target/classes/model/Category.class index 9a721f90..1ed06ee4 100644 Binary files a/target/classes/model/Category.class and b/target/classes/model/Category.class differ diff --git a/target/classes/module-info.class b/target/classes/module-info.class index d88c9d24..d8cb6e7b 100644 Binary files a/target/classes/module-info.class and b/target/classes/module-info.class differ