Package com.petrituononen.customerdb.jaxb

Examples of com.petrituononen.customerdb.jaxb.Customer


      try {
        fis = new FileInputStream(file);
        customers = (Customers) unmarshaller.unmarshal(fis);
        List<Customer> lst = customers.getCustomer();
        for(int i=0; i<lst.size(); i++) {
          Customer c = lst.get(i);
          if(c.getName().equalsIgnoreCase(cust.getName())) {
            customers.getCustomer().remove(c);
            break;
          }
        }
        marshaller.marshal(customers, new FileOutputStream(xmlName)) ;
View Full Code Here


   * @param notes
   * @return Customer
   */
  public static Customer createCustomer(String name, Address address,
      Phone work, Email email, Phone mobile, String notes) {
    Customer cust = factory.createCustomer();
    cust.setName(name);
    cust.setAddress(address);
    cust.getEmailOrPhone().add(work);
    cust.getEmailOrPhone().add(email);
    cust.getEmailOrPhone().add(mobile);
    cust.setNotes(notes);
   
    return cust;
  }
View Full Code Here

        if(currentCustomer != null) { //modify customer data
          clm.modifyCustomer(xmlName, browseIdx,
              formCustomerFromFields())
        }
        else { //create a new customer
          Customer newCust = formCustomerFromFields();
          if(!newCust.getName().equalsIgnoreCase("")) {
            clm.addCustomer(xmlName, newCust);
            currentCustomer = newCust;           
          }
        }
      }
View Full Code Here

    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.Customer

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.