Esempio n. 1
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;
 }
Esempio n. 2
0
 public CrashGrade[] getCrashGrades() {
   return CrashGrade.values();
 }