public ActionForward createBlackListed( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException { ActionForward fwd = init(mapping, form, request, response); if (fwd != null) return fwd; Properties ctx = TmkJSPEnv.getCtx(request); DefaultForm df = (DefaultForm) form; BlackListedBean bean = (BlackListedBean) df.getBean(); Trx trx = Trx.get(TrxPrefix.getPrefix(), true); try { trx.start(); BlackListedManager.createBlackListed(ctx, bean, trx.getTrxName()); trx.commit(); } catch (OperationException ex) { trx.rollback(); throw ex; } finally { trx.close(); } request.setAttribute(Constants.BLACKLISTED_DETAILS, bean); return mapping.findForward(CREATE_BLACKLISTED); }
public ActionForward editCheque( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException { ActionForward fwd = init(mapping, form, request, response); if (fwd != null) return fwd; Properties ctx = TmkJSPEnv.getCtx(request); BlackListForm f = (BlackListForm) form; BlackListedBean bean = (BlackListedBean) f.getBean(); Integer blacklistedID = bean.getBlackListedId(); if (blacklistedID == null) { throw new OperationException( "Cannot load Cheque details. Cause BlacklistedId cannot be null!"); } Trx trx = Trx.get(TrxPrefix.getPrefix(), true); trx.start(); try { BlackListedManager.editBlackListed(ctx, bean, trx.getTrxName()); trx.commit(); } catch (OperationException ex) { trx.rollback(); throw ex; } finally { trx.close(); } request.getSession().setAttribute(Constants.BLACKLISTED_DETAILS, bean); return mapping.findForward(EDIT_CHEQUE); }
public ActionForward initEditCheque( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException { ActionForward fwd = init(mapping, form, request, response); if (fwd != null) return fwd; Properties ctx = TmkJSPEnv.getCtx(request); BlackListForm f = (BlackListForm) form; f.validate(mapping, request); BlackListedBean bean = (BlackListedBean) f.getBean(); Integer blacklistedID = bean.getBlackListedId(); if (blacklistedID == null) { throw new OperationException("Cannot edit Cheques. Cause BlacklistedID id cannot be null!"); } bean = BlackListedManager.getBlackListedDetails(ctx, blacklistedID); f.populate(bean); return mapping.findForward(INIT_EDIT_CHEQUE); }
public ActionForward getAllBlackListed( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException { ActionForward fwd = init(mapping, form, request, response); if (fwd != null) return fwd; Properties ctx = TmkJSPEnv.getCtx(request); ArrayList<BlackListedBean> blackListedList = BlackListedManager.getAllBlackListed(ctx); request.getSession().setAttribute(Constants.BLACKLISTED_LISTS, blackListedList); return mapping.findForward(GET_ALL_BLACKLISTED); }
public ActionForward searchCheque( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException { ActionForward fwd = init(mapping, form, request, response); if (fwd != null) return fwd; Properties ctx = TmkJSPEnv.getCtx(request); DefaultForm df = (DefaultForm) form; // BlackListedBean bean = (BlackListedBean)df.getBean(); ArrayList Blacklist = BlackListedManager.searchChequeNo(ctx, df.getChequeNo()); request.getSession().setAttribute(Constants.BLACKLISTED_LISTS, Blacklist); return mapping.findForward(SEARCH_CHEQUE); }
public ActionForward deactivateCheque( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException { ActionForward fwd = init(mapping, form, request, response); if (fwd != null) return fwd; Properties ctx = TmkJSPEnv.getCtx(request); BlackListForm f = (BlackListForm) form; f.validate(mapping, request); BlackListedBean bean = (BlackListedBean) f.getBean(); Integer blackListedId = bean.getBlackListedId(); if (blackListedId == null) { throw new OperationException( "Cannot deactivate Blacklisted Cheques. Cause BlackListed id cannot be null!"); } Trx trx = Trx.get(TrxPrefix.getPrefix(), true); try { trx.start(); BlackListedManager.deactivateBListedCheque(ctx, blackListedId.intValue(), trx.getTrxName()); trx.commit(); } catch (OperationException e) { trx.rollback(); postGlobalError("error.deactivate.customer", request); mapping.getInputForward(); } finally { trx.close(); } return mapping.findForward(DEACTIVATE_CHEQUE); }