예제 #1
0
 @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;
 }
예제 #2
0
 @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;
 }
예제 #3
0
 public List<BreakedPart> getBrokenParts() {
   return breakedPartService.findAll();
 }