Package org.spw.model

Examples of org.spw.model.Contribution


        assertNull(checkContribution(contribution.getIdContribution()));
    }
   
    private Contribution checkContribution(Long id) {
        EntityManager em = emf.createEntityManager();
        Contribution contribution = em.find(Contribution.class, id);
        em.close();
        return contribution;
    }
View Full Code Here


    public void testAddContribution() {
        System.out.println("addContribution");
       
        VolunteerApplicationController instance = new VolunteerApplicationController();
        VolunteerApplication object = instance.read(TEST_ID);
        Contribution contribution = new Contribution();
        contribution.setReference(getName());
       
        VolunteerApplication result = instance.addContribution(object, contribution);
        assertEquals(1, result.getContributions().size());
        Long id = result.getContributions().get(0).getIdContribution();
       
        //refresh
        object = instance.read(TEST_ID);
        assertEquals(1, object.getContributions().size());
       
        contribution = checkContribution(id);
        assertEquals(getName(), contribution.getReference());
    }
View Full Code Here

    public void testRemoveContribution() {
        System.out.println("removeContribution");
       
        VolunteerApplicationController instance = new VolunteerApplicationController();
        VolunteerApplication object = instance.read(TEST_ID);
        Contribution contribution = new Contribution();
        contribution.setReference(getName());
       
        VolunteerApplication result = instance.addContribution(object, contribution);
        assertEquals(1, result.getContributions().size());
        Long id = result.getContributions().get(0).getIdContribution();
       
View Full Code Here

    protected RequestBean1 getRequestBean1() {
        return (RequestBean1)getBean("RequestBean1");
    }
   
    public String buttonAdd_action() {
        getSessionBean1().setContribution(new Contribution());
       
        return "new";
    }
View Full Code Here

    }
   
    public String buttonEdit_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Contribution contribution = (Contribution)dataProvider.getObject(rk);
            getSessionBean1().setContribution(contribution);
        }
       
        return "edit";
    }
View Full Code Here

    public String buttonDelete_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            VolunteerApplicationController ctrl = new VolunteerApplicationController();
            VolunteerApplication application = dataProvider.getApplication();
            Contribution contribution = (Contribution)dataProvider.getObject(rk);
            application.removeContribution(contribution);
           
            ctrl.removeContribution(application, contribution);
            dataProvider.refreshList();
        }
View Full Code Here

    private VolunteerApplication application;
   
    /** Creates a new instance of ContributionDataProvider */
    public ContributionDataProvider() {
        List<Contribution> contributions = new ArrayList<Contribution>();
        contributions.add(new Contribution());
       
        setList(contributions);
    }
View Full Code Here

        application.setProgram(programCtrl.getPrograms().get(0));
        application.setAcceptanceFeeReceived(new Date());
        volunteer.setApplication(application);
       
        for (int i=1; i < 5; i++) {
            Contribution contrib = new Contribution();
            contrib.setApplication(application);
            contrib.setContributionAmount(new BigDecimal(i));
            contrib.setContributionValue(new BigDecimal(i*8));
            contrib.setCurrency("TST");
            contrib.setDateContribution(new Date());
            if ((i%3) == 0)
                contrib.setGiftAidable(true);
            contrib.setIdContribution(new Long(i));
            if (i == 1)
                contrib.setInitialFee(true);
            if (i < 3 )
                contrib.setMeansOfPayment("Cheque");
            else
                contrib.setMeansOfPayment("JustGiving");
            contrib.setPayer(getName());
            contrib.setReference(Integer.toString(i));
            application.addContribution(contrib);
        }
       
        VolunteerDetailsFundraisingXmlReport instance =
                new VolunteerDetailsFundraisingXmlReport(volunteer);
View Full Code Here

TOP

Related Classes of org.spw.model.Contribution

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.