use of org.mifos.dto.screen.ProductCategoryDisplayDto 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);
}
}
use of org.mifos.dto.screen.ProductCategoryDisplayDto in project head by mifos.
the class ViewProductCategoriesController method showProductCategories.
@RequestMapping(method = RequestMethod.GET)
public ModelAndView showProductCategories() {
ModelAndView modelAndView = new ModelAndView("viewProductCategories");
ProductCategoryDisplayDto dto = adminServiceFacade.retrieveAllProductCategories();
modelAndView.addObject("dto", dto);
modelAndView.addObject("breadcrumbs", new AdminBreadcrumbBuilder().withLink("admin.viewproductcategories", "viewProductCategories.ftl").build());
return modelAndView;
}
Aggregations