Example #1
0
 /**
  * Return part modification initial page
  *
  * @param request HttpServletRequest
  * @param form ActionForm
  * @return String Return modification page, forward = "addInit"
  */
 public String modifyInit(HttpServletRequest request, ActionForm form) {
   String forward = "addInit";
   ArrayList locationList = new ArrayList();
   try {
     Long chkId = new Long(request.getParameter("id").trim());
     //			ReturnPartBo bo = new ReturnPartBo();
     locationList = returnPartBo1.locationList();
     request.setAttribute("ReturnPartForm", returnPartBo1.find(chkId));
     request.setAttribute("locationList", locationList);
   } catch (Exception e) {
     e.printStackTrace();
   }
   request.setAttribute("state", "modify");
   return forward;
 }
Example #2
0
  /**
   * Modify return part record
   *
   * @param request HttpServletRequest
   * @param form ActionForm
   * @return String Return result message page, forward = "alert"
   */
  public String returnPartModify(HttpServletRequest request, ActionForm form) {
    String forward = "alert";
    int tag = -1;
    String flag = "";
    try {
      ReturnPartForm rf = (ReturnPartForm) form;
      /*
       * 折扣率添加的判断
       */
      /*if(rf.getDiscountRate().equals(new Double(0))){
      	rf.setDiscountRate(null);
      }*/
      //			ReturnPartBo rb=new ReturnPartBo();

      Long returnPartId = rf.getReturnPartId();
      ReturnPartForm rpf = (ReturnPartForm) returnPartBo1.find(returnPartId);

      rf.setCreateBy(rpf.getCreateBy());
      rf.setCreateDate(rpf.getCreateDate());
      rf.setUpdateBy((Long) request.getSession().getAttribute("userId"));
      rf.setUpdateDate(
          new Timestamp(
              ((MultiDate) SpringContextUtil.getBean("multiDate")).getMultiDate().getTime()));
      tag = returnPartBo1.modify(rf);
      if (tag == 1) {
        flag = "returnPartModifySucc";

      } else {
        flag = "returnPartModifyError";
      }
      request.setAttribute("businessFlag", flag);
      request.setAttribute("state", "modify");
      request.setAttribute("tag", tag + "");
    } catch (Exception e) {
      e.printStackTrace();
    }
    return forward;
  }