@Override
  public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception {

    System.out.println("UpdateProductAction - execute Start...");

    int prodNo = Integer.parseInt(request.getParameter("prodNo"));

    ProductService service = new ProductServiceImpl();

    Product prod = service.getProduct(prodNo);

    //	System.out.println("updateVO : " + prodVO + " : " + prodNo);
    System.out.println("변경후프로도 : " + prod);

    prod.setProdName(request.getParameter("prodName"));
    prod.setProdDetail(request.getParameter("prodDetail"));
    prod.setManuDate(request.getParameter("manuDate"));
    prod.setPrice(Integer.parseInt(request.getParameter("price")));

    System.out.println("변경전프로도 : " + prod);
    service.updateProduct(prod);

    String menu = "ok";
    request.setAttribute("menu", menu);

    System.out.println("UpdateProductAction - execute End...");

    // return "forward:/product/confirmDetailProductView.jsp";
    return "redirect:/getProduct.do?prodNo=" + prodNo + "&menu=" + menu;
  }
Esempio n. 2
0
  @RequestMapping
  public ModelAndView updateTranCodeByProd(
      @RequestParam("prodNo") int prodNo, @RequestParam("tranCode") String tranCode)
      throws Exception {
    Purchase purchase = new Purchase();
    Product product = new Product();
    product.setProdNo(prodNo);
    purchase.setPurchaseProd(product);
    purchase.setTranCode(tranCode);

    Map<String, Object> map = new HashMap<String, Object>();
    map.put("product", purchase);
    purchaseService.updateTranCode(map);

    ModelAndView mav = new ModelAndView();
    mav.setViewName("redirect:/app/purchase/getSaleList?menu=manage");
    return mav;
  }
Esempio n. 3
0
  @RequestMapping
  public ModelAndView addPurchase(
      @ModelAttribute("purchase") Purchase purchase,
      @RequestParam("prodNo") int prodNo,
      @RequestParam("buyerId") String buyerId)
      throws Exception {
    System.out.println(purchase);
    System.out.println(prodNo);
    Product product = new Product();
    product.setProdNo(prodNo);
    User user = new User();
    user.setUserId(buyerId);

    purchase.setPurchaseProd(product);
    purchase.setBuyer(user);
    purchase.setTranCode("1");
    purchaseService.addPurchase(purchase);

    product = productService.getProduct(prodNo);
    ModelAndView mav = new ModelAndView();
    mav.addObject("product", product);
    mav.setViewName("forward:/product/getProduct.jsp"); // ���ſϷ� ������
    return mav;
  }