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 XCode.Membership { /// 地区。行政区划数据 [Serializable] [DataObject] [Description("地区。行政区划数据")] [BindIndex("IX_Area_ParentID", false, "ParentID")] [BindIndex("IX_Area_Name", false, "Name")] [BindIndex("IX_Area_UpdateTime_ID", false, "UpdateTime,ID")] [BindTable("Area", Description = "地区。行政区划数据", ConnName = "Membership", DbType = DatabaseType.None)] public partial class Area { #region 属性 private Int32 _ID; /// 编码。行政区划编码 [DisplayName("编码")] [Description("编码。行政区划编码")] [DataObjectField(true, false, false, 0)] [BindColumn("ID", "编码。行政区划编码", "")] public Int32 ID { get => _ID; set { if (OnPropertyChanging("ID", value)) { _ID = value; OnPropertyChanged("ID"); } } } private String _Name; /// 名称 [DisplayName("名称")] [Description("名称")] [DataObjectField(false, false, true, 50)] [BindColumn("Name", "名称", "", Master = true)] public String Name { get => _Name; set { if (OnPropertyChanging("Name", value)) { _Name = value; OnPropertyChanged("Name"); } } } private String _FullName; /// 全名 [DisplayName("全名")] [Description("全名")] [DataObjectField(false, false, true, 50)] [BindColumn("FullName", "全名", "", Master = true)] public String FullName { get => _FullName; set { if (OnPropertyChanging("FullName", value)) { _FullName = value; OnPropertyChanged("FullName"); } } } private Int32 _ParentID; /// 父级 [DisplayName("父级")] [Description("父级")] [DataObjectField(false, false, false, 0)] [BindColumn("ParentID", "父级", "")] public Int32 ParentID { get => _ParentID; set { if (OnPropertyChanging("ParentID", value)) { _ParentID = value; OnPropertyChanged("ParentID"); } } } private Int32 _Level; /// 层级 [DisplayName("层级")] [Description("层级")] [DataObjectField(false, false, false, 0)] [BindColumn("Level", "层级", "")] public Int32 Level { get => _Level; set { if (OnPropertyChanging("Level", value)) { _Level = value; OnPropertyChanged("Level"); } } } private Double _Longitude; /// 经度 [DisplayName("经度")] [Description("经度")] [DataObjectField(false, false, false, 0)] [BindColumn("Longitude", "经度", "")] public Double Longitude { get => _Longitude; set { if (OnPropertyChanging("Longitude", value)) { _Longitude = value; OnPropertyChanged("Longitude"); } } } private Double _Latitude; /// 纬度 [DisplayName("纬度")] [Description("纬度")] [DataObjectField(false, false, false, 0)] [BindColumn("Latitude", "纬度", "")] public Double Latitude { get => _Latitude; set { if (OnPropertyChanging("Latitude", value)) { _Latitude = value; OnPropertyChanged("Latitude"); } } } private Boolean _Enable; /// 启用 [DisplayName("启用")] [Description("启用")] [DataObjectField(false, false, false, 0)] [BindColumn("Enable", "启用", "")] public Boolean Enable { get => _Enable; set { if (OnPropertyChanging("Enable", value)) { _Enable = value; OnPropertyChanged("Enable"); } } } private String _UpdateUser; /// 更新者 [DisplayName("更新者")] [Description("更新者")] [DataObjectField(false, false, true, 50)] [BindColumn("UpdateUser", "更新者", "")] public String UpdateUser { get => _UpdateUser; set { if (OnPropertyChanging("UpdateUser", value)) { _UpdateUser = value; OnPropertyChanged("UpdateUser"); } } } private Int32 _UpdateUserID; /// 更新用户 [DisplayName("更新用户")] [Description("更新用户")] [DataObjectField(false, false, false, 0)] [BindColumn("UpdateUserID", "更新用户", "")] public Int32 UpdateUserID { get => _UpdateUserID; set { if (OnPropertyChanging("UpdateUserID", value)) { _UpdateUserID = value; OnPropertyChanged("UpdateUserID"); } } } private String _UpdateIP; /// 更新地址 [DisplayName("更新地址")] [Description("更新地址")] [DataObjectField(false, false, true, 50)] [BindColumn("UpdateIP", "更新地址", "")] public String UpdateIP { get => _UpdateIP; set { if (OnPropertyChanging("UpdateIP", value)) { _UpdateIP = value; OnPropertyChanged("UpdateIP"); } } } private DateTime _UpdateTime; /// 更新时间 [DisplayName("更新时间")] [Description("更新时间")] [DataObjectField(false, false, true, 0)] [BindColumn("UpdateTime", "更新时间", "")] public DateTime UpdateTime { get => _UpdateTime; set { if (OnPropertyChanging("UpdateTime", value)) { _UpdateTime = value; OnPropertyChanged("UpdateTime"); } } } private String _Remark; /// 备注 [DisplayName("备注")] [Description("备注")] [DataObjectField(false, false, true, 200)] [BindColumn("Remark", "备注", "")] public String Remark { get => _Remark; set { if (OnPropertyChanging("Remark", value)) { _Remark = value; OnPropertyChanged("Remark"); } } } #endregion #region 获取/设置 字段值 /// 获取/设置 字段值 /// 字段名 /// public override Object this[String name] { get { switch (name) { case "ID": return _ID; case "Name": return _Name; case "FullName": return _FullName; case "ParentID": return _ParentID; case "Level": return _Level; case "Longitude": return _Longitude; case "Latitude": return _Latitude; case "Enable": return _Enable; case "UpdateUser": return _UpdateUser; case "UpdateUserID": return _UpdateUserID; case "UpdateIP": return _UpdateIP; case "UpdateTime": return _UpdateTime; case "Remark": return _Remark; default: return base[name]; } } set { switch (name) { case "ID": _ID = value.ToInt(); break; case "Name": _Name = Convert.ToString(value); break; case "FullName": _FullName = Convert.ToString(value); break; case "ParentID": _ParentID = value.ToInt(); break; case "Level": _Level = value.ToInt(); break; case "Longitude": _Longitude = value.ToDouble(); break; case "Latitude": _Latitude = value.ToDouble(); break; case "Enable": _Enable = value.ToBoolean(); break; case "UpdateUser": _UpdateUser = Convert.ToString(value); break; case "UpdateUserID": _UpdateUserID = value.ToInt(); break; case "UpdateIP": _UpdateIP = Convert.ToString(value); break; case "UpdateTime": _UpdateTime = value.ToDateTime(); break; case "Remark": _Remark = Convert.ToString(value); break; default: base[name] = value; break; } } } #endregion #region 字段名 /// 取得地区字段信息的快捷方式 public partial class _ { /// 编码。行政区划编码 public static readonly Field ID = FindByName("ID"); /// 名称 public static readonly Field Name = FindByName("Name"); /// 全名 public static readonly Field FullName = FindByName("FullName"); /// 父级 public static readonly Field ParentID = FindByName("ParentID"); /// 层级 public static readonly Field Level = FindByName("Level"); /// 经度 public static readonly Field Longitude = FindByName("Longitude"); /// 纬度 public static readonly Field Latitude = FindByName("Latitude"); /// 启用 public static readonly Field Enable = FindByName("Enable"); /// 更新者 public static readonly Field UpdateUser = FindByName("UpdateUser"); /// 更新用户 public static readonly Field UpdateUserID = FindByName("UpdateUserID"); /// 更新地址 public static readonly Field UpdateIP = FindByName("UpdateIP"); /// 更新时间 public static readonly Field UpdateTime = FindByName("UpdateTime"); /// 备注 public static readonly Field Remark = FindByName("Remark"); static Field FindByName(String name) => Meta.Table.FindByName(name); } /// 取得地区字段名称的快捷方式 public partial class __ { /// 编码。行政区划编码 public const String ID = "ID"; /// 名称 public const String Name = "Name"; /// 全名 public const String FullName = "FullName"; /// 父级 public const String ParentID = "ParentID"; /// 层级 public const String Level = "Level"; /// 经度 public const String Longitude = "Longitude"; /// 纬度 public const String Latitude = "Latitude"; /// 启用 public const String Enable = "Enable"; /// 更新者 public const String UpdateUser = "UpdateUser"; /// 更新用户 public const String UpdateUserID = "UpdateUserID"; /// 更新地址 public const String UpdateIP = "UpdateIP"; /// 更新时间 public const String UpdateTime = "UpdateTime"; /// 备注 public const String Remark = "Remark"; } #endregion } }