using System; using System.Collections.Generic; using System.ComponentModel; using XCode; using XCode.Configuration; using XCode.DataAccessLayer; using NewLife; namespace COMCMS.Core { /// 目标事件 [Serializable] [DataObject] [Description("目标事件")] [BindTable("TargetEvent", Description = "目标事件", ConnName = "dbconn", DbType = DatabaseType.SqlServer)] public partial class TargetEvent : ITargetEvent { #region 属性 private Int32 _Id; /// 编号 [DisplayName("编号")] [Description("编号")] [DataObjectField(true, true, false, 0)] [BindColumn("Id", "编号", "int")] public Int32 Id { get { return _Id; } set { if (OnPropertyChanging(__.Id, value)) { _Id = value; OnPropertyChanged(__.Id); } } } private String _EventKey; /// 事件key [DisplayName("事件key")] [Description("事件key")] [DataObjectField(false, false, true, 50)] [BindColumn("EventKey", "事件key", "nvarchar(50)", Master = true)] public String EventKey { get { return _EventKey; } set { if (OnPropertyChanging(__.EventKey, value)) { _EventKey = value; OnPropertyChanged(__.EventKey); } } } private String _EventName; /// 事件名称 [DisplayName("事件名称")] [Description("事件名称")] [DataObjectField(false, false, true, 50)] [BindColumn("EventName", "事件名称", "nvarchar(50)")] public String EventName { get { return _EventName; } set { if (OnPropertyChanging(__.EventName, value)) { _EventName = value; OnPropertyChanged(__.EventName); } } } private Int32 _IsDisable; /// 是否禁用 [DisplayName("是否禁用")] [Description("是否禁用")] [DataObjectField(false, false, false, 0)] [BindColumn("IsDisable", "是否禁用", "int")] public Int32 IsDisable { get { return _IsDisable; } set { if (OnPropertyChanging(__.IsDisable, value)) { _IsDisable = value; OnPropertyChanged(__.IsDisable); } } } private Int32 _Rank; /// 排序 [DisplayName("排序")] [Description("排序")] [DataObjectField(false, false, false, 0)] [BindColumn("Rank", "排序", "int")] public Int32 Rank { get { return _Rank; } set { if (OnPropertyChanging(__.Rank, value)) { _Rank = value; OnPropertyChanged(__.Rank); } } } #endregion #region 获取/设置 字段值 /// 获取/设置 字段值 /// 字段名 /// public override Object this[String name] { get { switch (name) { case __.Id : return _Id; case __.EventKey : return _EventKey; case __.EventName : return _EventName; case __.IsDisable : return _IsDisable; case __.Rank : return _Rank; default: return base[name]; } } set { switch (name) { case __.Id : _Id = Convert.ToInt32(value); break; case __.EventKey : _EventKey = Convert.ToString(value); break; case __.EventName : _EventName = Convert.ToString(value); break; case __.IsDisable : _IsDisable = Convert.ToInt32(value); break; case __.Rank : _Rank = Convert.ToInt32(value); break; default: base[name] = value; break; } } } #endregion #region 字段名 /// 取得目标事件字段信息的快捷方式 public partial class _ { /// 编号 public static readonly Field Id = FindByName(__.Id); /// 事件key public static readonly Field EventKey = FindByName(__.EventKey); /// 事件名称 public static readonly Field EventName = FindByName(__.EventName); /// 是否禁用 public static readonly Field IsDisable = FindByName(__.IsDisable); /// 排序 public static readonly Field Rank = FindByName(__.Rank); static Field FindByName(String name) { return Meta.Table.FindByName(name); } } /// 取得目标事件字段名称的快捷方式 public partial class __ { /// 编号 public const String Id = "Id"; /// 事件key public const String EventKey = "EventKey"; /// 事件名称 public const String EventName = "EventName"; /// 是否禁用 public const String IsDisable = "IsDisable"; /// 排序 public const String Rank = "Rank"; } #endregion } /// 目标事件接口 public partial interface ITargetEvent { #region 属性 /// 编号 Int32 Id { get; set; } /// 事件key String EventKey { get; set; } /// 事件名称 String EventName { get; set; } /// 是否禁用 Int32 IsDisable { get; set; } /// 排序 Int32 Rank { get; set; } #endregion #region 获取/设置 字段值 /// 获取/设置 字段值 /// 字段名 /// Object this[String name] { get; set; } #endregion } }