/** * 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(); } }
/** * 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; }