Package de.fhdw.ify208.ticketmaster.webapp.model

Examples of de.fhdw.ify208.ticketmaster.webapp.model.UserProfile


  @Test
  public void maintainCustomerAddress() {
    CustomerDTO customer = _theCustomerManager.signOn("appelgriebsch", "1234");
    AddressDTO address = new AddressDTO();
    TypeCodeDTO tpCode = new TypeCodeDTO();
    tpCode.setName("Private");
    tpCode.setId(1);
    CountryDTO countryDTO = new CountryDTO();
    countryDTO.setIsoCode("TUR");
    address.setAddressType(tpCode);
    address.setAddressLine("Mustetstrasse 7");
    address.setCityName("Musterstadt");
View Full Code Here


  @Test
  public void removeCustomerAddress() {
    CustomerDTO customer = _theCustomerManager.signOn("appelgriebsch", "1234");
    AddressDTO address = new AddressDTO();
    TypeCodeDTO tpCode = new TypeCodeDTO();
    tpCode.setName("Private");
    tpCode.setId(1);
    CountryDTO countryDTO = new CountryDTO();
    countryDTO.setIsoCode("TUR");
    address.setid(new Long(7));
    address.setAddressType(tpCode);
    address.setAddressLine("Mustetstrasse 7");
View Full Code Here

  @Test
  public void createEvent() {
    EventDTO event = new EventDTO();
    AddressDTO location = new AddressDTO();
    TypeCodeDTO tpCode = new TypeCodeDTO();
    TypeCodeDTO tpCode1 = new TypeCodeDTO();
    CountryDTO country = new CountryDTO();
    BaseDTO result = new BaseDTO();
    Date d1 = new Date(2011, 12, 31, 20, 0,0);
    Date d2 = new Date(2011, 12, 31, 21, 0,0);
    country.setIsoCode("TUR");
    tpCode.setId(1);
    tpCode.setDescription("Test");
    tpCode1.setId(1);
    location.setid(new Long(3));
    location.setAddressType(tpCode1);
    location.setCountry(country);
    location.setAddressLine("TEST MARK");
    location.setStreetName("TEST MARK");
View Full Code Here

  @Test
  public void createArtist() {
    BaseDTO result = new BaseDTO();
    ArtistDTO artist = new ArtistDTO();
    TypeCodeDTO tpCode = new TypeCodeDTO();
    tpCode.setId(1);
    tpCode.setDescription("Test");
    artist.setid(new Long(4));
    artist.setStageName("Test4");
    artist.setFirstName("First");
    artist.setLastName("Last");
    artist.setMessage("Test");
View Full Code Here

    /**
     * @return instance of TypeCodeListDTO
     */
    public TypeCodeListDTO getAddressTypes() {

        TypeCodeListDTO listDTO = new TypeCodeListDTO();
        EntityMapper mapper = new EntityMapper();

        List<AddressType> _listOfAddressTypes = this._getAllAddressTypes();
        for (Iterator<AddressType> iter = _listOfAddressTypes.iterator(); iter.hasNext(); ) {

            listDTO.addTypeCodeToList(mapper.getTypeCodeDTOFromAddressType(iter.next()));
        }

        if (listDTO.getTypeCodeDTOList().size() > 0) {
            listDTO.setReturncode(0);
        } else {
            listDTO.setReturncode(99);
            listDTO.setMessage("Error getting address types from database");
        }
        return listDTO;
    }
View Full Code Here

     * @param theAddress
     * @return AddressDTO
     */
    public AddressDTO maintainAddress(CustomerDTO theCustomer, AddressDTO theAddress) {
        User customer = null;
        Address address = null;
        EntityMapper mapper = new EntityMapper();
        AddressDTO addressDTO = null;

        if (theAddress.getid() != null) {
            // address has an id, so just update the address itself
View Full Code Here

     * @return BaseDTO
     */
    public BaseDTO removeAddress(CustomerDTO theCustomer, AddressDTO theAddress) {
        BaseDTO baseDTO = new BaseDTO();
        // check address exists
        Address address = _checkAddressExists(theAddress.getid());
        User customer = _checkCustomerExists(theCustomer.getid());
        if (address != null && customer != null) {
            customer = _removeCustomerAddress(customer, address.getId());
            if (customer != null) {
                customer = _updateCustomer(customer);
                if (customer == null) {
                    baseDTO.setReturncode(99);
                    baseDTO.setMessage("Error during update of customers addressdata.");
View Full Code Here

        return _customer;
    }

    private User _removeCustomerAddress(User customer, Long addressID) {
        List<Address> addressList = customer.getAddresses();
        Address addressToRemove = null;
        // search for address in customers addresses
        for (Iterator<Address> i = addressList.iterator(); i.hasNext(); ) {
            Address address = i.next();
            if (address.getId() == addressID) {
                // existing address has to be removed
                addressToRemove = address;
            }
        }
        addressList.remove(addressToRemove);
View Full Code Here

    }

    private Address _findNewAddressFromCustomer(User customer) {
        List<Address> addressList = customer.getAddresses();
        Long high = new Long(0);
        Address newAddress = null;
        // search for address in customers addresses
        for (Iterator<Address> i = addressList.iterator(); i.hasNext(); ) {
            Address address = i.next();
            if (address.getId() > high) {
                // remember me
                high = address.getId();
                newAddress = address;
            }
        }
        customer.setAddresses(addressList);
        return newAddress;
View Full Code Here

     * @param theCustomer
     * @return AddressListDTO
     */
    public AddressListDTO getCustomerAddresses(CustomerDTO theCustomer) {
        AddressListDTO addressListDTO = new AddressListDTO();
        User customer = _checkCustomerExists(theCustomer.getid());
        if (customer == null) {
            addressListDTO.setReturncode(99);
            addressListDTO.setMessage("Customer does not exist on database.");
        } else {
            EntityMapper mapper = new EntityMapper();
            List<Address> addressList = customer.getAddresses();
            for (Iterator<Address> i = addressList.iterator(); i.hasNext(); ) {
                addressListDTO.addAddressToList(mapper.getAddressDTOfromAddress(i.next()));
            }
        }
        return addressListDTO;
View Full Code Here

TOP

Related Classes of de.fhdw.ify208.ticketmaster.webapp.model.UserProfile

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.