예제 #1
0
  @RequestMapping(value = "/list")
  public String list(Model model) {
    List<Part> parts = partManager.getAll();

    model.addAttribute("aaa", parts);
    return "sales/master/part";
  }
예제 #2
0
  @RequestMapping(value = "/save")
  public String save(@Valid Part part, BindingResult result, Model model) {
    if (result.hasErrors()) {
      return "sales/master/partInput";
    }
    partManager.save(part);

    return list(model);
  }
예제 #3
0
 @RequestMapping(value = "/edit")
 public String edit(@RequestParam int id, Model model) {
   Part part = null;
   if (id == -1) {
     part = new Part();
   } else part = partManager.get(id);
   model.addAttribute(part);
   return "sales/master/partInput";
 }
예제 #4
0
 @RequestMapping(value = "/delete")
 public String delete(@RequestParam int id, Model model) {
   partManager.remove(id);
   return list(model);
 }