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);
}
}
Aggregations