Exemplo n.º 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;
 }
Exemplo n.º 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();
 }
Exemplo n.º 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";
  }
Exemplo n.º 4
0
  public String jumpproductedit() {
    clothesProduct = clothesProductService.getClothesProductById(productId);
    clothesChecks = clothesCheckService.getAllClothesCheck();

    return "changeproductedit";
  }