Owner deletion added
[RRRRHHHH_Code] / ruralHouses / src / businessLogic / AccountManager.java
index ae57126..d86cb48 100644 (file)
@@ -6,7 +6,6 @@ import java.rmi.server.UnicastRemoteObject;
 import javax.mail.MessagingException;
 
 import common.AccountInterface;
-
 import dataAccess.DB4oManager;
 import domain.Account;
 import domain.Administrator;
@@ -43,9 +42,15 @@ public class AccountManager extends UnicastRemoteObject implements AccountInterf
                
        }
        
-       public boolean removeAccount(Account ac)throws RemoteException {
-               if(this.dbMngr.removeAccount(ac))
-                       return true;
+       public boolean removeAccount(int index)throws RemoteException {
+               OwnerManager own = new OwnerManager();
+               try {
+                       if(this.dbMngr.removeAccount(own.getOwners().get(index)))
+                               return true;
+               } catch (Exception e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               }
                return false;
                
        }