public void removeUnusedPhones(ShippingInfoForm form) { Address address = form.getAddress(); Phone primaryPhone = address.getPhonePrimary(); Phone secondaryPhone = address.getPhoneSecondary(); Phone faxPhone = address.getPhoneFax(); if ((primaryPhone != null) && (StringUtils.isEmpty(primaryPhone.getPhoneNumber()))) { address.setPhonePrimary(null); } if ((secondaryPhone != null) && (StringUtils.isEmpty(secondaryPhone.getPhoneNumber()))) { address.setPhoneSecondary(null); } if ((faxPhone != null) && (StringUtils.isEmpty(faxPhone.getPhoneNumber()))) { address.setPhoneFax(null); } }
public void removeUnusedPhones(CustomerAddressForm form) { if ((form.getAddress().getPhonePrimary() != null) && (StringUtils.isEmpty(form.getAddress().getPhonePrimary().getPhoneNumber()))) { form.getAddress().setPhonePrimary(null); } if ((form.getAddress().getPhoneSecondary() != null) && (StringUtils.isEmpty(form.getAddress().getPhoneSecondary().getPhoneNumber()))) { form.getAddress().setPhoneSecondary(null); } if ((form.getAddress().getPhoneFax() != null) && (StringUtils.isEmpty(form.getAddress().getPhoneFax().getPhoneNumber()))) { form.getAddress().setPhoneFax(null); } }
public void setAddress(Address address) { if (address.getPhonePrimary() == null) { address.setPhonePrimary(new PhoneImpl()); } if (address.getPhoneSecondary() == null) { address.setPhoneSecondary(new PhoneImpl()); } if (address.getPhoneFax() == null) { address.setPhoneFax(new PhoneImpl()); } this.address = address; }
public String addCustomerPayment(HttpServletRequest request, Model model, PaymentInfoForm paymentInfoForm, BindingResult bindingResult) { Customer customer = CustomerState.getCustomer(); addressService.populateAddressISOCountrySub(paymentInfoForm.getAddress()); paymentInfoFormValidator.validate(paymentInfoForm, bindingResult); if (!bindingResult.hasErrors()) { if ((paymentInfoForm.getAddress().getPhonePrimary() != null) && (StringUtils.isEmpty(paymentInfoForm.getAddress().getPhonePrimary().getPhoneNumber()))) { paymentInfoForm.getAddress().setPhonePrimary(null); } if ((paymentInfoForm.getAddress().getPhoneSecondary() != null) && (StringUtils.isEmpty(paymentInfoForm.getAddress().getPhoneSecondary().getPhoneNumber()))) { paymentInfoForm.getAddress().setPhoneSecondary(null); } if ((paymentInfoForm.getAddress().getPhoneFax() != null) && (StringUtils.isEmpty(paymentInfoForm.getAddress().getPhoneFax().getPhoneNumber()))) { paymentInfoForm.getAddress().setPhoneFax(null); } savedPaymentService.addSavedPayment(customer, paymentInfoForm); return getCustomerPaymentRedirect(); } return getCustomerPaymentView(); }
form.getAddress().setPhonePrimary(null); if ((form.getAddress().getPhoneSecondary() != null) && (StringUtils.isEmpty(form.getAddress().getPhoneSecondary().getPhoneNumber()))) { form.getAddress().setPhoneSecondary(null);
paymentForm.getAddress().setPhonePrimary(null); if ((paymentForm.getAddress().getPhoneSecondary() != null) && (StringUtils.isEmpty(paymentForm.getAddress().getPhoneSecondary().getPhoneNumber()))) { paymentForm.getAddress().setPhoneSecondary(null);
billingForm.getAddress().setPhonePrimary(null); if ((billingForm.getAddress().getPhoneSecondary() != null) && (StringUtils.isEmpty(billingForm.getAddress().getPhoneSecondary().getPhoneNumber()))) { billingForm.getAddress().setPhoneSecondary(null);
shippingForm.getAddress().setPhonePrimary(null); if ((shippingForm.getAddress().getPhoneSecondary() != null) && (StringUtils.isEmpty(shippingForm.getAddress().getPhoneSecondary().getPhoneNumber()))) { shippingForm.getAddress().setPhoneSecondary(null);
dest.setFax(orig.getFax()); dest.setPhonePrimary(phoneService.copyPhone(dest.getPhonePrimary(), orig.getPhonePrimary())); dest.setPhoneSecondary(phoneService.copyPhone(dest.getPhoneSecondary(), orig.getPhoneSecondary())); dest.setPhoneFax(phoneService.copyPhone(dest.getPhoneFax(), orig.getPhoneFax())); dest.setEmailAddress(orig.getEmailAddress());