// Developer Express Code Central Example:
// How to: Disable Property Editors Based on a Business Rule
//
// This example demonstrates how to hide and disable property editors via the
// Conditional Appearance module (the obsolete Conditional Editor State module is
// used in versions prior to 11.2). The complete description is available in the
// How to: Disable Property Editors Based on a Business Rule
// (ms-help://DevExpress.Xaf/CustomDocument3221.htm) help topic.
//
// You can find sample updates and versions for different programming languages here:
// http://www.devexpress.com/example=E1672 using System;
using System.ComponentModel;
using DevExpress.Xpo;
using DevExpress.Data.Filtering;
using DevExpress.ExpressApp;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Persistent.Validation;
using DevExpress.ExpressApp.ConditionalAppearance;
using DevExpress.ExpressApp.Editors; namespace EditorStateExample.Module {
[DefaultClassOptions]
[ImageName("BO_Person")]
public class Contact : BaseObject {
public Contact(Session session) : base(session) { }
public string Name {
get { return GetPropertyValue<string>("Name"); }
set { SetPropertyValue<string>("Name", value); }
}
[ImmediatePostData]
public bool IsMarried {
get { return GetPropertyValue<bool>("IsMarried"); }
set { SetPropertyValue<bool>("IsMarried", value); }
}
[Appearance("Single", Visibility = ViewItemVisibility.Hide, Criteria = "!IsMarried", Context="DetailView")]
public string SpouseName {
get { return GetPropertyValue<string>("SpouseName"); }
set { SetPropertyValue<string>("SpouseName", value); }
}
[ImmediatePostData]
public string Address1 {
get { return GetPropertyValue<string>("Address1"); }
set { SetPropertyValue<string>("Address1", value); }
}
[Appearance("AddressOneIsEmpty", Enabled = false, Criteria = "IsNullOrEmpty(Address1)")]
public string Address2 {
get { return GetPropertyValue<string>("Address2"); }
set { SetPropertyValue<string>("Address2", value); }
}
}
}
转载于:http://www.cnblogs.com/Tonyyang/

XAF 如何基于业务规则禁用属性的更多相关文章

  1. [原] XAF 如何基于业务规则禁用属性

    How to: Disable Property Editors Based on a Business Rule // Developer Express Code Central Example: ...

  2. 基于RulesEngine的业务规则实现

    规则引擎由推理引擎发展而来,是一种嵌入在应用程序中的组件,实现了将业务决策从应用程序代码中分离出来,并使用预定义的语义模块编写业务决策.接受数据输入,解释业务规则,并根据业务规则做出业务决策.比较常见 ...

  3. 【java规则引擎】一个基于drools规则引擎实现的数学计算例子

    最近在研究JBPM工作流引擎,发现JBPM是基于Drools的,官方文档查看得知Drools是一款规则引擎.兴趣之下,仔细了解了下 Drools,Drools作为JBoss出品的一款开源推理和规则引擎 ...

  4. SpringBoot2 整合 Drools规则引擎,实现高效的业务规则

    本文源码:GitHub·点这里 || GitEE·点这里 一.Drools引擎简介 1.基础简介 Drools是一个基于java的规则引擎,开源的,可以将复杂多变的规则从硬编码中解放出来,以规则脚本的 ...

  5. (十五)整合 Drools规则引擎,实现高效的业务规则

    整合 Drools规则引擎,实现高效的业务规则 1.Drools引擎简介 1.1 规则语法 2.SpringBoot整合Drools 2.1 项目结构 2.2 核心依赖 2.3 配置文件 3.演示案例 ...

  6. BizTalk动手实验(九)业务规则引擎使用

    1 课程简介 通过本课程熟悉业务规则引擎(BRE)的使用(本环境为Windows 2008 32位操作系统环境 + Visual Studio 2010 + BizTalk 210) 2 准备工作 1 ...

  7. Asp.net 面向接口可扩展框架之业务规则引擎扩展组件

    随着面向接口可扩展框架的继续开发,有些功能开发出现了"瓶颈",有太多的东西要写死才好做.但写死的代码扩展性是非常的不好,迷茫中寻找出入... 进而想到我以前开发的好几个项目,都已有 ...

  8. 基于NXBRE规则引擎实现的柔性折扣策略

    规则引擎由推理引擎发展而来,是一种嵌入在应用程序中的组件,实现了将业务决策从应用程序代码中分离出来,并使用预定义的语义模块编写业务决策.接受数据输入,解释业务规则,并根据业务规则做出业务决策.应用背景 ...

  9. C语言实现基于投票规则的细胞自动机

    算法介绍 首先我们先看一下“基于投票规则的细胞自动机”的定义: 基于投票规则的细胞自动机,实际上是具有如下限定条件的一种细胞自动机: 状态:0或1: 邻居:中心的3*3邻居: 规则:计数p表示中心的3 ...

随机推荐

  1. PAT自测-5 Shuffling Machine

    原题连接https://pta.patest.cn/pta/test/17/exam/4/question/264 Shuffling is a procedure used to randomize ...

  2. Java 异常java.lang.IllegalArgumentException: Illegal group reference

    当字符串方法replaceAll()中替换字符含有特殊字符$如, String test = "<StreamingNo>abc</StreamingNo>" ...

  3. php进程占用大量cpu优化

    使用TOP 命令发现php进程占用大量的cpu,达到100%,需要优化. 1 ll /proc/6264/fd 查看进程正在使用的资源 2 strace -p 6264 追踪进程正在做的事情 引用 h ...

  4. ubuntu开启SSH服务

    SSH分客户端openssh-client和openssh-server 如果你只是想登陆别的机器的SSH只需要安装openssh-client(ubuntu有默认安装,如果没有则sudo apt-g ...

  5. Eclipse汉化后切换回英文

    方法: 1.复制MyEclipse的快捷方式: 2.右键快捷方式->属性,在“目标”的后边加上 -nl "en" 之前的:"F:\Program Files\MyE ...

  6. WordPress基础:固定链接的设置

    安装wordpressp后的工作之一最好修改固定链接,原因就是wp默认的/?p=123形式不利于搜索引擎优化而且也不美观. URL结构参数说明:%year%:日志发表的年份,如2009%monthnu ...

  7. Ehcache Demo

    转自: https://my.oschina.net/zb0423/blog/60957http://www.cnblogs.com/fsjin/articles/3521261.html Ehcac ...

  8. (java oracle)以bean和array为参数的存储过程及dao部分代码

    一.数据库部分 1.创建bean对象 CREATE OR REPLACE TYPE "QUARTZJOBBEAN" as object ( -- Author : Duwc -- ...

  9. java类初始化的过程

    在复习Thinking in java的过程中看到了相关内容,顺便整理一下,像下面一样的代码具体的执行顺序(ABCD都是类) public class A { public A(String text ...

  10. shell中对字符串的处理

    1.替换字符串1为字符串2 sed "s/str1/str2/g" 2.获取字符串中的一部分 例:boke-blade 取得boke:sed -e "s/-.*//g&q ...