Booking confirmation and e-mail service added. Some bugs to be solved.
[RRRRHHHH_Code] / ruralHouses / src / businessLogic / AccountManager.java
index 6f3b626..7b5efe9 100644 (file)
@@ -1,5 +1,7 @@
 package businessLogic;
 
+import javax.mail.MessagingException;
+
 import dataAccess.DB4oManager;
 import domain.Account;
 
@@ -18,8 +20,15 @@ public class AccountManager {
        }
        
        public boolean addAccount(Account ac){
-               if(this.dbMngr.addAccount(ac))
+               if(this.dbMngr.addAccount(ac)){
+                       try {
+                               MailManager.getInstance().Send(ac.getOwner().getMailAccount(), "Entered into the system", "Congratulations");
+                       } catch (MessagingException e) {
+                               // TODO Auto-generated catch block
+                               e.printStackTrace();
+                       }
                        return true;
+                       }
                return false;
                
        }