use of org.mifos.accounts.fund.servicefacade.FundCodeDto in project head by mifos.
the class LoanAccountServiceFacadeWebTier method translateFundCodeToDto.
private FundCodeDto translateFundCodeToDto(FundCodeEntity fundCode) {
FundCodeDto fundCodeDto = new FundCodeDto();
fundCodeDto.setId(Short.toString(fundCode.getFundCodeId()));
fundCodeDto.setValue(fundCode.getFundCodeValue());
return fundCodeDto;
}
use of org.mifos.accounts.fund.servicefacade.FundCodeDto in project head by mifos.
the class NewFundPreviewController method processFormSubmit.
@RequestMapping(method = RequestMethod.POST)
public ModelAndView processFormSubmit(@RequestParam(value = EDIT_PARAM, required = false) String edit, @RequestParam(value = CANCEL_PARAM, required = false) String cancel, @ModelAttribute("formBean") FundFormBean formBean, BindingResult result, SessionStatus status) {
ModelAndView mav = new ModelAndView(REDIRECT_TO_ADMIN_SCREEN);
if (StringUtils.isNotBlank(edit)) {
mav = new ModelAndView("editFunds");
mav.addObject("formBean", formBean);
mav.addObject("previewView", "newFundPreview");
} else if (StringUtils.isNotBlank(cancel)) {
mav = new ModelAndView(REDIRECT_TO_VIEW_FUNDS);
status.setComplete();
} else if (result.hasErrors()) {
mav = new ModelAndView("newFundPreview");
} else {
FundCodeDto codeDto = new FundCodeDto();
codeDto.setId(formBean.getCodeId());
codeDto.setValue(formBean.getCodeValue());
FundDto fundDto = new FundDto();
fundDto.setCode(codeDto);
fundDto.setId(formBean.getId());
fundDto.setName(formBean.getName());
try {
this.fundServiceFacade.createFund(fundDto);
status.setComplete();
} catch (BusinessRuleException e) {
ObjectError error = new ObjectError("formBean", new String[] { e.getMessageKey() }, new Object[] {}, "default: ");
result.addError(error);
mav.setViewName("newFundPreview");
mav.addObject("formBean", formBean);
}
}
return mav;
}
use of org.mifos.accounts.fund.servicefacade.FundCodeDto in project head by mifos.
the class DefineNewFundController method retrieveFundCodeOptionMap.
private Map<String, String> retrieveFundCodeOptionMap() {
List<FundCodeDto> codeList = this.fundServiceFacade.getFundCodes();
Map<String, String> codeMap = new LinkedHashMap<String, String>();
for (FundCodeDto fundCode : codeList) {
codeMap.put(fundCode.getId(), fundCode.getValue());
}
return codeMap;
}
Aggregations