public String addproduct() throws Exception { // link to add.jsp
   initServlet();
   try {
     if (clothesProduct != null) clothesProduct = null; // 清空舊資料
     clothesChecks = clothesCheckService.getAllClothesCheck();
     resultPage = "shopedit";
   } catch (Exception e) {
     e.printStackTrace();
   }
   return resultPage;
 }
 public String productSave() throws Exception { // add new product information
   initServlet();
   try {
     ClothesCheck model = clothesCheckService.getClothesCheckById(Integer.valueOf(checkid));
     clothesProduct.setClothesCheck(model);
     clothesProductService.saveClothesProduct(clothesProduct);
     message = " 商品: [ " + clothesProduct.getProductName() + " ] 新增成功! ";
     if (clothesProduct != null) clothesProduct = null;
   } catch (Exception e) {
     e.printStackTrace();
   }
   return productList();
 }
  public String modifyProduct() throws Exception { // modify information
    initServlet();
    try {
      clothesProducts = clothesProductService.getAllClothesProduct();
      ClothesCheck check = clothesCheckService.getClothesCheckById(Integer.valueOf(checkid));
      clothesProduct.setClothesCheck(check);
      clothesProductService.updateClothesProduct(clothesProduct);
      clothesProducts = clothesProductService.getAllClothesProduct();

      message = "商品資料已經修改。";
      if (clothesProduct != null) clothesProduct = null;
    } catch (Exception e) {
      e.printStackTrace();
    }
    return "productedit";
  }
  public String jumpproductedit() {
    clothesProduct = clothesProductService.getClothesProductById(productId);
    clothesChecks = clothesCheckService.getAllClothesCheck();

    return "changeproductedit";
  }