Examples of CustomerAddress


Examples of com.apress.prospring.ch9.domain.CustomerAddress

    customer.setFirstName("Jack");
    customer.setLastName("Schitt");
    customer.setPermissions(new HashSet());
    customer.setAddresses(new HashSet());
   
    CustomerAddress ca = new CustomerAddress();
    ca.setLine1("1");
    ca.setLine2("2");
    ca.setCity("Manchester");
    ca.setPostCode("M1 xx");
   
    customer.getAddresses().add(ca);
   
    Permission p = new Permission();
    p.setPermissionId(1);
View Full Code Here

Examples of com.google.code.magja.model.customer.CustomerAddress

        try {
            System.out.println("Creating customer");
            Customer customer = generateCustomer();
            customerService.save(customer);

            CustomerAddress shipAddr = generateAddress();
            CustomerAddress billAddr = generateAddress();
            shipAddr.setCustomer(customer);
            shipAddr.setDefaultBilling(false);
            shipAddr.setDefaultShipping(true);
            billAddr.setCustomer(customer);
            billAddr.setDefaultBilling(true);
            billAddr.setDefaultShipping(false);


            System.out.println("Creating default ship addr");
            customerAddressService.save(shipAddr);
            System.out.println("Creating default bill addr");
            customerAddressService.save(billAddr);

            System.out.println("Creating cart");
            Cart cart = service.create(0);
            System.out.println("Created cart " + cart);

            System.out.println("Setting customer");
            cart.setCustomer(customer);
            service.setCustomer(cart);

            System.out.println("Adding product");
            Product p = new Product();
            p.setSku("NI3TP");      //FIXME
            p.setId(53);            //FIXME
            service.addProduct(cart, p, 1);

            System.out.println("Setting cart addresses");
            System.err.println(shipAddr.getAllProperties());
            CartAddress cartShipAddr = CartAddress.fromAttributes(shipAddr.getAllProperties());
            CartAddress cartBillAddr = CartAddress.fromAttributes(billAddr.getAllProperties());
            cart.setBillingaddress(cartBillAddr);
            cart.setShippingAddress(cartShipAddr);
            service.setAddresses(cart);

            System.out.println("Creating order");
View Full Code Here

Examples of com.google.code.magja.model.customer.CustomerAddress

        return cust;
    }

    public CustomerAddress generateAddress() {
        CustomerAddress address = new CustomerAddress();
        address.setCity("Berlin");
        address.setCompany("Company");
        address.setCountryCode("DE");
        address.setFax("4444-1111");
        address.setPrefix("Herr");
        address.setFirstName(MagjaStringUtils.randomString(5, 10));
        address.setMiddleName(MagjaStringUtils.randomString(5, 10));
        address.setLastName(MagjaStringUtils.randomString(5, 10));
        address.setPostCode("10117");
        address.setTelephone("1111-2222");
        address.setRegion("Berlin");
        address.setStreet(MagjaStringUtils.randomString(5, 10) + " 1");

        return address;
    }
View Full Code Here

Examples of com.google.code.magja.model.customer.CustomerAddress

    customerService = RemoteServiceFactory.getCustomerRemoteService();
  }

  public static CustomerAddress generateAddress() {

    CustomerAddress address = new CustomerAddress();

    address.setCity(MagjaStringUtils.randomString(5, 10));
    address.setCompany(MagjaStringUtils.randomString(5, 10));
    address.setCountryCode("BR");
    address.setDefaultBilling(true);
    address.setDefaultShipping(false);
    address.setFax("(19) 4444-1111");
    address.setFirstName(MagjaStringUtils.randomString(5, 10));
    address.setMiddleName(MagjaStringUtils.randomString(5, 10));
    address.setLastName(MagjaStringUtils.randomString(5, 10));
    address.setPostCode("13000-002");
    address.setTelephone("(19) 1111-2222");
    address.setRegion("SP");
    address.setStreet(MagjaStringUtils.randomString(5, 10));

    return address;
  }
View Full Code Here

Examples of com.google.code.magja.model.customer.CustomerAddress

    } catch (ServiceException e) {
      fail(e.getMessage());
    }

    // then create a new Address for that customer
    CustomerAddress address = generateAddress();
    address.setCustomer(customer);

    try {
      service.save(address);
      address_id = address.getId();
    } catch (ServiceException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

Examples of com.google.code.magja.model.customer.CustomerAddress

    } catch (ServiceException e) {
      fail(e.getMessage());
    }

    // then create a new Address for that customer
    CustomerAddress address = generateAddress();
    address.setCustomer(customer);

    try {
      service.save(address);
      address_id = address.getId();
    } catch (ServiceException e) {
      fail(e.getMessage());
    }

    // update that address
    address.setStreet("Av. James Rules, 293");
    address.setPostCode("02931-293");
    address.setTelephone("(19) 3255-0000");
    address.setCompany("Company Bla Bla Bla");

    try {
      service.save(address);
    } catch (ServiceException e) {
      fail(e.getMessage());
View Full Code Here

Examples of com.google.code.magja.model.customer.CustomerAddress

   */
  @Test
  public void testGetById() {
    testSave();
    try {
      CustomerAddress address = service.getById(address_id);
      System.out.println(address.toString());
    } catch (ServiceException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

Examples of com.google.code.magja.model.customer.CustomerAddress

    } catch (ServiceException e) {
      fail(e.getMessage());
    }

    for (int i = 0; i < count_addresses; i++) {
      CustomerAddress address = generateAddress();
      address.setCustomer(customer);
      try {
        service.save(address);
      } catch (ServiceException e) {
        fail(e.getMessage());
      }
View Full Code Here

Examples of com.google.code.magja.model.customer.CustomerAddress

   *
   * @param attributes
   * @return CustomerAddress
   */
  private CustomerAddress buildCustomerAddress(Map<String, Object> attributes) {
    CustomerAddress address = new CustomerAddress();

    for (Map.Entry<String, Object> attr : attributes.entrySet())
      address.set(attr.getKey(), attr.getValue());

    return address;
  }
View Full Code Here

Examples of com.jada.jpa.entity.CustomerAddress

  public CustomerDAO(Customer customer) {
    this.custId = customer.getCustId();
    this.custEmail = customer.getCustEmail();
    this.custSource = customer.getCustSource();
    this.custSourceRef = customer.getCustSourceRef();
    CustomerAddress customerAddress = null;
      for (CustomerAddress address : customer.getCustAddresses()) {
        if (address.getCustAddressType().equals(Constants.CUSTOMER_ADDRESS_CUST)) {
          customerAddress = address;
          break;
        }
      }
    this.custFirstName = customerAddress.getCustFirstName();
    this.custMiddleName = customerAddress.getCustMiddleName();
    this.custLastName = customerAddress.getCustLastName();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.