Package org.beangle.ems.dictionary.model

Examples of org.beangle.ems.dictionary.model.CodeCategory


    List<CodeCategory> categories = entityDao.getAll(CodeCategory.class);
    List<CodeCategory> updated = CollectUtils.newArrayList();
    Set<String> names = CollectUtils.newHashSet();
    Set<String> duplicatedNames  = CollectUtils.newHashSet();
    for (CodeCategory category : categories) {
      CodeCategory newCategory = populateEntity(CodeCategory.class, category.getId() + "_codeCategory");
      if (names.contains(newCategory.getName())) {
        duplicatedNames.add(newCategory.getName());
      } else {
        names.add(newCategory.getName());
        updated.add(newCategory);
      }
    }
    CodeCategory newCategory = populateEntity(CodeCategory.class, "newCodeCategory");
    if (StringUtils.isNotBlank(newCategory.getName())) {
      if (names.contains(newCategory.getName())) {
        duplicatedNames.add(newCategory.getName());
      } else {
        names.add(newCategory.getName());
        updated.add(newCategory);
      }
    }
    if (duplicatedNames.size() > 0) {
      addFlashErrorNow("dictionary.error.duplicateCategoryName", StrUtils.join(duplicatedNames,","));
View Full Code Here


      return redirect("categories", "info.save.success");
    }
  }

  public String removeCategory() {
    CodeCategory newCategory = getEntity(CodeCategory.class, "codeCategory");
    try {
      if (null != newCategory.getId()) entityDao.remove(newCategory);
    } catch (Exception e) {
      logger.error("code category remove error :" + newCategory.getName(), e);
      return redirect("categories", "info.remove.failure");
    }
    return redirect("categories", "info.remove.success");
  }
View Full Code Here

    List<CodeCategory> categories = entityDao.getAll(CodeCategory.class);
    List<CodeCategory> updated = CollectUtils.newArrayList();
    Set<String> names = CollectUtils.newHashSet();
    Set<String> duplicatedNames  = CollectUtils.newHashSet();
    for (CodeCategory category : categories) {
      CodeCategory newCategory = populateEntity(CodeCategory.class, category.getId() + "_codeCategory");
      if (names.contains(newCategory.getName())) {
        duplicatedNames.add(newCategory.getName());
      } else {
        names.add(newCategory.getName());
        updated.add(newCategory);
      }
    }
    CodeCategory newCategory = populateEntity(CodeCategory.class, "newCodeCategory");
    if (StringUtils.isNotBlank(newCategory.getName())) {
      if (names.contains(newCategory.getName())) {
        duplicatedNames.add(newCategory.getName());
      } else {
        names.add(newCategory.getName());
        updated.add(newCategory);
      }
    }
    if (duplicatedNames.size() > 0) {
      addFlashErrorNow("dictionary.error.duplicateCategoryName", StrUtils.join(duplicatedNames,","));
View Full Code Here

      return redirect("categories", "info.save.success");
    }
  }

  public String removeCategory() {
    CodeCategory newCategory = getEntity(CodeCategory.class, "codeCategory");
    try {
      if (null != newCategory.getId()) entityDao.remove(newCategory);
    } catch (Exception e) {
      logger.error("code category remove error :" + newCategory.getName(), e);
      return redirect("categories", "info.remove.failure");
    }
    return redirect("categories", "info.remove.success");
  }
View Full Code Here

TOP

Related Classes of org.beangle.ems.dictionary.model.CodeCategory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.