Search in sources :

Example 1 with ProductCategoryDto

use of org.mifos.dto.screen.ProductCategoryDto in project head by mifos.

the class AdminServiceFacadeWebTier method retrieveAllProductCategories.

@Override
public ProductCategoryDisplayDto retrieveAllProductCategories() {
    try {
        List<ProductCategoryBO> productCategoryList = new ProductCategoryBusinessService().getAllCategories();
        List<ProductCategoryTypeDto> pcTypeList = new ArrayList<ProductCategoryTypeDto>();
        List<ProductCategoryDto> pcList = new ArrayList<ProductCategoryDto>();
        for (ProductCategoryBO pcBO : productCategoryList) {
            ProductCategoryTypeDto pcTypeDto = new ProductCategoryTypeDto(pcBO.getProductType().getProductTypeID(), pcBO.getProductType().getLookUpValue().getLookUpName());
            pcTypeList.add(pcTypeDto);
            ProductCategoryDto pcDto = new ProductCategoryDto(pcBO.getProductCategoryName(), pcBO.getPrdCategoryStatus().getId(), pcBO.getGlobalPrdCategoryNum());
            pcList.add(pcDto);
        }
        ProductCategoryDisplayDto productCategoryDisplayDto = new ProductCategoryDisplayDto(pcTypeList, pcList);
        return productCategoryDisplayDto;
    } catch (ServiceException e) {
        throw new MifosRuntimeException(e);
    }
}
Also used : ProductCategoryDisplayDto(org.mifos.dto.screen.ProductCategoryDisplayDto) ServiceException(org.mifos.framework.exceptions.ServiceException) ProductCategoryBO(org.mifos.accounts.productdefinition.business.ProductCategoryBO) ArrayList(java.util.ArrayList) ProductCategoryDto(org.mifos.dto.screen.ProductCategoryDto) ProductCategoryTypeDto(org.mifos.dto.screen.ProductCategoryTypeDto) ProductCategoryBusinessService(org.mifos.accounts.productdefinition.business.service.ProductCategoryBusinessService) MifosRuntimeException(org.mifos.core.MifosRuntimeException)

Aggregations

ArrayList (java.util.ArrayList)1 ProductCategoryBO (org.mifos.accounts.productdefinition.business.ProductCategoryBO)1 ProductCategoryBusinessService (org.mifos.accounts.productdefinition.business.service.ProductCategoryBusinessService)1 MifosRuntimeException (org.mifos.core.MifosRuntimeException)1 ProductCategoryDisplayDto (org.mifos.dto.screen.ProductCategoryDisplayDto)1 ProductCategoryDto (org.mifos.dto.screen.ProductCategoryDto)1 ProductCategoryTypeDto (org.mifos.dto.screen.ProductCategoryTypeDto)1 ServiceException (org.mifos.framework.exceptions.ServiceException)1