示例#1
0
  protected void init(UIBlockContext maker, Map context) {
    super.init(maker, context);
    context.put("cfgPostFee", SoftConfigManager.me().getEshopPostFee());
    context.put("cfgNotPostFee", SoftConfigManager.me().getEshopNotPostFee());
    context.put("cfgNotPostFeeDesc", SoftConfigManager.me().getEshopNotPostFeeDesc());
    // 联系地址
    if (Demsy.me().login() != null) {
      IOrm orm = Demsy.orm();
      Class type = bizEngine.getStaticType(IContact.SYS_CODE);
      List contactList =
          orm.query(
              type,
              Expr.eq(LibConst.F_CREATED_BY, Demsy.me().username())
                  .and(Expr.eq(LibConst.F_SOFT_ID, Demsy.me().getSoft().getId())));

      if (contactList != null && contactList.size() > 0) context.put("contactList", contactList);
    }
  }
示例#2
0
    @Override
    public void before(ActionEvent<WebCatalogEntity> event) {
      synchronized (SaveWebCatalog.class) {
        Orm orm = event.getOrm();

        WebCatalogEntity entity = event.getEntity();

        String catalogCode = entity.getCode();
        if (!StringUtil.isNil(catalogCode)) {
          WebCatalogEntity existedCatalog =
              (WebCatalogEntity) orm.get(entity.getClass(), Expr.eq("code", catalogCode));
          if (existedCatalog != null && catalogCode.equals(existedCatalog.getCode())) {
            if (entity.getId() != existedCatalog.getId()) {
              throw new CocException("栏目编码已经被占用!");
            }
          }
        }
      }
    }