示例#1
0
        private void ObjectSpace_Committed(object sender, EventArgs e)
        {
            //检查规则,并执行。有条件、无条件情况
            var actions = ActionInfos.Where(x => x.动作类型 == 动作类型.单据创建时执行 || x.动作类型 == 动作类型.单据满足条件时执行);

            foreach (var item in actions)
            {
                var isCondition = true;
                if (item.动作类型 == 动作类型.单据满足条件时执行)
                {
                    isCondition = (bool)CurrentObject.Evaluate(item.生效条件);
                }
                if (isCondition)
                {
                    var newOs = Application.CreateObjectSpace();
                    ExecuteAction(newOs, CurrentObject as 单据, item);
                }
            }
        }