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 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);
  }