Package org.spw.model

Examples of org.spw.model.Person


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


   
    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

        list.refreshList(getSelectedOffice());
        return null;
    }
   
    public String buttonAdd_action() {
        getSessionBean1().setPerson(new Person());
       
        return "new";
    }
View Full Code Here

    }
   
    public String buttonInfo_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Person person = (Person) list.getObject(rk);
            getSessionBean1().setPerson(person);
        }
       
        return "info";
    }
View Full Code Here

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

    public void testAddAttendance() {
        System.out.println("addAttendance");
       
        Event event = ctrl.read(TEST_ID_NO_REMINDER);

        Person person = new Person();
        person.setIdContact(TEST_ID_NO_REMINDER);
        person.setFirstName(getName());
        person.setLastName(getName());
        person = contactCtrl.update(person);
        person.getEventsAttended().add(event);
        person = contactCtrl.update(person);
       
        ctrl.addAttendance(person, event);
        event = ctrl.read(TEST_ID_NO_REMINDER);
        assertTrue(event.getContactsAttended().contains(person));
        person = contactCtrl.read(TEST_ID_NO_REMINDER);
        assertTrue(person.getEventsAttended().contains(event));
       
    }
View Full Code Here

    public void testRemoveAttendance() {
        System.out.println("removeAttendance");
       
        Event event = ctrl.read(TEST_ID_NO_REMINDER);

        Person person = new Person();
        person.setIdContact(TEST_ID_NO_REMINDER);
        person.setFirstName(getName());
        person.setLastName(getName());
        person = contactCtrl.update(person);
        person.getEventsAttended().add(event);
        person = contactCtrl.update(person);
       
        event.getContactsAttended().add(person);
        event = ctrl.update(event);
       
        ctrl.removeAttendance(person, event);
       
        event = ctrl.read(TEST_ID_NO_REMINDER);
        assertFalse(event.getContactsAttended().contains(person));
        person = contactCtrl.read(TEST_ID_NO_REMINDER);
        assertFalse(person.getEventsAttended().contains(event));
    }
View Full Code Here

    public void testAddOrganizer() {
        System.out.println("addOrganizer");
       
        Event event = ctrl.read(TEST_ID_NO_REMINDER);

        Person person = new Person();
        person.setIdContact(TEST_ID_NO_REMINDER);
        person.setFirstName(getName());
        person.setLastName(getName());
        person = contactCtrl.update(person);
        person.getOrganize().add(event);
        person = contactCtrl.update(person);
       
        ctrl.addOrganizer(person, event);
        event = ctrl.read(TEST_ID_NO_REMINDER);
        assertTrue(event.getOrganizedBy().contains(person));
        person = contactCtrl.read(TEST_ID_NO_REMINDER);
        assertTrue(person.getOrganize().contains(event));
    }
View Full Code Here

    public void testRemoveOrganizer() {
        System.out.println("removeOrganizer");
       
        Event event = ctrl.read(TEST_ID_NO_REMINDER);

        Person person = new Person();
        person.setIdContact(TEST_ID_NO_REMINDER);
        person.setFirstName(getName());
        person.setLastName(getName());
        person = contactCtrl.update(person);
        person.getOrganize().add(event);
        person = contactCtrl.update(person);
       
        event.getOrganizedBy().add(person);
        event = ctrl.update(event);
       
        ctrl.removeOrganizer(person, event);
       
        event = ctrl.read(TEST_ID_NO_REMINDER);
        assertFalse(event.getOrganizedBy().contains(person));
        person = contactCtrl.read(TEST_ID_NO_REMINDER);
        assertFalse(person.getOrganize().contains(event));
    }
View Full Code Here

    /**
     * Creates a new instance of PersonDataProvider
     */
    public PersonDataProvider() {
        // Put in dummy data for design time
        aList.add(new Person());
       
        // Wrap the list
        setList(aList);
    }
View Full Code Here

TOP

Related Classes of org.spw.model.Person

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.