示例#1
0
 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;
 }
示例#2
0
 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();
 }
示例#3
0
  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";
  }
示例#4
0
  public String jumpproductedit() {
    clothesProduct = clothesProductService.getClothesProductById(productId);
    clothesChecks = clothesCheckService.getAllClothesCheck();

    return "changeproductedit";
  }