| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System;
- namespace Core.StlMes.Client.Qcm
- {
- public enum FieldAttributeType
- {
- QueryField = 1, //如果不填,则二进制只有一位。就无法正常使用枚举的异或、与运算了。
- NoQueryField = 2
- }
- /// <summary>
- /// 用来标识实体类的属性,以被转换器使用。
- /// </summary>
- [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
- class FieldAttribute : Attribute
- {
- private string _fieldName = "";
- private bool _isGetValue = false;
- private FieldAttributeType _fieldAttributeType;
- /// <summary>
- /// 字段名称
- /// </summary>
- public string FieldName
- {
- get { return _fieldName; }
- set { _fieldName = value; }
- }
- /// <summary>
- /// 是取Value的值还是取Text的值
- /// </summary>
- public bool IsGetValue
- {
- get { return _isGetValue; }
- set { _isGetValue = value; }
- }
- /// <summary>
- /// 字段类型(用于查询条件还是新增修改或者保存条件)
- /// </summary>
- public FieldAttributeType FieldAttributeType
- {
- get { return _fieldAttributeType; }
- set { _fieldAttributeType = value; }
- }
- /// <summary>
- /// 字段特性构造函数(默认为实体类的属性名称)
- /// </summary>
- /// <param name="isGetValue">是取Value的值还是取Text的值</param>
- ///<param name="fieldAttributeType">字段类型(用于查询条件还是新增修改或者保存条件)</param>
- public FieldAttribute(bool isGetValue, FieldAttributeType fieldAttributeType)
- {
- _isGetValue = isGetValue;
- _fieldAttributeType = fieldAttributeType;
- }
- /// <summary>
- /// 字段特性构造函数
- /// </summary>
- /// <param name="fieldName">字段名称</param>
- /// <param name="isGetValue">是取Value的值还是取Text的值</param>
- ///<param name="fieldAttributeType">字段类型(用于查询条件还是新增修改或者保存条件)</param>
- public FieldAttribute(string fieldName, bool isGetValue, FieldAttributeType fieldAttributeType)
- {
- _fieldName = fieldName;
- _isGetValue = isGetValue;
- _fieldAttributeType = fieldAttributeType;
- }
- }
- }
|