123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Data;
- namespace Ant.ORM
- {
- /// <summary>
- /// 子对象特性
- /// </summary>
- [AttributeUsage(AttributeTargets.Property)]
- public class ChildAttribute : Attribute
- {
- private string _ChildTable;
- private string _maintable;
- private string[] _ChildTableFields;
- private DbType[] _DataType;
- private string _Key;
- private string[] _ParentTableFields;
- private string _ShowField;
- /// <summary>
- /// 子对象
- /// </summary>
- /// <param name="key">关键字</param>
- /// <param name="childTable">外键所在的表</param>
- /// <param name="parentTableFields">父表字段</param>
- /// <param name="childTableFields">子表字段名</param>
- /// <param name="dataType">数据类型</param>
- public ChildAttribute(string key, string maintable, string childTable, string[] parentTableFields, string[] childTableFields, DbType[] dataType, string showField)
- {
- this._Key = key;
- this._maintable = maintable;
- this._ChildTable = childTable;
- this._ParentTableFields = parentTableFields;
- this._ChildTableFields = childTableFields;
- this._DataType = dataType;
- this._ShowField = showField;
- }
- /// <summary>
- /// 外键所在的表
- /// </summary>
- public string ChildTable
- {
- get
- {
- return this._ChildTable;
- }
- }
- /// <summary>
- /// 外键所在的表
- /// </summary>
- public string MainTable
- {
- get
- {
- return this._maintable;
- }
- }
- /// <summary>
- /// 子表字段名
- /// </summary>
- public string[] ChildTableFields
- {
- get
- {
- return this._ChildTableFields;
- }
- }
- /// <summary>
- /// 数据类型
- /// </summary>
- public DbType[] DataType
- {
- get
- {
- return this._DataType;
- }
- }
- /// <summary>
- /// 关键字
- /// </summary>
- public string Key
- {
- get
- {
- return this._Key;
- }
- }
- /// <summary>
- /// 父表字段
- /// </summary>
- public string[] ParentTableFields
- {
- get
- {
- return this._ParentTableFields;
- }
- }
- /// <summary>
- /// 显示值的字段
- /// </summary>
- public string ShowField
- {
- get
- {
- return this._ShowField;
- }
- }
- }
- }
|