private void displayRecords(UserWeb user) { // Name userName.setValue(user.getUsername()); firstName.setValue(user.getFirstName()); lastName.setValue(user.getLastName()); passwordHint.setValue(user.getPasswordHint()); // Address address.setValue(user.getAddress()); city.setValue(user.getCity()); for (State st : states.getModels()) { if (st.getAbbr().equals(user.getState())) state.setValue(st); } zip.setValue(user.getPostalCode()); for (Country co : countries.getModels()) { if (co.getName().equals(user.getCountry())) country.setValue(co); } // Phone phoneNumber.setValue(user.getPhoneNumber()); // Other email.setValue(user.getEmail()); emailConfirm.setValue(user.getEmail()); webSite.setValue(user.getWebsite()); }
private UserWeb copyUser(UserWeb user) { UserWeb updatingUser = new UserWeb(); updatingUser.setId(user.getId()); // Name updatingUser.setUsername(user.getUsername()); updatingUser.setFirstName(user.getFirstName()); updatingUser.setLastName(user.getLastName()); // Password updatingUser.setPassword(user.getPassword()); updatingUser.setConfirmPassword(user.getConfirmPassword()); updatingUser.setPasswordHint(user.getPasswordHint()); // Address updatingUser.setAddress(user.getAddress()); updatingUser.setCity(user.getCity()); updatingUser.setState(user.getState()); updatingUser.setPostalCode(user.getPostalCode()); updatingUser.setCountry(user.getCountry()); // Phone updatingUser.setPhoneNumber(user.getPhoneNumber()); // Other updatingUser.setEmail(user.getEmail()); updatingUser.setWebsite(user.getWebsite()); updatingUser.setVersion(user.getVersion()); updatingUser.setAccountExpired(user.getAccountExpired()); updatingUser.setAccountLocked(user.getAccountLocked()); updatingUser.setEnabled(user.getEnabled()); updatingUser.setCredentialsExpired(user.getCredentialsExpired()); // user roles updatingUser.setRoles(user.getRoles()); return updatingUser; }