/** * Return part addition initial page * * @param request HttpServletRequest * @param form ActionForm * @return String Return addition page,forward = "addInit" */ public String addInit(HttpServletRequest request, ActionForm form) { String forward = "addInit"; ArrayList locationList = new ArrayList(); try { ReturnPartForm returnPartForm = new ReturnPartForm(); // ReturnPartBo bo = new ReturnPartBo(); locationList = returnPartBo1.locationList(); request.setAttribute("ReturnPartForm", returnPartForm); request.setAttribute("locationList", locationList); request.setAttribute("state", "Add"); } catch (Exception e) { e.printStackTrace(); } return forward; }
/** * 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; }
/** * Query return part mapping form * * @param request HttpServletRequest * @param form ActionForm * @return String Return query result page, forward ="list" */ public String list(HttpServletRequest request, ActionForm form) { String forward = "list"; ArrayList returnPartList = new ArrayList(); ArrayList locationList = new ArrayList(); // ReturnPartBo rb=new ReturnPartBo(); try { ReturnPartForm rf = (ReturnPartForm) form; /* * 折扣率的查询转换 */ /*if(rf.getDiscountRateSub()!=null&&!rf.getDiscountRateSub().equals("")){ rf.setDiscountRate(new Double(rf.getDiscountRateSub())); }*/ returnPartList = returnPartBo1.list(rf); locationList = returnPartBo1.locationList(); request.setAttribute("partList", returnPartList); request.setAttribute("locationList", locationList); } catch (Exception e) { e.printStackTrace(); } return forward; }