Package org.libreplan.business.costcategories.entities

Examples of org.libreplan.business.costcategories.entities.ResourcesCostCategoryAssignment


        resourceCostCategoryAssignments.addAll(resource.getResourcesCostCategoryAssignments());
    }

    @Override
    public void addCostCategory() {
        ResourcesCostCategoryAssignment assignment = ResourcesCostCategoryAssignment
                .create();
        resource.addResourcesCostCategoryAssignment(assignment);

        // set the autogenerated code
        this.currentAssignment = assignment;
View Full Code Here


        resourcesCostCategoryAssignments) {

        for (ResourcesCostCategoryAssignmentDTO assignmentDTO :
            resourcesCostCategoryAssignments) {

            ResourcesCostCategoryAssignment assignment = toEntity(assignmentDTO,
                resource);
            resource.addUnvalidatedResourcesCostCategoryAssignment(assignment);

        }
View Full Code Here

        for (ResourcesCostCategoryAssignmentDTO i :
            resourcesCostCategoryAssignments) {

            try {

                ResourcesCostCategoryAssignment assignment =
                    resource.getResourcesCostCategoryAssignmentByCode(i.code);
                updateResourcesCostCategoryAssignment(assignment, i);

            } catch (InstanceNotFoundException e) {

                ResourcesCostCategoryAssignment assignment =
                    toEntity(i, resource);

                resource.addUnvalidatedResourcesCostCategoryAssignment(
                    assignment);
View Full Code Here

    private void givenResource(boolean relatedWithCostCategory) {
        resource = Worker.createUnvalidated("default-resource" + UUID.randomUUID(),
                "default-resource", "default-resource", "default-resource");

        if (relatedWithCostCategory) {
            ResourcesCostCategoryAssignment resourcesCostCategoryAssignment = ResourcesCostCategoryAssignment
                    .create();
            resourcesCostCategoryAssignment.setCode("resources-cost-category-assignment"
                    + UUID.randomUUID());
            resourcesCostCategoryAssignment.setCostCategory(costCategory);
            resourcesCostCategoryAssignment.setInitDate(new LocalDate());

            resource.addResourcesCostCategoryAssignment(resourcesCostCategoryAssignment);
        }
        resourceDAO.save(resource);
    }
View Full Code Here

    implements IResourcesCostCategoryAssignmentDAO {

    @Override
    public void remove(Long id) throws InstanceNotFoundException {
        try {
            ResourcesCostCategoryAssignment assignment = find(id);
            assignment.getResource().removeResourcesCostCategoryAssignment(assignment);
        }
        catch(InstanceNotFoundException e) {
            //it was already deleted from its parent
            //we do nothing
        }
View Full Code Here

     */
    public class CostCategoryAssignmentRenderer implements RowRenderer {

        @Override
        public void render(Row row, Object data) {
            ResourcesCostCategoryAssignment assignment =
                (ResourcesCostCategoryAssignment) data;

            row.setValue(assignment);

            // Create boxes
View Full Code Here

        resourcesCostCategoryAssignmentModel.removeCostCategoryAssignment(assignment);
        Util.reloadBindings(listResourcesCostCategoryAssignments);
    }

    private CostCategory getCostCategory(Row listitem) {
        ResourcesCostCategoryAssignment assignment =
            (ResourcesCostCategoryAssignment) listitem.getValue();
        return assignment.getCostCategory();
    }
View Full Code Here

            public void onEvent(Event event) {
                final Comboitem comboitem = autocomplete.getSelectedItem();

                if(comboitem != null) {
                    // Update resourcesCostCategoryAssignment
                    ResourcesCostCategoryAssignment assignment =
                        (ResourcesCostCategoryAssignment) row.getValue();
                    assignment.setCostCategory((CostCategory) comboitem.getValue());
                    row.setValue(assignment);
                }
            }
        });
        row.appendChild(autocomplete);
View Full Code Here

        CostCategory costCategory = createValidCostCategory();
        costCategoryDAO.save(costCategory);
        Worker worker = createValidWorker();
        workerDAO.save(worker);

        ResourcesCostCategoryAssignment assignment = ResourcesCostCategoryAssignment.create();
        assignment.setInitDate(new LocalDate());
        assignment.setCostCategory(costCategory);
        assignment.setResource(worker);
        return assignment;
    }
View Full Code Here

    }

    @Test
    @Transactional
    public void testSaveResourcesCostCategoryAssignment() {
        ResourcesCostCategoryAssignment assignment = createValidResourcesCostCategoryAssignment();
        resourcesCostCategoryAssignmentDAO.save(assignment);
        assertTrue(assignment.getId() != null);
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.costcategories.entities.ResourcesCostCategoryAssignment

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.