Package org.spw.model

Examples of org.spw.model.Program


public class ProgramDataProvider extends ObjectListDataProvider {
    private ArrayList<Program> aList = new ArrayList<Program>();
    /** Creates a new instance of ProgramDataProvider */
    public ProgramDataProvider() {
        // Put in dummy data for design time
        aList.add(new Program());

        // Wrap the list
        setList(aList);       
    }
View Full Code Here


        assertNotNull(resultApplication);
        assertNotNull(resultApplication.getVolunteer());
        assertEquals(volunteer.getIdContact(), resultApplication.getVolunteer().getIdContact());
        assertEquals("Potential", resultApplication.getVolunteer().getTypeVolunteer());

        Program resultProgram = programCtrl.read(anyProgram.getIdProgram());
        ArrayList<VolunteerApplication> applications =
                new ArrayList<VolunteerApplication>(resultProgram.getApplications());
        assertTrue("Cannot find the application in the program", applications.contains(application));
        assertEquals("The number of application should have increased", nbApplications1 + 1, applications.size());
    }
View Full Code Here

       
        VolunteerApplication application = new VolunteerApplication();
        List<Program> programs = programCtrl.getPrograms();
        assertFalse("No programs, must have at leat one for this test.",
                programs.size() == 0);
        Program program = programs.get(0);
        application.setProgram(program);
        application.setAcceptanceFeeReceived(new Date());
        volunteer.setApplication(application);
       
        for (int i=1; i < 5; i++) {
View Full Code Here

        vo.setYearApplyingFor(1900);
        vo.setTypeVolunteer("Accepted");
        vo.setGrade("PG");
        vo = vCtrl.update(vo);
       
        Program prg = new Program();
        prg.setProgram(getName());
        Calendar cal = Calendar.getInstance();
        cal.clear();
        cal.set(1900,5,1);
        prg.setStartDate(cal.getTime());
        prg.setNumberVolunteer(12);
        prg.setProgramAcronym("TEST");
        prg = prgCtrl.update(prg);

        VolunteerApplication va = new VolunteerApplication();
        va.setAcceptanceFeeReceived(new Date());
        va.setAcceptanceLettersSent(new Date());
View Full Code Here

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

        vo.setLastName(getName());
        vo.setYearApplyingFor(1900);
        vo.setTypeVolunteer("Accepted");
        vo = vCtrl.update(vo);
       
        Program prg = new Program();
        prg.setIdProgram(TEST_ID);
        prg.setProgram(getName());
        Calendar cal = Calendar.getInstance();
        cal.clear();
        cal.set(1900,5,1);
        prg.setStartDate(cal.getTime());
        prg.setNumberVolunteer(12);
        prg.setProgramAcronym("TEST");
        prg = prgCtrl.update(prg);
       
        VolunteerApplication va = new VolunteerApplication();
        va.setIdApplication(TEST_ID);
        va.setAcceptanceFeeReceived(new Date());
View Full Code Here

        }
    }
   
    public Program read(Long key) {
        EntityManager em = emf.createEntityManager();
        Program retValue = null;
        try {
            retValue = em.find(Program.class, key);
        } catch (Exception e) {
            Logger.getLogger(ProgramController.class.getName()).log(Level.SEVERE, "Error reading " + key, e);
            if (em.getTransaction().isActive())
View Full Code Here

        }
        return retValue;
    }
   
    public Program update(Program object) {
        Program result = null;
        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        try {
            result = em.merge(object);
            em.getTransaction().commit();
View Full Code Here

   
    public void delete(Program object) {
        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        try {
            Program entity = em.find(Program.class, object.getIdProgram());
            em.remove(entity);
            em.getTransaction().commit();
        } catch (Exception e) {
            Logger.getLogger(ProgramController.class.getName()).log(Level.SEVERE, "Error deleting " + object, e);
            if (em.getTransaction().isActive())
View Full Code Here

    }
   
    public String buttonValidate_action() {
        VolunteerApplication application = getVolunteerApplication();
        Volunteer volunteer = getVolunteer();
        Program previousProgram = getProgram();
        persist(volunteer, application, previousProgram);
       
        return "success";
    }
View Full Code Here

TOP

Related Classes of org.spw.model.Program

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.