Package com.evasion.entity

Examples of com.evasion.entity.Corporation


@FacesConverter(forClass = Corporation.class, value = "personConverter")
public class PersonConverter implements Converter {

    @Override
    public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String rawValue) {
        Corporation result = null;
        if (uiComponent instanceof HtmlSelectOneMenu) {
            HtmlSelectOneMenu menu = (HtmlSelectOneMenu) uiComponent;
            UISelectItems items = (UISelectItems) menu.getChildren().get(0);
            List obj = (List) items.getValue();
            for (Iterator it = obj.iterator(); it.hasNext();) {
                Corporation corpo = (Corporation) it.next();
                if (corpo.getId().equals(Long.valueOf(rawValue))) {
                    result = corpo;
                    break;
                }
            }
        }
View Full Code Here


@FacesConverter(forClass = Corporation.class, value = "corpoConverter")
public class CorpoConverter implements Converter {

    @Override
    public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String rawValue) {
        Corporation result = null;
        if (uiComponent instanceof HtmlSelectOneMenu) {
            HtmlSelectOneMenu menu = (HtmlSelectOneMenu) uiComponent;
            UISelectItems items = (UISelectItems) menu.getChildren().get(0);
            List obj = (List) items.getValue();
            for (Iterator it = obj.iterator(); it.hasNext();) {
                Corporation corpo = (Corporation) it.next();
                if (corpo.getId().equals(Long.valueOf(rawValue))) {
                    result = corpo;
                    break;
                }
            }
        }
View Full Code Here

        if (value != null) {
            // Default components check if the value is a String and return it as it is
            if (value instanceof String) {
                stringValue = (String) value;
            } else if (value instanceof Corporation) {
                Corporation corpoValue = (Corporation) value;
                stringValue = corpoValue.getId().toString();
            }
            //throw new ConverterException(C.getMessage(facesContext,"phoneconverter-bad-phone"));
        }
        return stringValue;
View Full Code Here

@FacesConverter(forClass = Corporation.class, value = "personConverter")
public class PersonConverter implements Converter {

    @Override
    public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String rawValue) {
        Corporation result = null;
        if (uiComponent instanceof HtmlSelectOneMenu) {
            HtmlSelectOneMenu menu = (HtmlSelectOneMenu) uiComponent;
            UISelectItems items = (UISelectItems) menu.getChildren().get(0);
            List obj = (List) items.getValue();
            for (Iterator it = obj.iterator(); it.hasNext();) {
                Corporation corpo = (Corporation) it.next();
                if (corpo.getId().equals(Long.valueOf(rawValue))) {
                    result = corpo;
                    break;
                }
            }
        }
View Full Code Here

    public String validPerson() {

        if ((type != null && type.equals("indiv")) || !prenom.isEmpty()) {
            personEntity = new Individual(email, convertCivilite(civilite), nom, prenom, naissance);
        } else if ((type != null && type.equals("corpo")) || !description.isEmpty()) {
            personEntity = new Corporation(nom, email, description);
        }
        return null;
    }
View Full Code Here

    public String validPerson() {

        if ((type != null && type.equals("indiv")) || !prenom.isEmpty()) {
            personEntity = new Individual(email, convertCivilite(civilite), nom, prenom, naissance);
        } else if ((type != null && type.equals("corpo")) || !description.isEmpty()) {
            personEntity = new Corporation(nom, email, description);
        }
        return null;
    }
View Full Code Here

    public String validPerson() {

        if ((type != null && type.equals("indiv")) || !prenom.isEmpty()) {
            personEntity = new Individual(email, convertCivilite(civilite), nom, prenom, naissance);
        } else if ((type != null && type.equals("corpo")) || !description.isEmpty()) {
            personEntity = new Corporation(nom, email, description);
            ((Corporation)personEntity).setSiteUrl(site);
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of com.evasion.entity.Corporation

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.