boolean bIsRegistered = false;
try {
UserProfile profile = getNewUser();
if (!profile.getChangePin().getNewPin().equals(profile.getChangePin().getRetryPin())) {
bIsRegistered = false;
msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Password mismatch",
"Please make sure that your re-type your pin correctly!");
} else {
profile.getProfileData().setPassword(profile.getChangePin().getNewPin());
CustomerDTO _customerDTO = _customerWebService.getCustomerServiceImplPort().registerCustomer(
profile.getProfileData());
if (_customerDTO.getReturncode() == 0) {
bIsRegistered = true;
AddressDTO defaultAdr =_customerWebService.getCustomerServiceImplPort().maintainAddress(_customerDTO, profile.getBillingAddress());
if (defaultAdr.getReturncode() != 0) {
msg = new FacesMessage(FacesMessage.SEVERITY_WARN, "Profile Data missing",
"Could not store your billing address. Please check the data!");
SystemController.redirectUrl(ctx, "userprofile");
}
defaultAdr = _customerWebService.getCustomerServiceImplPort().maintainAddress(_customerDTO, profile.getShippingAddress());
if (defaultAdr.getReturncode() != 0) {
msg = new FacesMessage(FacesMessage.SEVERITY_WARN, "Profile Data missing",
"Could not store your shipping address. Please check the data!");