Package com.petrituononen.customerdb.jaxb

Examples of com.petrituononen.customerdb.jaxb.Email


   * @param type
   * @param value
   * @return Email
   */
  public static Email createEmail(String type, String value) {
    Email email = factory.createEmail();
    email.setType(type);
    email.setValue(value);
   
    return email;
  }
View Full Code Here


    txtStreet2.setText(address.getStreet().get(1));
    txtPostalCode.setText(address.getPostalCode());
    txtTown.setText(address.getTown());
    List<Object> emailsAndPhones = cust.getEmailOrPhone();
    Phone phone = null;
    Email email = null;
    for(Object obj : emailsAndPhones) {
      if (obj instanceof Phone) {
        phone = ((Phone) obj);
        if(phone.getType().equalsIgnoreCase(PHONE_WORK)) {
          txtPhoneWork.setText(phone.getValue());
        }
        else if(phone.getType().equalsIgnoreCase(PHONE_MOBILE)) {
          txtPhoneMobile.setText(phone.getValue());
        }
      }
      else if (obj instanceof Email) {
        email = ((Email) obj);
        txtEmail.setText(email.getValue());
      }
    }
    txtNotes.setText(cust.getNotes())
  }
View Full Code Here

  private Customer formCustomerFromFields() {
    Address address = CustomerListManager.createAddress(ADDRESS_TYPE, txtStreet1.getText(),
        txtStreet2.getText(), txtPostalCode.getText(), txtTown.getText());
    Phone work = CustomerListManager.createPhone(PHONE_WORK, txtPhoneWork.getText());
    Phone mobile = CustomerListManager.createPhone(PHONE_MOBILE, txtPhoneMobile.getText());
    Email email = CustomerListManager.createEmail(EMAIL_WORK, txtEmail.getText());
    Customer cust = CustomerListManager.createCustomer(txtName.getText(), address, work,
        email, mobile, txtNotes.getText());
 
    return cust;
  }
View Full Code Here

TOP

Related Classes of com.petrituononen.customerdb.jaxb.Email

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.