using System; using System.Collections.Generic; using System.ComponentModel; using System.Runtime.Serialization; using System.Web.Script.Serialization; using System.Xml.Serialization; using XCode; using XCode.Configuration; using XCode.DataAccessLayer; namespace COMCMS.Core { /// 目标事件 [Serializable] [DataObject] [Description("目标事件")] [BindTable("TargetEvent", Description = "目标事件", ConnName = "dbconn", DbType = DatabaseType.SqlServer)] public partial class TargetEvent { #region 属性 private Int32 _Id; /// 编号 [DisplayName("编号")] [Description("编号")] [DataObjectField(true, true, false, 0)] [BindColumn("Id", "编号", "")] public Int32 Id { get => _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", "", Master = true)] public String EventKey { get => _EventKey; set { if (OnPropertyChanging("EventKey", value)) { _EventKey = value; OnPropertyChanged("EventKey"); } } } private String _EventName; /// 事件名称 [DisplayName("事件名称")] [Description("事件名称")] [DataObjectField(false, false, true, 50)] [BindColumn("EventName", "事件名称", "")] public String EventName { get => _EventName; set { if (OnPropertyChanging("EventName", value)) { _EventName = value; OnPropertyChanged("EventName"); } } } private Int32 _IsDisable; /// 是否禁用 [DisplayName("是否禁用")] [Description("是否禁用")] [DataObjectField(false, false, false, 0)] [BindColumn("IsDisable", "是否禁用", "")] public Int32 IsDisable { get => _IsDisable; set { if (OnPropertyChanging("IsDisable", value)) { _IsDisable = value; OnPropertyChanged("IsDisable"); } } } private Int32 _Rank; /// 排序 [DisplayName("排序")] [Description("排序")] [DataObjectField(false, false, false, 0)] [BindColumn("Rank", "排序", "")] public Int32 Rank { get => _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 = value.ToInt(); break; case "EventKey": _EventKey = Convert.ToString(value); break; case "EventName": _EventName = Convert.ToString(value); break; case "IsDisable": _IsDisable = value.ToInt(); break; case "Rank": _Rank = value.ToInt(); 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) => 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 } }