* @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
*/
public Response insertRecord(ValueObject newPersistentObject) throws Exception {
Subject subjectVO = (Subject)newPersistentObject;
if (subjectVO.getSubjectTypeREG04().equals(ApplicationConsts.SUBJECT_ORGANIZATION_CUSTOMER)) {
OrganizationVO vo = (OrganizationVO)subjectVO;
OrganizationVO contact1VO = (OrganizationVO)this.contactVO;
vo.setAddressREG04(contact1VO.getAddressREG04());
vo.setCityREG04(contact1VO.getCityREG04());
vo.setCompanyCodeSys01REG04(contact1VO.getCompanyCodeSys01REG04());
vo.setCompanyCodeSys01Reg04REG04(contact1VO.getCompanyCodeSys01Reg04REG04());
vo.setCountryREG04(contact1VO.getCountryREG04());
vo.setEmailAddressREG04(contact1VO.getEmailAddressREG04());
vo.setFaxNumberREG04(contact1VO.getFaxNumberREG04());
vo.setLawfulSiteREG04(contact1VO.getLawfulSiteREG04());
vo.setName_1REG04(contact1VO.getName_1REG04());
vo.setName_2REG04(contact1VO.getName_2REG04());
vo.setNoteREG04(contact1VO.getNoteREG04());
vo.setPhoneNumberREG04(contact1VO.getPhoneNumberREG04());
vo.setProgressiveREG04(contact1VO.getProgressiveREG04());
vo.setProgressiveReg04REG04(contact1VO.getProgressiveReg04REG04());
vo.setProvinceREG04(contact1VO.getProvinceREG04());
vo.setTaxCodeREG04(contact1VO.getTaxCodeREG04());
vo.setWebSiteREG04(contact1VO.getWebSiteREG04());
vo.setZipREG04(contact1VO.getZipREG04());
}
else {
PeopleVO vo = (PeopleVO)subjectVO;
PeopleVO contact1VO = (PeopleVO)this.contactVO;
vo.setAddressREG04(contact1VO.getAddressREG04());
vo.setBirthdayREG04(contact1VO.getBirthdayREG04());
vo.setBirthplaceREG04(contact1VO.getBirthplaceREG04());
vo.setCityREG04(contact1VO.getCityREG04());
vo.setCompanyCodeSys01REG04(contact1VO.getCompanyCodeSys01REG04());
vo.setCompanyCodeSys01Reg04REG04(contact1VO.getCompanyCodeSys01Reg04REG04());
vo.setCountryREG04(contact1VO.getCountryREG04());
vo.setEmailAddressREG04(contact1VO.getEmailAddressREG04());
vo.setFaxNumberREG04(contact1VO.getFaxNumberREG04());
vo.setMaritalStatusREG04(contact1VO.getMaritalStatusREG04());
vo.setMobileNumberREG04(contact1VO.getMobileNumberREG04());
vo.setName_1REG04(contact1VO.getName_1REG04());
vo.setName_2REG04(contact1VO.getName_2REG04());
vo.setNationalityREG04(contact1VO.getNationalityREG04());
vo.setNoteREG04(contact1VO.getNoteREG04());
vo.setPhoneNumberREG04(contact1VO.getPhoneNumberREG04());
vo.setProgressiveREG04(contact1VO.getProgressiveREG04());
vo.setProgressiveReg04REG04(contact1VO.getProgressiveReg04REG04());
vo.setProvinceREG04(contact1VO.getProvinceREG04());
vo.setSexREG04(contact1VO.getSexREG04());
vo.setTaxCodeREG04(contact1VO.getTaxCodeREG04());
vo.setWebSiteREG04(contact1VO.getWebSiteREG04());
vo.setZipREG04(contact1VO.getZipREG04());
}
Response response = ClientUtils.getData("insertCustomer",subjectVO);
if (response.isError()) {
throw new RuntimeException(response.getErrorMessage());