• XAF 编写随笔


    1. 唯一约束
      • 单属性唯一约束,在属性上写:

    private Evaluation _RelEvaluation;
            [RuleUniqueValue("关联评测活动不能重复", DefaultContexts.Save, CriteriaEvaluationBehavior = CriteriaEvaluationBehavior.BeforeTransaction)]
            [XafDisplayName("关联评测活动")]
            public Evaluation RelEvaluation
            {
                get
                {
                    return _RelEvaluation;
                }
                set
                {
                    SetPropertyValue("RelEvaluation", ref _RelEvaluation, value);
                }
            }

      • 复合唯一约束,多个属性,在类上写

        [DefaultClassOptions]
         //[NavigationItem("基础管理")]
         [XafDisplayName("评价人")]
         [ImageName("BO_Person")]
         [CreatableItem(false)]
         [RuleCombinationOfPropertiesIsUnique("同一测评活动下评价人的密码不能重复", DefaultContexts.Save, "RELEvaluation, Pwd")]
         public class Appraiser : BaseObject
         { // Inherit from a different class to provide a custom primary key, concurrency and deletion behavior, etc. (https://documentation.devexpress.com/eXpressAppFramework/CustomDocument113146.aspx).
             public Appraiser(Session session)
                 : base(session)
             {
             }

    1. 必填项

    private MemberDomainObject _RELMemberDomainObject;
             [RuleRequiredField(DefaultContexts.Save)]
             [Association("MemberDomainObject-CPSCLDO")]
             [XafDisplayName("关联会员")]
             public MemberDomainObject RELMemberDomainObject
             {
                 get { return _RELMemberDomainObject; }
                 set
                 {
                     SetPropertyValue("RELMemberDomainObject", ref _RELMemberDomainObject, value);
                 }
             }


  • 相关阅读:
    全局函数和静态函数
    C语言变量总结
    #ifdef、#ifndef 与 #endif
    #include与#define的意义
    exit
    字符常量
    void *:万能指针
    算法(Algorithms)第4版 练习 链表类 1.3.19~1.3.29
    算法(Algorithms)第4版 练习 1.3.219
    算法(Algorithms)第4版 练习 1.3.20
  • 原文地址:https://www.cnblogs.com/HappinessZhao/p/11967926.html
Copyright © 2020-2023  润新知