Search in sources :

Example 1 with ProductCategoryDetailsDto

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);
    }
}
Also used : ProductCategoryDetailsDto(org.mifos.dto.screen.ProductCategoryDetailsDto) ServiceException(org.mifos.framework.exceptions.ServiceException) ProductCategoryBO(org.mifos.accounts.productdefinition.business.ProductCategoryBO) ProductCategoryBusinessService(org.mifos.accounts.productdefinition.business.service.ProductCategoryBusinessService) MifosRuntimeException(org.mifos.core.MifosRuntimeException)

Example 2 with ProductCategoryDetailsDto

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;
}
Also used : ProductCategoryDetailsDto(org.mifos.dto.screen.ProductCategoryDetailsDto) ModelAndView(org.springframework.web.servlet.ModelAndView) ProductCategoryTypeDto(org.mifos.dto.screen.ProductCategoryTypeDto) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with ProductCategoryDetailsDto

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;
}
Also used : ProductCategoryDetailsDto(org.mifos.dto.screen.ProductCategoryDetailsDto) ModelAttribute(org.springframework.web.bind.annotation.ModelAttribute) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ProductCategoryDetailsDto (org.mifos.dto.screen.ProductCategoryDetailsDto)3 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 ProductCategoryBO (org.mifos.accounts.productdefinition.business.ProductCategoryBO)1 ProductCategoryBusinessService (org.mifos.accounts.productdefinition.business.service.ProductCategoryBusinessService)1 MifosRuntimeException (org.mifos.core.MifosRuntimeException)1 ProductCategoryTypeDto (org.mifos.dto.screen.ProductCategoryTypeDto)1 ServiceException (org.mifos.framework.exceptions.ServiceException)1 ModelAttribute (org.springframework.web.bind.annotation.ModelAttribute)1 ModelAndView (org.springframework.web.servlet.ModelAndView)1