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("IU_VisitStat_Page_Level_Time", true, "Page,Level,Time")] [BindIndex("IX_VisitStat_Level_Time", false, "Level,Time")] [BindTable("VisitStat", Description = "访问统计", ConnName = "Log", DbType = DatabaseType.None)] public partial class VisitStat { #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 XCode.Statistics.StatLevels _Level; /// 层级 [DisplayName("层级")] [Description("层级")] [DataObjectField(false, false, false, 0)] [BindColumn("Level", "层级", "")] public XCode.Statistics.StatLevels Level { get => _Level; set { if (OnPropertyChanging("Level", value)) { _Level = value; OnPropertyChanged("Level"); } } } private DateTime _Time; /// 时间 [DisplayName("时间")] [Description("时间")] [DataObjectField(false, false, true, 0)] [BindColumn("Time", "时间", "")] public DateTime Time { get => _Time; set { if (OnPropertyChanging("Time", value)) { _Time = value; OnPropertyChanged("Time"); } } } private String _Page; /// 页面 [DisplayName("页面")] [Description("页面")] [DataObjectField(false, false, false, 50)] [BindColumn("Page", "页面", "")] public String Page { get => _Page; set { if (OnPropertyChanging("Page", value)) { _Page = value; OnPropertyChanged("Page"); } } } private String _Title; /// 标题 [DisplayName("标题")] [Description("标题")] [DataObjectField(false, false, true, 50)] [BindColumn("Title", "标题", "", Master = true)] public String Title { get => _Title; set { if (OnPropertyChanging("Title", value)) { _Title = value; OnPropertyChanged("Title"); } } } private Int32 _Times; /// 次数 [DisplayName("次数")] [Description("次数")] [DataObjectField(false, false, false, 0)] [BindColumn("Times", "次数", "")] public Int32 Times { get => _Times; set { if (OnPropertyChanging("Times", value)) { _Times = value; OnPropertyChanged("Times"); } } } private Int32 _Users; /// 用户 [DisplayName("用户")] [Description("用户")] [DataObjectField(false, false, false, 0)] [BindColumn("Users", "用户", "")] public Int32 Users { get => _Users; set { if (OnPropertyChanging("Users", value)) { _Users = value; OnPropertyChanged("Users"); } } } private Int32 _IPs; /// IP [DisplayName("IP")] [Description("IP")] [DataObjectField(false, false, false, 0)] [BindColumn("IPs", "IP", "")] public Int32 IPs { get => _IPs; set { if (OnPropertyChanging("IPs", value)) { _IPs = value; OnPropertyChanged("IPs"); } } } private Int32 _Error; /// 错误 [DisplayName("错误")] [Description("错误")] [DataObjectField(false, false, false, 0)] [BindColumn("Error", "错误", "")] public Int32 Error { get => _Error; set { if (OnPropertyChanging("Error", value)) { _Error = value; OnPropertyChanged("Error"); } } } private Int32 _Cost; /// 耗时。毫秒 [DisplayName("耗时")] [Description("耗时。毫秒")] [DataObjectField(false, false, false, 0)] [BindColumn("Cost", "耗时。毫秒", "")] public Int32 Cost { get => _Cost; set { if (OnPropertyChanging("Cost", value)) { _Cost = value; OnPropertyChanged("Cost"); } } } private Int32 _MaxCost; /// 最大耗时。毫秒 [DisplayName("最大耗时")] [Description("最大耗时。毫秒")] [DataObjectField(false, false, false, 0)] [BindColumn("MaxCost", "最大耗时。毫秒", "")] public Int32 MaxCost { get => _MaxCost; set { if (OnPropertyChanging("MaxCost", value)) { _MaxCost = value; OnPropertyChanged("MaxCost"); } } } private DateTime _CreateTime; /// 创建时间 [DisplayName("创建时间")] [Description("创建时间")] [DataObjectField(false, false, false, 0)] [BindColumn("CreateTime", "创建时间", "")] public DateTime CreateTime { get => _CreateTime; set { if (OnPropertyChanging("CreateTime", value)) { _CreateTime = value; OnPropertyChanged("CreateTime"); } } } private DateTime _UpdateTime; /// 更新时间 [DisplayName("更新时间")] [Description("更新时间")] [DataObjectField(false, false, false, 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, 5000)] [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 "Level": return _Level; case "Time": return _Time; case "Page": return _Page; case "Title": return _Title; case "Times": return _Times; case "Users": return _Users; case "IPs": return _IPs; case "Error": return _Error; case "Cost": return _Cost; case "MaxCost": return _MaxCost; case "CreateTime": return _CreateTime; case "UpdateTime": return _UpdateTime; case "Remark": return _Remark; default: return base[name]; } } set { switch (name) { case "ID": _ID = value.ToInt(); break; case "Level": _Level = (XCode.Statistics.StatLevels)value.ToInt(); break; case "Time": _Time = value.ToDateTime(); break; case "Page": _Page = Convert.ToString(value); break; case "Title": _Title = Convert.ToString(value); break; case "Times": _Times = value.ToInt(); break; case "Users": _Users = value.ToInt(); break; case "IPs": _IPs = value.ToInt(); break; case "Error": _Error = value.ToInt(); break; case "Cost": _Cost = value.ToInt(); break; case "MaxCost": _MaxCost = value.ToInt(); break; case "CreateTime": _CreateTime = value.ToDateTime(); 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 Level = FindByName("Level"); /// 时间 public static readonly Field Time = FindByName("Time"); /// 页面 public static readonly Field Page = FindByName("Page"); /// 标题 public static readonly Field Title = FindByName("Title"); /// 次数 public static readonly Field Times = FindByName("Times"); /// 用户 public static readonly Field Users = FindByName("Users"); /// IP public static readonly Field IPs = FindByName("IPs"); /// 错误 public static readonly Field Error = FindByName("Error"); /// 耗时。毫秒 public static readonly Field Cost = FindByName("Cost"); /// 最大耗时。毫秒 public static readonly Field MaxCost = FindByName("MaxCost"); /// 创建时间 public static readonly Field CreateTime = FindByName("CreateTime"); /// 更新时间 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 Level = "Level"; /// 时间 public const String Time = "Time"; /// 页面 public const String Page = "Page"; /// 标题 public const String Title = "Title"; /// 次数 public const String Times = "Times"; /// 用户 public const String Users = "Users"; /// IP public const String IPs = "IPs"; /// 错误 public const String Error = "Error"; /// 耗时。毫秒 public const String Cost = "Cost"; /// 最大耗时。毫秒 public const String MaxCost = "MaxCost"; /// 创建时间 public const String CreateTime = "CreateTime"; /// 更新时间 public const String UpdateTime = "UpdateTime"; /// 详细信息 public const String Remark = "Remark"; } #endregion } }