use of org.mifos.dto.screen.ProductCategoryDetailsDto in project head by mifos.
the class AdminServiceFacadeWebTier method retrieveProductCateogry.
@Override
public ProductCategoryDetailsDto retrieveProductCateogry(String globalProductCategoryNumber) {
ProductCategoryBusinessService service = new ProductCategoryBusinessService();
try {
ProductCategoryBO pcBO = service.findByGlobalNum(globalProductCategoryNumber);
String productTypeName = service.getProductType(pcBO.getProductType().getProductTypeID()).getLookUpValue().getLookUpName();
ProductCategoryDetailsDto productCategoryDetailsDto = new ProductCategoryDetailsDto(pcBO.getProductCategoryName(), pcBO.getPrdCategoryStatus().getId(), pcBO.getProductType().getProductTypeID(), pcBO.getProductCategoryDesc(), productTypeName);
return productCategoryDetailsDto;
} catch (ServiceException e) {
throw new MifosRuntimeException(e);
}
}
use of org.mifos.dto.screen.ProductCategoryDetailsDto in project head by mifos.
the class ViewProductCategoryDetailsController method handleRequestInternal.
@RequestMapping(method = RequestMethod.GET)
public ModelAndView handleRequestInternal(@RequestParam(value = "globalPrdCategoryNum", required = true) String globalPrdCategoryNum) {
ModelAndView modelAndView = new ModelAndView("viewProductCategoryDetails");
List<ProductCategoryTypeDto> typeDto = adminServiceFacade.retrieveProductCategoryTypes();
ProductCategoryDetailsDto detailsDto = adminServiceFacade.retrieveProductCateogry(globalPrdCategoryNum);
modelAndView.addObject("typeDto", typeDto);
modelAndView.addObject("detailsDto", detailsDto);
modelAndView.addObject("breadcrumbs", new AdminBreadcrumbBuilder().withLink("viewProductCategoryDetails", "viewProductCategoryDetails.ftl").build());
modelAndView.addObject("globalPrdCategoryNum", globalPrdCategoryNum);
return modelAndView;
}
use of org.mifos.dto.screen.ProductCategoryDetailsDto in project head by mifos.
the class EditProductCategoryController method showCategory.
@RequestMapping(method = RequestMethod.GET)
@ModelAttribute("formBean")
public ProductCategoryFormBean showCategory(@RequestParam(value = "globalPrdCategoryNum", required = true) String globalPrdCategoryNum) {
ProductCategoryDetailsDto productCategoryDetailsDto = adminServiceFacade.retrieveProductCateogry(globalPrdCategoryNum);
ProductCategoryFormBean productCategoryFormBean = new ProductCategoryFormBean();
productCategoryFormBean.setGlobalPrdCategoryNum(globalPrdCategoryNum);
productCategoryFormBean.setProductCategoryDesc(productCategoryDetailsDto.getProductCategoryDesc());
productCategoryFormBean.setProductCategoryName(productCategoryDetailsDto.getProductCategoryName());
productCategoryFormBean.setProductCategoryStatusId(productCategoryDetailsDto.getProductCategoryStatusId().toString());
productCategoryFormBean.setProductType(productCategoryDetailsDto.getProductTypeName());
productCategoryFormBean.setProductTypeId(productCategoryDetailsDto.getProductTypeId().toString());
return productCategoryFormBean;
}
Aggregations