@Action( value = "brokenPartChange", results = { @Result(name = "success", location = "/WEB-INF/content/ajax/customer/brokenPartChange.jsp") }) public String brokenPartChange() { if (breakedPartService.checkName(brokenPartStr)) { BreakedPart b = new BreakedPart(); b.setPartName(brokenPartStr); breakedPartService.save(b); session.put("brokenPartId", b.getId()); } else { session.put("brokenPartId", breakedPartService.getBreakedPart(brokenPartStr).getId()); } return SUCCESS; }
@SuppressWarnings("unchecked") @Action( value = "addDefect-ajax-edit", results = { @Result(name = "success", location = "/WEB-INF/content/ajax/customer/addfect-ajax-edit.jsp") }) public String addDefectEditAjax() { defectList = (List<Defect>) session.get("defectList"); Defect d = new Defect(); d.setBreakedPart(breakedPartService.get(Long.parseLong(brokenPartStr))); d.setCrashGrade(CrashGrade.get(crashGradeStr)); if (changePriceStr.trim().equals("")) { d.setChangePrice(0); } else { d.setChangePrice(Integer.parseInt(changePriceStr.replaceAll(" ", ""))); } if (repairPriceStr.trim().equals("")) { d.setRepairPrice(0); } else { d.setRepairPrice(Integer.parseInt(repairPriceStr.replaceAll(" ", ""))); } defectList.add(d); session.put("defectList", defectList); return SUCCESS; }
public List<BreakedPart> getBrokenParts() { return breakedPartService.findAll(); }