Package org.spw.controller

Examples of org.spw.controller.PersonController


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


        try {
            id = new Long(value);
        } catch (NumberFormatException ex) {
            throw new ConverterException("Incorrect id for Contact[" + value +"]");
        }
        PersonController ctrl = new PersonController();
        return ctrl.read(id);
    }
View Full Code Here

        setList(aList);
    }
   
    public void refreshList(String office) {
        clearObjectList();
        PersonController ctrl = new PersonController();
        if (office == null) {
            aList.addAll(ctrl.getPersons());
        } else {
            aList.addAll(ctrl.getFromOffice(office));
        }
    }
View Full Code Here

        return (ApplicationBean1)getBean("ApplicationBean1");
    }
   
    public String buttonValidate_action() {
        // Persist the new object
        PersonController ctrl = new PersonController();
        Person object = getSessionBean1().getPerson();
        ctrl.update(object);
       
        return "success";
    }
View Full Code Here

        return (RequestBean1)getBean("RequestBean1");
    }
   
    public String buttonValidate_action() {
        VolunteerController ctrlVolunteer = new VolunteerController();
        PersonController ctrlPerson = new PersonController();
        Volunteer volunteer = getSessionBean1().getVolunteer();
        // parse the next of Kin & the parents
        Person contactNextOfKin = null;
        Person contactParent;
        if (nextOfKin.getText().length() > 0) {
            contactNextOfKin = ctrlPerson.parse((String) nextOfKin.getValue());
            if (contactNextOfKin != null) {
                volunteer.setNextOfKin(contactNextOfKin);
            }
        }
        if (volunteer.isParentsSameAsNextOfKin()) {
            volunteer.setParents(contactNextOfKin);
        } else {
            if (parents.getText().length() > 0) {
                contactParent = ctrlPerson.parse((String) parents.getValue());
                if (contactParent != null) {
                    volunteer.setParents(contactParent);
                }
            }
        }
       
        // Remove previous Person if creation of Volunteer from a Person
        if (getSessionBean1().getPerson() !=  null &&
                getSessionBean1().getPerson().getIdContact() == volunteer.getIdContact() ) {
            ctrlPerson.delete(getSessionBean1().getPerson());
        }
        // Persit the new object
        ctrlVolunteer.update(volunteer);
       
        //Set the person property for info display
View Full Code Here

   
    public void nextOfKin_complete(FacesContext context, String prefix, CompletionResult result) {
        if (prefix == null || prefix.trim().length() < 1) {
            return;
        }
        List<Person> persons = new PersonController().getPersonsBeginningBy(prefix, MAX_AUTOCOMPLETE) ;
        for (Person person : persons) {
            result.addItem(person.toString());
        }
    }
View Full Code Here

    }
   
    private void loadOfficeStaff(java.util.List<Contact> participants) {
        int i=0;
        // Load the Available staff
        PersonController personCtl = new PersonController();
        java.util.List<Person> personList = personCtl.getOfficeStaff();
        // Transfert Person to a Contact List
        java.util.List<Contact> contactList = new ArrayList();
        for (Contact contact : personList) {
            contactList.add(contact);
        }
View Full Code Here

    }
   
    private void loadOfficeStaff(java.util.List<Contact> participants) {
        int i=0;
        // Load the Available staff
        PersonController personCtl = new PersonController();
        java.util.List<Person> personList = personCtl.getOfficeStaff();
        // Transfert Person to a Contact List
        java.util.List<Contact> contactList = new ArrayList();
        for (Contact contact : personList) {
            contactList.add(contact);
        }
View Full Code Here

        return (RequestBean1)getBean("RequestBean1");
    }
   
    public String buttonValidate_action() {
        VolunteerController ctrlVolunteer = new VolunteerController();
        PersonController ctrlPerson = new PersonController();
        Volunteer volunteer = getSessionBean1().getVolunteer();
        // parse the next of Kin & the parents
        Person contactNextOfKin = null;
        Person contactParent;
        if (nextOfKin.getText().length() > 0) {
            contactNextOfKin = ctrlPerson.parse((String) nextOfKin.getValue());
            if (contactNextOfKin != null) {
                volunteer.setNextOfKin(contactNextOfKin);
            }
        }
        if (volunteer.isParentsSameAsNextOfKin()) {
            volunteer.setParents(contactNextOfKin);
        } else {
            if (parents.getText().length() > 0) {
                contactParent = ctrlPerson.parse((String) parents.getValue());
                if (contactParent != null) {
                    volunteer.setParents(contactParent);
                }
            }
        }
       
        // Remove previous Person if creation of Volunteer from a Person
        if (getSessionBean1().getPerson() !=  null &&
                getSessionBean1().getPerson().getIdContact() == volunteer.getIdContact() ) {
            ctrlPerson.delete(getSessionBean1().getPerson());
        }
        // Persit the new object
        ctrlVolunteer.update(volunteer);
       
        //Set the person property for info display
View Full Code Here

   
    public void nextOfKin_complete(FacesContext context, String prefix, CompletionResult result) {
        if (prefix == null || prefix.trim().length() < 1) {
            return;
        }
        List<Person> persons = new PersonController().getPersonsBeginningBy(prefix, MAX_AUTOCOMPLETE) ;
        for (Person person : persons) {
            result.addItem(person.toString());
        }
    }
View Full Code Here

TOP

Related Classes of org.spw.controller.PersonController

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.