Beispiel #1
0
  /**
   * Update foreign key of attachment Info
   *
   * @param mapping ActionMapping
   * @param form ActionForm
   * @param request HttpServletRequest
   * @param response HttpServletResponse
   */
  public void updateForeignKey(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {
    try {
      String attacheId = request.getParameter("attachId");
      String foreignKey = request.getParameter("foreignKey");

      //			AttachedInfoBo aibo = new AttachedInfoBo();
      AttachedInfoForm aif = attachedInfoBo.find(attacheId);
      aif.setForeignId(new Long(foreignKey));
      HttpSession session = request.getSession();
      aif.setUpdateBy((Long) session.getAttribute("userId"));
      aif.setUpdateDate(
          new Timestamp(
              ((MultiDate) SpringContextUtil.getBean("multiDate")).getMultiDate().getTime()));
      String strXml = "false";
      if (attachedInfoBo.modify(aif) == 1) {
        strXml = "true";
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Beispiel #2
0
  /**
   * Modify attachemnt Info record
   *
   * @param request HttpServletRequest
   * @param form ActionForm Data form
   * @return Return modification page,forward = "attachedInfoAlert"
   */
  public String attachedInfoModify(HttpServletRequest request, ActionForm form) {
    String forward = "attachedInfoAlert";
    int tag = -1;
    try {
      //				AttachedInfoBo ubo = new AttachedInfoBo();
      AttachedInfoForm attachedInfoForm = (AttachedInfoForm) form;

      attachedInfoForm.setUpdateBy(new Long(0));
      attachedInfoForm.setUpdateDate(
          new Timestamp(
              ((MultiDate) SpringContextUtil.getBean("multiDate")).getMultiDate().getTime()));

      tag = attachedInfoBo.modify(attachedInfoForm);
      request.setAttribute("attachedInfoForm", attachedInfoForm);
      request.setAttribute("state", "modify");
      request.setAttribute("tag", tag + "");
    } catch (Exception e) {
      e.printStackTrace();
    }
    return forward;
  }
Beispiel #3
0
  /**
   * Add attachment Info record
   *
   * @param request HttpServletRequest
   * @param form ActionForm Data form
   * @return String Return attachment Info list,forward = "attachedInfoAlert"
   */
  public String attachedInfoAdd(HttpServletRequest request, ActionForm form) {
    String forward = "attachedInfoAlert";
    int tag = -1;

    try {
      AttachedInfoForm uf = (AttachedInfoForm) form;
      //				AttachedInfoBo ubo = new AttachedInfoBo();

      uf.setCreateBy(new Long(0));
      uf.setCreateDate(
          new Timestamp(
              ((MultiDate) SpringContextUtil.getBean("multiDate")).getMultiDate().getTime()));

      tag = attachedInfoBo.add(uf);
      request.setAttribute("tag", tag + "");
      request.setAttribute("state", "add");

    } catch (Exception e) {
      e.printStackTrace();
    }
    return forward;
  }