public void validateID(AjaxBehaviorEvent event) { String idValidate = IclubWebHelper.validateId(bean.getPIdNum(), bean.getPGender()); if (idValidate != null && !idValidate.trim().equalsIgnoreCase("")) { IclubWebHelper.addMessage(idValidate, FacesMessage.SEVERITY_ERROR); } else { String dateOfBirth = bean.getPIdNum().toString().substring(0, 6); SimpleDateFormat formatter = new SimpleDateFormat("yyMMdd"); try { Date dateOfBirthD = formatter.parse(dateOfBirth); bean.setPDob(dateOfBirthD); } catch (ParseException e) { e.printStackTrace(); } } }
public static IclubPersonBean fromWStoUI(IclubPersonModel model) { IclubPersonBean bean = new IclubPersonBean(); bean.setPId(model.getPId()); bean.setPCrtdDt(model.getPCrtdDt()); bean.setPDob(model.getPDob()); bean.setPEmail(model.getPEmail()); bean.setPFName(model.getPFName()); bean.setPIdNum(model.getPIdNum()); bean.setPLName(model.getPLName()); bean.setPAge(model.getPAge()); bean.setPMobile(model.getPMobile()); bean.setPAddress(model.getPAddress()); bean.setPContactPref(model.getPContactPref()); bean.setPGender(model.getPGender()); bean.setPContactPref(model.getPContactPref()); bean.setPIdExpiryDt(model.getPIdExpiryDt()); bean.setPInitials(model.getPInitials()); bean.setPIsPensioner(model.getPIsPensioner()); bean.setPIdIssueCntry( model.getPIdIssueCntry() != null ? model.getPIdIssueCntry().longValue() : null); bean.setPIdIssueDt(model.getPIdIssueDt()); bean.setPLat(model.getPLat()); bean.setPLong(model.getPLong()); bean.setPOccupation(model.getPOccupation()); bean.setPTitle(model.getPTitle()); bean.setPZipCd(model.getPZipCd()); bean.setIclubIdType(model.getIclubIdType()); bean.setItLongDesc(model.getItLongDesc()); bean.setIclubMaritalStatus(model.getIclubMaritalStatus()); bean.setMsLongDesc(model.getMsLongDesc()); bean.setIclubPerson(model.getIclubPerson()); bean.setPFNameAndLName(model.getPFNameAndLName()); bean.setIclubCohort(model.getIclubCohort()); bean.setCEmail(model.getCEmail()); bean.setIclubCohortInvite(model.getIclubCohortInvite()); return bean; }