Package kirjastox.model

Examples of kirjastox.model.Customer


   @FXML
    private void handleReturnLoansButtonAction(ActionEvent event){
        System.out.println("Customers: Return all loans");
        try {
            // Otetaan ensin valittu asiakas
            Customer selectedCustomer = (Customer) customersTableView.getSelectionModel().getSelectedItem();
           
            // Käydään valitun asiakkaan kirjalainat yksitellen läpi
            for(Book loanedBook: selectedCustomer.getBookLoans()){
               
                //Merkitään kirjan vapainaolevien niteiden määrä kasvaneeksi yhdellä
                this.dataController.setBookReturned(loanedBook);
            }
           
            // Pyyhitään asiakkaan kirjalainat
            selectedCustomer.getBookLoans().clear();
           
            // Tallennetaan tila vielä lopuksi tietovastoon
            this.dataController.updateCustomersPersistentStore();
        } catch (Exception e) {
            System.out.println("Customers: Returning customers loans failed");
View Full Code Here


    @FXML
    private void handlePayFinesButtonAction(ActionEvent event){
        System.out.println("Customers: Pay all fines");
       
        try {
            Customer selectedCustomer = (Customer) customersTableView.getSelectionModel().getSelectedItem();
           
            // Tarkastetaan onko asiakkaalla maksettavia sakkoja, jottei turhaan päivitetä persistenttiä dataa
            if(selectedCustomer.getFines() > 0){
                selectedCustomer.payFines();
                this.dataController.updateCustomersPersistentStore();
            }
           
        } catch (Exception e) {
            System.out.println("Customers: Returning customers loans failed");
View Full Code Here

    //Mahdollisesti jotain varmistusta?
    @FXML
    private void handleRemoveCustomerButtonAction(ActionEvent event){
        System.out.println("Customers: Remove an existing customer");
        try {
            Customer selectedCustomer = (Customer) customersTableView.getSelectionModel().getSelectedItem();
            this.dataController.getCustomers().remove(selectedCustomer);
            this.dataController.updateCustomersPersistentStore();
        } catch (Exception e) {
            System.out.println("Customers: Removing an existing customer failed");
        }
View Full Code Here

            loansTableView.setVisible(true);
            payFinesButton.setVisible(true);
            returnLoansButton.setVisible(true);        

           
            Customer newCustomer = new Customer(name, address, nextCardNumber);
            this.dataController.getCustomers().add(newCustomer);
            nextCardNumber++;
            this.dataController.updateCustomersPersistentStore();
           
           
View Full Code Here

TOP

Related Classes of kirjastox.model.Customer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.