}
}
public void onUserCreated(Event event)
{
Procedure2 createPhoneNumberForAddress = new Procedure2()
{
public void execute(Object address, Object category)
{
Address theAddress = ((Option<Address>) address).get();
String theCategory = (String) category;
PhoneNumber number = new PhoneNumber();
number.setCategory(theCategory);
theAddress.addPhoneNumber(number);
}
};
AkteraUser user = userDAO.findUserById((Integer) event.getProperties().get("id"));
Party party = addressDAO.getPartyByUserId(user.getId());
Option<Address> address = addressDAO.findAddressByPartyId(party.getId());
if (address.full())
{
createPhoneNumberForAddress.execute(address, "B");
createPhoneNumberForAddress.execute(address, "BM");
createPhoneNumberForAddress.execute(address, "BDD");
createPhoneNumberForAddress.execute(address, "BF");
createPhoneNumberForAddress.execute(address, "P");
createPhoneNumberForAddress.execute(address, "PM");
createPhoneNumberForAddress.execute(address, "PF");
createPhoneNumberForAddress.execute(address, "VOIP");
addressDAO.updateAddress(address.get());
}
}