Package org.spw.model

Examples of org.spw.model.Country


        System.out.println("getCountryByName");
       
        String key = "AUSTRALIA";
        CountryController instance = new CountryController();
       
        Country expResult = new Country();
        expResult.setCountryCode("AU");
        expResult.setCountryName("AUSTRALIA");
        Country result = instance.getCountryByName(key);
        assertEquals(expResult, result);
    }
View Full Code Here


        System.out.println("read");
       
        String key = "AU";
        CountryController instance = new CountryController();
       
        Country expResult = new Country();
        expResult.setCountryCode("AU");
        expResult.setCountryName("AUSTRALIA");
        Country result = instance.read(key);
        assertEquals(expResult, result);
    }
View Full Code Here

    Contact contact = new Contact();
    MailExporter exporter = new MailExporter(contact);
    contact.setAddress1("address1");
    contact.setAddress2("address2");
    Country australia = new Country("AU", "Australia");
    contact.setCountry(australia);
    contact.setEmail("email");
    contact.setFax("fax");
    contact.setFirstName("firstName");
    contact.setIdContact(9999999L);
View Full Code Here

   
    public void country_validate(FacesContext context, UIComponent component, Object value) {
        if (value == null) {
            throw new ValidatorException(new FacesMessage("Null value is invalid for Country!"));
        }
        Country entity = countryControler.getCountryByName((String) value);
        if (entity == null) {
            throw new ValidatorException(new FacesMessage(value + " not found in countries."));
        }
        getSessionBean1().getProgram().setCountry(countryControler.getCountryByName((String) value));
    }
View Full Code Here

   
    public String buttonDelete_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            CountryController  ctrl = new CountryController();
            Country country = (Country)list.getObject(rk);
            ctrl.delete(country);
            list.refreshList();
        }
        return null;
    }
View Full Code Here

    }
   
    public String buttonEdit_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Country country = (Country)list.getObject(rk);
            getSessionBean1().setCountry(country);
        }
        return "edit";
    }
View Full Code Here

        }
        return "edit";
    }
   
    public String buttonNew_action() {
        getSessionBean1().setCountry(new Country());
       
        return "new";
    }
View Full Code Here

        if (value == null) return null;
        value = value.trim();
        if (value.length() == 0) return null;
       
        CountryController ctrl = new CountryController();
        Country obj = ctrl.read(value);
        return obj;
    }
View Full Code Here

    public String getAsString(FacesContext context, UIComponent component, Object value) {
        if (value == null) return null;
        if (!(value instanceof Country)) {
            throw new ConverterException("Error converting Country, got a " + value.getClass().getName());
        }
        Country obj = (Country) value;
        return obj.getCountryCode();
    }
View Full Code Here

TOP

Related Classes of org.spw.model.Country

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.