Esempio n. 1
0
  /**
   * Display attachment Info add page
   *
   * @param request HttpServletRequest
   * @param form ActionForm Data form
   * @return String Return attachment Info page,forward = "AttachedInfoEdit"
   */
  public String addInit(HttpServletRequest request, ActionForm form) {
    String forward = "addInit";
    try {

      DepartmentForm departmentForm = new DepartmentForm();
      DepartmentQuery departmentQuery = new DepartmentQuery(departmentForm);
      request.setAttribute(
          "allDepartments",
          departmentQuery.doListQuery(departmentForm.getFromPage(), departmentForm.getToPage()));

      AttachedInfoForm attachedInfoForm = new AttachedInfoForm();
      request.setAttribute("attachedInfoForm", attachedInfoForm);
      request.setAttribute("state", "attachedInfoAdd");
    } catch (Exception e) {
      e.printStackTrace();
    }

    return forward;
  }
Esempio n. 2
0
  /**
   * Modify attachment Info
   *
   * @param request HttpServletRequest
   * @param form ActionForm Data form
   * @return String Return addition page,forward = "AttachedInfoEdit"
   */
  public String modifyInit(HttpServletRequest request, ActionForm form) {
    String forward = "addInit";
    try {

      String chkId = (String) request.getParameter("id");
      chkId = chkId.trim();

      DepartmentForm departmentForm = new DepartmentForm();
      DepartmentQuery departmentQuery = new DepartmentQuery(departmentForm);
      request.setAttribute(
          "allDepartments",
          departmentQuery.doListQuery(departmentForm.getFromPage(), departmentForm.getToPage()));
      if (chkId != null && !chkId.equals("")) {
        //			AttachedInfoBo bo = new AttachedInfoBo();
        request.setAttribute("attachedInfoForm", attachedInfoBo.find(chkId));
      }

    } catch (Exception e) {
      e.printStackTrace();
    }
    request.setAttribute("state", "modify");
    return forward;
  }