コード例 #1
0
 /* (non-Javadoc)
  * @see com.delmar.core.web.action.CoreEditPrivAction#saveForm()
  */
 @Override
 public String saveForm() {
   if (!language.isnew()) {
     language.setCode(null);
   }
   languageService.saveLanguage(language, this.languageTrlList);
   this.id = language.getId();
   editForm();
   return "edit";
 }
コード例 #2
0
  private void init() {
    if (language.getId() != null) {
      Map param = new HashMap();
      param.put("languageCode", language.getCode());
      languageTrlList = languageTrlService.selectByExample(param);

      List<Language> list = languageService.selectByExample(null);
      List<Language> noList = new ArrayList<Language>();
      if (languageTrlList == null || languageTrlList.size() == 0) {
        languageTrlList = new ArrayList<LanguageTrl>();
        noList = list;
      } else {

        for (Language lang : list) {
          boolean has = false;
          for (LanguageTrl trl : languageTrlList) {
            if (trl.getLanguage().equals(lang.getCode())) {
              has = true;
              break;
            }
          }
          if (!has) {
            noList.add(lang);
          }
        }
      }
      for (Language lang : noList) {
        LanguageTrl trl = new LanguageTrl();
        trl.setLanguage(lang.getCode());
        trl.setLanguageCode(language.getCode());
        languageTrlList.add(trl);
      }
    }
  }
コード例 #3
0
  /* (non-Javadoc)
   * @see com.delmar.core.web.action.CoreEditPrivAction#getModelId()
   */
  @Override
  public Integer getModelId() {

    return language.getId();
  }
コード例 #4
0
 /* (non-Javadoc)
  * @see com.delmar.core.web.action.CoreEditPrivAction#delete()
  */
 @Override
 public String delete() {
   languageService.deleteByPrimaryKey(language.getId());
   return "list";
 }