コード例 #1
0
  public void prepare() throws Exception {
    if (getRequestId() == null || getRequestId() == 0) {
      entCategory = new EntCategory();
    } else {
      entCategory = entCategoryService.getEntityById(getRequestId());
    }

    categories = categoryService.getCategoryByFatherId(0L);
  }
コード例 #2
0
  public String insert() {

    if (categoryIds != null && categoryIds.size() > 0) {
      Enterprise ent = SysContext.getCurrentEnterpriserUser();
      for (Long cid : categoryIds) {
        Category c = new Category();
        c.setId(cid);

        EntCategory ec = new EntCategory();
        ec.setCategory(c);
        ec.setEnterprise(ent);

        entCategoryService.insert(ec);
      }

      flag = true;
    }

    return "input";
  }