Package com.petrituononen.customerdb.jaxb

Examples of com.petrituononen.customerdb.jaxb.Phone


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


    txtStreet1.setText(address.getStreet().get(0));
    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());
View Full Code Here

   * @return Customer object
   */
  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.Phone

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.