use of org.mifos.dto.domain.ReportCategoryDto in project head by mifos.
the class ReportsCategoryDeleteController method showEmptyForm.
@RequestMapping(method = RequestMethod.GET)
@ModelAttribute("reportCategory")
public ReportCategoryFormBean showEmptyForm(@RequestParam(value = "categoryId", required = true) Integer reportCategoryId) {
ReportCategoryDto reportCategoryDetails = adminServiceFacade.retrieveReportCategory(reportCategoryId);
ReportCategoryFormBean bean = new ReportCategoryFormBean();
bean.setName(reportCategoryDetails.getName());
return bean;
}
use of org.mifos.dto.domain.ReportCategoryDto in project head by mifos.
the class ReportsCategoryEditController method showEmptyForm.
@RequestMapping(method = RequestMethod.GET)
@ModelAttribute("reportCategory")
public ReportCategoryFormBean showEmptyForm(@RequestParam(value = "categoryId", required = true) Integer reportCategoryId) {
ReportCategoryDto reportCategoryDetails = adminServiceFacade.retrieveReportCategory(reportCategoryId);
ReportCategoryFormBean bean = new ReportCategoryFormBean();
bean.setName(reportCategoryDetails.getName());
return bean;
}
use of org.mifos.dto.domain.ReportCategoryDto in project head by mifos.
the class AdminServiceFacadeWebTier method retrieveReportCategories.
@Override
public List<ReportCategoryDto> retrieveReportCategories() {
List<ReportCategoryDto> reportCategories = new ArrayList<ReportCategoryDto>();
List<ReportsCategoryBO> allCategories = new ReportsPersistence().getAllReportCategories();
for (ReportsCategoryBO category : allCategories) {
reportCategories.add(category.toDto());
}
return reportCategories;
}
use of org.mifos.dto.domain.ReportCategoryDto in project head by mifos.
the class ReportsCategoryPreviewController method processFormSubmit.
@RequestMapping(method = RequestMethod.POST)
public ModelAndView processFormSubmit(@RequestParam(value = CANCEL_PARAM, required = false) String cancel, @RequestParam(value = "EDIT", required = false) String edit, @RequestParam(value = "editFormView", required = true) String editFormView, @ModelAttribute("reportCategory") @Valid ReportCategoryFormBean reportCategoryFormBean, BindingResult result, SessionStatus status) {
ModelAndView modelAndView = new ModelAndView(REDIRECT_TO_LIST_OF_REPORT_CATEGORIES);
if (StringUtils.isNotBlank(cancel)) {
modelAndView.setViewName(REDIRECT_TO_LIST_OF_REPORT_CATEGORIES);
status.setComplete();
} else if (StringUtils.isNotBlank(edit)) {
modelAndView.setViewName(editFormView);
} else if (result.hasErrors()) {
modelAndView.setViewName("defineReportCategory");
modelAndView.addObject("reportCategory", reportCategoryFormBean);
} else {
// if (editFormView.equals("editReportCategory")) {
// ReportCategoryDto reportCategory = new ReportCategoryDto(null, reportCategoryFormBean.getName());
// adminServiceFacade.updateReportCategory(reportCategory);
// } else {
ReportCategoryDto reportCategory = new ReportCategoryDto(null, reportCategoryFormBean.getName());
adminServiceFacade.createReportsCategory(reportCategory);
// }
}
return modelAndView;
}
Aggregations