修改全局Utility扩展的命名空间为NewLife
This commit is contained in:
parent
df7337be0f
commit
3a22fd60da
|
@ -317,6 +317,7 @@ public class EntityBuilder : ClassBuilder
|
|||
{
|
||||
var us = Option.Usings;
|
||||
us.Add("System.Linq");
|
||||
us.Add("NewLife");
|
||||
us.Add("NewLife.Log");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,8 +77,9 @@ public class ModelBuilder : ClassBuilder
|
|||
var us = Option.Usings;
|
||||
if (Option.HasIModel)
|
||||
{
|
||||
if (!us.Contains("NewLife.Data")) us.Add("NewLife.Data");
|
||||
if (!us.Contains("NewLife.Reflection")) us.Add("NewLife.Reflection");
|
||||
us.Add("NewLife");
|
||||
us.Add("NewLife.Data");
|
||||
us.Add("NewLife.Reflection");
|
||||
}
|
||||
|
||||
base.Prepare();
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NewLife;
|
||||
|
||||
namespace XCode;
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System.ComponentModel;
|
||||
using NewLife;
|
||||
using XCode.Configuration;
|
||||
|
||||
namespace XCode;
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using NewLife.Reflection;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using NewLife.Reflection;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using NewLife.Reflection;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using NewLife.Reflection;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using NewLife.Reflection;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using NewLife.Reflection;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using NewLife.Reflection;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using NewLife.Reflection;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using NewLife.Reflection;
|
||||
|
||||
|
|
Binary file not shown.
|
@ -1,4 +1,5 @@
|
|||
using NewLife.Reflection;
|
||||
using NewLife;
|
||||
using NewLife.Reflection;
|
||||
|
||||
namespace XCode.Statistics;
|
||||
|
||||
|
|
|
@ -46,7 +46,10 @@
|
|||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NewLife.Core" Version="11.3.2025.101" />
|
||||
<PackageReference Include="NewLife.Core" Version="11.3.2025.109-beta0435" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Using Include="NewLife" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="build\**" />
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using NewLife.Reflection;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using NewLife.Reflection;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using NewLife.Log;
|
||||
using NewLife.Security;
|
||||
|
|
|
@ -1,139 +1,179 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Tables xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:schemaLocation="https://newlifex.com https://newlifex.com/Model2022.xsd" NameSpace="XUnitTest.XCode.TestEntity" ConnName="test" Output="" BaseClass="Entity" Version="11.1.2022.0521" Document="https://newlifex.com/xcode/model" xmlns="https://newlifex.com/Model2022.xsd">
|
||||
<Table Name="User2" Description="用户">
|
||||
<Columns>
|
||||
<Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
|
||||
<Column Name="Name" DataType="String" Master="True" Nullable="False" Description="名称。登录用户名" />
|
||||
<Column Name="Password" DataType="String" Description="密码" />
|
||||
<Column Name="DisplayName" DataType="String" Description="昵称" />
|
||||
<Column Name="Sex" DataType="Int32" Description="性别。未知、男、女" Type="SexKinds" />
|
||||
<Column Name="Mail" DataType="String" ItemType="mail" Description="邮件" />
|
||||
<Column Name="Mobile" DataType="String" ItemType="mobile" Description="手机" />
|
||||
<Column Name="Code" DataType="String" Description="代码。身份证、员工编号等" />
|
||||
<Column Name="Avatar" DataType="String" ItemType="image" Length="200" Description="头像" />
|
||||
<Column Name="RoleID" DataType="Int32" Description="角色。主要角色" />
|
||||
<Column Name="RoleIds" DataType="String" Length="200" Description="角色组。次要角色集合" />
|
||||
<Column Name="DepartmentID" DataType="Int32" Description="部门。组织机构" />
|
||||
<Column Name="Online" DataType="Boolean" Description="在线" />
|
||||
<Column Name="Enable" DataType="Boolean" Description="启用" />
|
||||
<Column Name="Logins" DataType="Int32" Description="登录次数" />
|
||||
<Column Name="LastLogin" DataType="DateTime" Description="最后登录" />
|
||||
<Column Name="LastLoginIP" DataType="String" Description="最后登录IP" />
|
||||
<Column Name="RegisterTime" DataType="DateTime" Description="注册时间" />
|
||||
<Column Name="RegisterIP" DataType="String" Description="注册IP" />
|
||||
<Column Name="Ex1" DataType="Int32" Description="扩展1" />
|
||||
<Column Name="Ex2" DataType="Int32" Description="扩展2" />
|
||||
<Column Name="Ex3" DataType="Double" Description="扩展3" />
|
||||
<Column Name="Ex4" DataType="String" Description="扩展4" />
|
||||
<Column Name="Ex5" DataType="String" Description="扩展5" />
|
||||
<Column Name="Ex6" DataType="String" Description="扩展6" Attribute="XmlIgnore, ScriptIgnore, IgnoreDataMember" />
|
||||
<Column Name="UpdateUser" DataType="String" Description="更新者" />
|
||||
<Column Name="UpdateUserID" DataType="Int32" Description="更新用户" />
|
||||
<Column Name="UpdateIP" DataType="String" Description="更新地址" />
|
||||
<Column Name="UpdateTime" DataType="DateTime" Nullable="False" Description="更新时间" />
|
||||
<Column Name="Remark" DataType="String" Length="200" Description="备注" />
|
||||
</Columns>
|
||||
<Indexes>
|
||||
<Index Columns="Name" Unique="True" />
|
||||
<Index Columns="RoleID" />
|
||||
</Indexes>
|
||||
</Table>
|
||||
<Table Name="Role2" Description="角色">
|
||||
<Columns>
|
||||
<Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
|
||||
<Column Name="Name" DataType="String" Master="True" Nullable="False" Description="名称" />
|
||||
<Column Name="IsSystem" DataType="Boolean" Description="系统。用于业务系统开发使用,不受数据权限约束,禁止修改名称或删除" />
|
||||
<Column Name="Remark" DataType="String" Description="说明" />
|
||||
<Column Name="Permission" DataType="String" Length="500" Description="权限。对不同资源的权限,逗号分隔,每个资源的权限子项竖线分隔" />
|
||||
<Column Name="CreateUserID" DataType="Int32" Description="创建用户" />
|
||||
<Column Name="CreateIP" DataType="String" Description="创建地址" />
|
||||
<Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
|
||||
<Column Name="UpdateUserID" DataType="Int32" Description="更新用户" />
|
||||
<Column Name="UpdateIP" DataType="String" Description="更新地址" />
|
||||
<Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
|
||||
</Columns>
|
||||
<Indexes>
|
||||
<Index Columns="Name" Unique="True" />
|
||||
</Indexes>
|
||||
</Table>
|
||||
<Table Name="Menu2" Description="菜单" BaseType="EntityTree">
|
||||
<Columns>
|
||||
<Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
|
||||
<Column Name="Name" DataType="String" Master="True" Nullable="False" Description="名称" />
|
||||
<Column Name="DisplayName" DataType="String" Description="显示名" />
|
||||
<Column Name="FullName" DataType="String" Length="200" Description="全名" />
|
||||
<Column Name="ParentID" DataType="Int32" Description="父编号" />
|
||||
<Column Name="Url" DataType="String" Length="200" Description="链接" />
|
||||
<Column Name="Sort" DataType="Int32" Description="排序" />
|
||||
<Column Name="Icon" DataType="String" Description="图标" />
|
||||
<Column Name="Visible" DataType="Boolean" Description="可见" />
|
||||
<Column Name="Necessary" DataType="Boolean" Description="必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色" />
|
||||
<Column Name="Permission" DataType="String" Length="200" Description="权限子项。逗号分隔,每个权限子项名值竖线分隔" />
|
||||
<Column Name="Remark" DataType="String" Length="200" Description="备注" />
|
||||
</Columns>
|
||||
<Indexes>
|
||||
<Index Columns="Name" />
|
||||
<Index Columns="ParentID,Name" Unique="True" />
|
||||
</Indexes>
|
||||
</Table>
|
||||
<Table Name="Menu3" TableName="#MenuX" Description="菜单3" BaseType="EntityTree">
|
||||
<Columns>
|
||||
<Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
|
||||
<Column Name="Name" DataType="String" Master="True" Nullable="False" Description="名称" />
|
||||
<Column Name="DisplayName" DataType="String" Description="显示名" />
|
||||
<Column Name="FullName" DataType="String" Length="200" Description="全名" />
|
||||
<Column Name="ParentID" DataType="Int32" Description="父编号" />
|
||||
<Column Name="Url" DataType="String" Length="200" Description="链接" />
|
||||
<Column Name="Sort" DataType="Int32" Description="排序" />
|
||||
<Column Name="Icon" DataType="String" Description="图标" />
|
||||
<Column Name="Visible" DataType="Boolean" Description="可见" />
|
||||
<Column Name="Necessary" DataType="Boolean" Description="必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色" />
|
||||
<Column Name="Permission" DataType="String" Length="200" Description="权限子项。逗号分隔,每个权限子项名值竖线分隔" />
|
||||
<Column Name="Remark" DataType="String" Length="200" Description="备注" />
|
||||
</Columns>
|
||||
</Table>
|
||||
<Table Name="Log2" Description="日志">
|
||||
<Columns>
|
||||
<Column Name="ID" DataType="Int64" PrimaryKey="True" Description="编号" />
|
||||
<Column Name="Category" DataType="String" Description="类别" />
|
||||
<Column Name="Action" DataType="String" Description="操作" />
|
||||
<Column Name="LinkID" DataType="Int32" Description="链接" />
|
||||
<Column Name="Success" DataType="Boolean" Description="成功" />
|
||||
<Column Name="UserName" DataType="String" Description="用户名" />
|
||||
<Column Name="Ex1" DataType="Int32" Description="扩展1" />
|
||||
<Column Name="Ex2" DataType="Int32" Description="扩展2" />
|
||||
<Column Name="Ex3" DataType="Double" Description="扩展3" />
|
||||
<Column Name="Ex4" DataType="String" Description="扩展4" />
|
||||
<Column Name="Ex5" DataType="String" Description="扩展5" />
|
||||
<Column Name="Ex6" DataType="String" Description="扩展6" />
|
||||
<Column Name="CreateUser" DataType="String" Description="创建者" />
|
||||
<Column Name="CreateUserID" DataType="Int32" Description="创建用户" />
|
||||
<Column Name="CreateIP" DataType="String" Description="创建地址" />
|
||||
<Column Name="CreateTime" DataType="DateTime" Nullable="False" Description="时间" />
|
||||
<Column Name="Remark" DataType="Byte[]" Description="详细信息" />
|
||||
</Columns>
|
||||
<Indexes>
|
||||
<Index Columns="Action,Category" />
|
||||
<Index Columns="Action,Category,ID" />
|
||||
<Index Columns="Category,LinkID,ID" />
|
||||
<Index Columns="CreateUserID,ID" />
|
||||
</Indexes>
|
||||
</Table>
|
||||
<Table Name="PowerMeter" TableName="power_meter" Description="电能指标。时序数据">
|
||||
<Columns>
|
||||
<Column Name="Ts" DataType="DateTime" PrimaryKey="True" Description="时间戳" />
|
||||
<Column Name="Current" DataType="Single" Description="电流" />
|
||||
<Column Name="Voltage" DataType="Int32" Description="电压" />
|
||||
<Column Name="Phase" DataType="Single" Description="相位" />
|
||||
<Column Name="Location" DataType="String" Master="True" Length="64" Description="位置" />
|
||||
<Column Name="GroupId" DataType="Int32" Master="True" Description="分组" />
|
||||
</Columns>
|
||||
</Table>
|
||||
<Table Name="CarMeter" TableName="Car_Meter" Description="汽车指标。时序数据">
|
||||
<Columns>
|
||||
<Column Name="Ts" DataType="DateTime" PrimaryKey="True" Description="时间戳" />
|
||||
<Column Name="Speed" DataType="Int32" Description="速度" />
|
||||
<Column Name="Temp" DataType="Single" Description="温度" />
|
||||
</Columns>
|
||||
</Table>
|
||||
</Tables>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<EntityModel xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:schemaLocation="https://newlifex.com https://newlifex.com/Model202407.xsd" Version="11.1.2022.0521" Document="https://newlifex.com/xcode/model" xmlns="https://newlifex.com/Model202407.xsd">
|
||||
<Option>
|
||||
<!--类名模板。其中{name}替换为Table.Name,如{name}Model/I{name}Dto等-->
|
||||
<ClassNameTemplate />
|
||||
<!--显示名模板。其中{displayName}替换为Table.DisplayName-->
|
||||
<DisplayNameTemplate />
|
||||
<!--基类。可能包含基类和接口,其中{name}替换为Table.Name-->
|
||||
<BaseClass>Entity</BaseClass>
|
||||
<!--命名空间-->
|
||||
<Namespace>XUnitTest.XCode.TestEntity</Namespace>
|
||||
<!--输出目录-->
|
||||
<Output>.\</Output>
|
||||
<!--是否使用中文文件名。默认false-->
|
||||
<ChineseFileName>False</ChineseFileName>
|
||||
<!--用于生成Copy函数的参数类型。例如{name}或I{name}-->
|
||||
<ModelNameForCopy />
|
||||
<!--带有索引器。实现IModel接口-->
|
||||
<HasIModel>False</HasIModel>
|
||||
<!--可为null上下文。生成String?等-->
|
||||
<Nullable>False</Nullable>
|
||||
<!--数据库连接名-->
|
||||
<ConnName>test</ConnName>
|
||||
<!--模型类模版。设置后生成模型类,用于接口数据传输,例如{name}Model-->
|
||||
<ModelClass />
|
||||
<!--模型类输出目录。默认当前目录的Models子目录-->
|
||||
<ModelsOutput>.\Models\</ModelsOutput>
|
||||
<!--模型接口模版。设置后生成模型接口,用于约束模型类和实体类,例如I{name}-->
|
||||
<ModelInterface />
|
||||
<!--模型接口输出目录。默认当前目录的Interfaces子目录-->
|
||||
<InterfacesOutput>.\Interfaces\</InterfacesOutput>
|
||||
<!--用户实体转为模型类的模型类。例如{name}或{name}DTO-->
|
||||
<ModelNameForToModel />
|
||||
<!--命名格式。Default/Upper/Lower/Underline-->
|
||||
<NameFormat>Default</NameFormat>
|
||||
<!--魔方区域显示名-->
|
||||
<DisplayName />
|
||||
<!--魔方控制器输出目录-->
|
||||
<CubeOutput />
|
||||
</Option>
|
||||
<Tables>
|
||||
<Table Name="User2" Description="用户">
|
||||
<Columns>
|
||||
<Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
|
||||
<Column Name="Name" DataType="String" Master="True" Nullable="False" Description="名称。登录用户名" />
|
||||
<Column Name="Password" DataType="String" Description="密码" />
|
||||
<Column Name="DisplayName" DataType="String" Description="昵称" />
|
||||
<Column Name="Sex" DataType="Int32" Description="性别。未知、男、女" Type="SexKinds" />
|
||||
<Column Name="Mail" DataType="String" ItemType="mail" Description="邮件" />
|
||||
<Column Name="Mobile" DataType="String" ItemType="mobile" Description="手机" />
|
||||
<Column Name="Code" DataType="String" Description="代码。身份证、员工编号等" />
|
||||
<Column Name="Avatar" DataType="String" ItemType="image" Length="200" Description="头像" />
|
||||
<Column Name="RoleID" DataType="Int32" Description="角色。主要角色" />
|
||||
<Column Name="RoleIds" DataType="String" Length="200" Description="角色组。次要角色集合" />
|
||||
<Column Name="DepartmentID" DataType="Int32" Description="部门。组织机构" />
|
||||
<Column Name="Online" DataType="Boolean" Description="在线" />
|
||||
<Column Name="Enable" DataType="Boolean" Description="启用" />
|
||||
<Column Name="Logins" DataType="Int32" Description="登录次数" />
|
||||
<Column Name="LastLogin" DataType="DateTime" Description="最后登录" />
|
||||
<Column Name="LastLoginIP" DataType="String" Description="最后登录IP" />
|
||||
<Column Name="RegisterTime" DataType="DateTime" Description="注册时间" />
|
||||
<Column Name="RegisterIP" DataType="String" Description="注册IP" />
|
||||
<Column Name="Ex1" DataType="Int32" Description="扩展1" />
|
||||
<Column Name="Ex2" DataType="Int32" Description="扩展2" />
|
||||
<Column Name="Ex3" DataType="Double" Description="扩展3" />
|
||||
<Column Name="Ex4" DataType="String" Description="扩展4" />
|
||||
<Column Name="Ex5" DataType="String" Description="扩展5" />
|
||||
<Column Name="Ex6" DataType="String" Description="扩展6" Attribute="XmlIgnore, ScriptIgnore, IgnoreDataMember" />
|
||||
<Column Name="UpdateUser" DataType="String" Description="更新者" />
|
||||
<Column Name="UpdateUserID" DataType="Int32" Description="更新用户" />
|
||||
<Column Name="UpdateIP" DataType="String" Description="更新地址" />
|
||||
<Column Name="UpdateTime" DataType="DateTime" Nullable="False" Description="更新时间" />
|
||||
<Column Name="Remark" DataType="String" Length="200" Description="备注" />
|
||||
</Columns>
|
||||
<Indexes>
|
||||
<Index Columns="Name" Unique="True" />
|
||||
<Index Columns="RoleID" />
|
||||
</Indexes>
|
||||
</Table>
|
||||
<Table Name="Role2" Description="角色">
|
||||
<Columns>
|
||||
<Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
|
||||
<Column Name="Name" DataType="String" Master="True" Nullable="False" Description="名称" />
|
||||
<Column Name="IsSystem" DataType="Boolean" Description="系统。用于业务系统开发使用,不受数据权限约束,禁止修改名称或删除" />
|
||||
<Column Name="Remark" DataType="String" Description="说明" />
|
||||
<Column Name="Permission" DataType="String" Length="500" Description="权限。对不同资源的权限,逗号分隔,每个资源的权限子项竖线分隔" />
|
||||
<Column Name="CreateUserID" DataType="Int32" Description="创建用户" />
|
||||
<Column Name="CreateIP" DataType="String" Description="创建地址" />
|
||||
<Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
|
||||
<Column Name="UpdateUserID" DataType="Int32" Description="更新用户" />
|
||||
<Column Name="UpdateIP" DataType="String" Description="更新地址" />
|
||||
<Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
|
||||
</Columns>
|
||||
<Indexes>
|
||||
<Index Columns="Name" Unique="True" />
|
||||
</Indexes>
|
||||
</Table>
|
||||
<Table Name="Menu2" Description="菜单" BaseType="EntityTree">
|
||||
<Columns>
|
||||
<Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
|
||||
<Column Name="Name" DataType="String" Master="True" Nullable="False" Description="名称" />
|
||||
<Column Name="DisplayName" DataType="String" Description="显示名" />
|
||||
<Column Name="FullName" DataType="String" Length="200" Description="全名" />
|
||||
<Column Name="ParentID" DataType="Int32" Description="父编号" />
|
||||
<Column Name="Url" DataType="String" Length="200" Description="链接" />
|
||||
<Column Name="Sort" DataType="Int32" Description="排序" />
|
||||
<Column Name="Icon" DataType="String" Description="图标" />
|
||||
<Column Name="Visible" DataType="Boolean" Description="可见" />
|
||||
<Column Name="Necessary" DataType="Boolean" Description="必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色" />
|
||||
<Column Name="Permission" DataType="String" Length="200" Description="权限子项。逗号分隔,每个权限子项名值竖线分隔" />
|
||||
<Column Name="Remark" DataType="String" Length="200" Description="备注" />
|
||||
</Columns>
|
||||
<Indexes>
|
||||
<Index Columns="Name" />
|
||||
<Index Columns="ParentID,Name" Unique="True" />
|
||||
</Indexes>
|
||||
</Table>
|
||||
<Table Name="Menu3" TableName="#MenuX" Description="菜单3" BaseType="EntityTree">
|
||||
<Columns>
|
||||
<Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
|
||||
<Column Name="Name" DataType="String" Master="True" Nullable="False" Description="名称" />
|
||||
<Column Name="DisplayName" DataType="String" Description="显示名" />
|
||||
<Column Name="FullName" DataType="String" Length="200" Description="全名" />
|
||||
<Column Name="ParentID" DataType="Int32" Description="父编号" />
|
||||
<Column Name="Url" DataType="String" Length="200" Description="链接" />
|
||||
<Column Name="Sort" DataType="Int32" Description="排序" />
|
||||
<Column Name="Icon" DataType="String" Description="图标" />
|
||||
<Column Name="Visible" DataType="Boolean" Description="可见" />
|
||||
<Column Name="Necessary" DataType="Boolean" Description="必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色" />
|
||||
<Column Name="Permission" DataType="String" Length="200" Description="权限子项。逗号分隔,每个权限子项名值竖线分隔" />
|
||||
<Column Name="Remark" DataType="String" Length="200" Description="备注" />
|
||||
</Columns>
|
||||
</Table>
|
||||
<Table Name="Log2" Description="日志">
|
||||
<Columns>
|
||||
<Column Name="ID" DataType="Int64" PrimaryKey="True" DataScale="time" Description="编号" />
|
||||
<Column Name="Category" DataType="String" Description="类别" />
|
||||
<Column Name="Action" DataType="String" Description="操作" />
|
||||
<Column Name="LinkID" DataType="Int32" Description="链接" />
|
||||
<Column Name="Success" DataType="Boolean" Description="成功" />
|
||||
<Column Name="UserName" DataType="String" Description="用户名" />
|
||||
<Column Name="Ex1" DataType="Int32" Description="扩展1" />
|
||||
<Column Name="Ex2" DataType="Int32" Description="扩展2" />
|
||||
<Column Name="Ex3" DataType="Double" Description="扩展3" />
|
||||
<Column Name="Ex4" DataType="String" Description="扩展4" />
|
||||
<Column Name="Ex5" DataType="String" Description="扩展5" />
|
||||
<Column Name="Ex6" DataType="String" Description="扩展6" />
|
||||
<Column Name="CreateUser" DataType="String" Description="创建者" />
|
||||
<Column Name="CreateUserID" DataType="Int32" Description="创建用户" />
|
||||
<Column Name="CreateIP" DataType="String" Description="创建地址" />
|
||||
<Column Name="CreateTime" DataType="DateTime" Nullable="False" Description="时间" />
|
||||
<Column Name="Remark" DataType="Byte[]" Description="详细信息" />
|
||||
</Columns>
|
||||
<Indexes>
|
||||
<Index Columns="Action,Category" />
|
||||
<Index Columns="Action,Category,ID" />
|
||||
<Index Columns="Category,LinkID,ID" />
|
||||
<Index Columns="CreateUserID,ID" />
|
||||
</Indexes>
|
||||
</Table>
|
||||
<Table Name="PowerMeter" TableName="power_meter" Description="电能指标。时序数据">
|
||||
<Columns>
|
||||
<Column Name="Ts" DataType="DateTime" PrimaryKey="True" Description="时间戳" />
|
||||
<Column Name="Current" DataType="Single" Description="电流" />
|
||||
<Column Name="Voltage" DataType="Int32" Description="电压" />
|
||||
<Column Name="Phase" DataType="Single" Description="相位" />
|
||||
<Column Name="Location" DataType="String" Master="True" Length="64" Description="位置" />
|
||||
<Column Name="GroupId" DataType="Int32" Master="True" Description="分组" />
|
||||
</Columns>
|
||||
</Table>
|
||||
<Table Name="CarMeter" TableName="Car_Meter" Description="汽车指标。时序数据">
|
||||
<Columns>
|
||||
<Column Name="Ts" DataType="DateTime" PrimaryKey="True" Description="时间戳" />
|
||||
<Column Name="Speed" DataType="Int32" Description="速度" />
|
||||
<Column Name="Temp" DataType="Single" Description="温度" />
|
||||
</Columns>
|
||||
</Table>
|
||||
</Tables>
|
||||
</EntityModel>
|
Binary file not shown.
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using NewLife;
|
||||
using XCode;
|
||||
using XCode.Configuration;
|
||||
using XCode.DataAccessLayer;
|
||||
|
|
|
@ -1,334 +1,382 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using XCode;
|
||||
using XCode.Cache;
|
||||
using XCode.Configuration;
|
||||
using XCode.DataAccessLayer;
|
||||
|
||||
namespace XUnitTest.XCode.TestEntity
|
||||
namespace XUnitTest.XCode.TestEntity;
|
||||
|
||||
/// <summary>日志</summary>
|
||||
[Serializable]
|
||||
[DataObject]
|
||||
[Description("日志")]
|
||||
[BindIndex("IX_Log2_Action_Category", false, "Action,Category")]
|
||||
[BindIndex("IX_Log2_Action_Category_ID", false, "Action,Category,ID")]
|
||||
[BindIndex("IX_Log2_Category_LinkID_ID", false, "Category,LinkID,ID")]
|
||||
[BindIndex("IX_Log2_CreateUserID_ID", false, "CreateUserID,ID")]
|
||||
[BindTable("Log2", Description = "日志", ConnName = "test", DbType = DatabaseType.None)]
|
||||
public partial class Log2
|
||||
{
|
||||
/// <summary>日志</summary>
|
||||
[Serializable]
|
||||
[DataObject]
|
||||
[Description("日志")]
|
||||
[BindIndex("IX_Log2_Action_Category", false, "Action,Category")]
|
||||
[BindIndex("IX_Log2_Action_Category_ID", false, "Action,Category,ID")]
|
||||
[BindIndex("IX_Log2_Category_LinkID_ID", false, "Category,LinkID,ID")]
|
||||
[BindIndex("IX_Log2_Category_LinkID_ID", false, "Category,LinkID,ID")]
|
||||
[BindIndex("IX_Log2_CreateUserID_ID", false, "CreateUserID,ID")]
|
||||
[BindTable("Log2", Description = "日志", ConnName = "test", DbType = DatabaseType.None)]
|
||||
public partial class Log2
|
||||
#region 属性
|
||||
private Int64 _ID;
|
||||
/// <summary>编号</summary>
|
||||
[DisplayName("编号")]
|
||||
[Description("编号")]
|
||||
[DataObjectField(true, false, false, 0)]
|
||||
[BindColumn("ID", "编号", "", DataScale = "time")]
|
||||
public Int64 ID { get => _ID; set { if (OnPropertyChanging("ID", value)) { _ID = value; OnPropertyChanged("ID"); } } }
|
||||
|
||||
private String _Category;
|
||||
/// <summary>类别</summary>
|
||||
[DisplayName("类别")]
|
||||
[Description("类别")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Category", "类别", "")]
|
||||
public String Category { get => _Category; set { if (OnPropertyChanging("Category", value)) { _Category = value; OnPropertyChanged("Category"); } } }
|
||||
|
||||
private String _Action;
|
||||
/// <summary>操作</summary>
|
||||
[DisplayName("操作")]
|
||||
[Description("操作")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Action", "操作", "")]
|
||||
public String Action { get => _Action; set { if (OnPropertyChanging("Action", value)) { _Action = value; OnPropertyChanged("Action"); } } }
|
||||
|
||||
private Int32 _LinkID;
|
||||
/// <summary>链接</summary>
|
||||
[DisplayName("链接")]
|
||||
[Description("链接")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("LinkID", "链接", "")]
|
||||
public Int32 LinkID { get => _LinkID; set { if (OnPropertyChanging("LinkID", value)) { _LinkID = value; OnPropertyChanged("LinkID"); } } }
|
||||
|
||||
private Boolean _Success;
|
||||
/// <summary>成功</summary>
|
||||
[DisplayName("成功")]
|
||||
[Description("成功")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Success", "成功", "")]
|
||||
public Boolean Success { get => _Success; set { if (OnPropertyChanging("Success", value)) { _Success = value; OnPropertyChanged("Success"); } } }
|
||||
|
||||
private String _UserName;
|
||||
/// <summary>用户名</summary>
|
||||
[DisplayName("用户名")]
|
||||
[Description("用户名")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("UserName", "用户名", "")]
|
||||
public String UserName { get => _UserName; set { if (OnPropertyChanging("UserName", value)) { _UserName = value; OnPropertyChanged("UserName"); } } }
|
||||
|
||||
private Int32 _Ex1;
|
||||
/// <summary>扩展1</summary>
|
||||
[DisplayName("扩展1")]
|
||||
[Description("扩展1")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Ex1", "扩展1", "")]
|
||||
public Int32 Ex1 { get => _Ex1; set { if (OnPropertyChanging("Ex1", value)) { _Ex1 = value; OnPropertyChanged("Ex1"); } } }
|
||||
|
||||
private Int32 _Ex2;
|
||||
/// <summary>扩展2</summary>
|
||||
[DisplayName("扩展2")]
|
||||
[Description("扩展2")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Ex2", "扩展2", "")]
|
||||
public Int32 Ex2 { get => _Ex2; set { if (OnPropertyChanging("Ex2", value)) { _Ex2 = value; OnPropertyChanged("Ex2"); } } }
|
||||
|
||||
private Double _Ex3;
|
||||
/// <summary>扩展3</summary>
|
||||
[DisplayName("扩展3")]
|
||||
[Description("扩展3")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Ex3", "扩展3", "")]
|
||||
public Double Ex3 { get => _Ex3; set { if (OnPropertyChanging("Ex3", value)) { _Ex3 = value; OnPropertyChanged("Ex3"); } } }
|
||||
|
||||
private String _Ex4;
|
||||
/// <summary>扩展4</summary>
|
||||
[DisplayName("扩展4")]
|
||||
[Description("扩展4")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Ex4", "扩展4", "")]
|
||||
public String Ex4 { get => _Ex4; set { if (OnPropertyChanging("Ex4", value)) { _Ex4 = value; OnPropertyChanged("Ex4"); } } }
|
||||
|
||||
private String _Ex5;
|
||||
/// <summary>扩展5</summary>
|
||||
[DisplayName("扩展5")]
|
||||
[Description("扩展5")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Ex5", "扩展5", "")]
|
||||
public String Ex5 { get => _Ex5; set { if (OnPropertyChanging("Ex5", value)) { _Ex5 = value; OnPropertyChanged("Ex5"); } } }
|
||||
|
||||
private String _Ex6;
|
||||
/// <summary>扩展6</summary>
|
||||
[DisplayName("扩展6")]
|
||||
[Description("扩展6")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Ex6", "扩展6", "")]
|
||||
public String Ex6 { get => _Ex6; set { if (OnPropertyChanging("Ex6", value)) { _Ex6 = value; OnPropertyChanged("Ex6"); } } }
|
||||
|
||||
private String _CreateUser;
|
||||
/// <summary>创建者</summary>
|
||||
[DisplayName("创建者")]
|
||||
[Description("创建者")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("CreateUser", "创建者", "")]
|
||||
public String CreateUser { get => _CreateUser; set { if (OnPropertyChanging("CreateUser", value)) { _CreateUser = value; OnPropertyChanged("CreateUser"); } } }
|
||||
|
||||
private Int32 _CreateUserID;
|
||||
/// <summary>创建用户</summary>
|
||||
[DisplayName("创建用户")]
|
||||
[Description("创建用户")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("CreateUserID", "创建用户", "")]
|
||||
public Int32 CreateUserID { get => _CreateUserID; set { if (OnPropertyChanging("CreateUserID", value)) { _CreateUserID = value; OnPropertyChanged("CreateUserID"); } } }
|
||||
|
||||
private String _CreateIP;
|
||||
/// <summary>创建地址</summary>
|
||||
[DisplayName("创建地址")]
|
||||
[Description("创建地址")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("CreateIP", "创建地址", "")]
|
||||
public String CreateIP { get => _CreateIP; set { if (OnPropertyChanging("CreateIP", value)) { _CreateIP = value; OnPropertyChanged("CreateIP"); } } }
|
||||
|
||||
private DateTime _CreateTime;
|
||||
/// <summary>时间</summary>
|
||||
[DisplayName("时间")]
|
||||
[Description("时间")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("CreateTime", "时间", "")]
|
||||
public DateTime CreateTime { get => _CreateTime; set { if (OnPropertyChanging("CreateTime", value)) { _CreateTime = value; OnPropertyChanged("CreateTime"); } } }
|
||||
|
||||
private Byte[] _Remark;
|
||||
/// <summary>详细信息</summary>
|
||||
[DisplayName("详细信息")]
|
||||
[Description("详细信息")]
|
||||
[DataObjectField(false, false, true, 0)]
|
||||
[BindColumn("Remark", "详细信息", "")]
|
||||
public Byte[] Remark { get => _Remark; set { if (OnPropertyChanging("Remark", value)) { _Remark = value; OnPropertyChanged("Remark"); } } }
|
||||
#endregion
|
||||
|
||||
#region 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
public override Object this[String name]
|
||||
{
|
||||
#region 属性
|
||||
private Int64 _ID;
|
||||
/// <summary>编号</summary>
|
||||
[DisplayName("编号")]
|
||||
[Description("编号")]
|
||||
[DataObjectField(true, false, false, 0)]
|
||||
[BindColumn("ID", "编号", "")]
|
||||
public Int64 ID { get => _ID; set { if (OnPropertyChanging("ID", value)) { _ID = value; OnPropertyChanged("ID"); } } }
|
||||
|
||||
private String _Category;
|
||||
/// <summary>类别</summary>
|
||||
[DisplayName("类别")]
|
||||
[Description("类别")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Category", "类别", "")]
|
||||
public String Category { get => _Category; set { if (OnPropertyChanging("Category", value)) { _Category = value; OnPropertyChanged("Category"); } } }
|
||||
|
||||
private String _Action;
|
||||
/// <summary>操作</summary>
|
||||
[DisplayName("操作")]
|
||||
[Description("操作")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Action", "操作", "")]
|
||||
public String Action { get => _Action; set { if (OnPropertyChanging("Action", value)) { _Action = value; OnPropertyChanged("Action"); } } }
|
||||
|
||||
private Int32 _LinkID;
|
||||
/// <summary>链接</summary>
|
||||
[DisplayName("链接")]
|
||||
[Description("链接")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("LinkID", "链接", "")]
|
||||
public Int32 LinkID { get => _LinkID; set { if (OnPropertyChanging("LinkID", value)) { _LinkID = value; OnPropertyChanged("LinkID"); } } }
|
||||
|
||||
private Boolean _Success;
|
||||
/// <summary>成功</summary>
|
||||
[DisplayName("成功")]
|
||||
[Description("成功")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Success", "成功", "")]
|
||||
public Boolean Success { get => _Success; set { if (OnPropertyChanging("Success", value)) { _Success = value; OnPropertyChanged("Success"); } } }
|
||||
|
||||
private String _UserName;
|
||||
/// <summary>用户名</summary>
|
||||
[DisplayName("用户名")]
|
||||
[Description("用户名")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("UserName", "用户名", "")]
|
||||
public String UserName { get => _UserName; set { if (OnPropertyChanging("UserName", value)) { _UserName = value; OnPropertyChanged("UserName"); } } }
|
||||
|
||||
private Int32 _Ex1;
|
||||
/// <summary>扩展1</summary>
|
||||
[DisplayName("扩展1")]
|
||||
[Description("扩展1")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Ex1", "扩展1", "")]
|
||||
public Int32 Ex1 { get => _Ex1; set { if (OnPropertyChanging("Ex1", value)) { _Ex1 = value; OnPropertyChanged("Ex1"); } } }
|
||||
|
||||
private Int32 _Ex2;
|
||||
/// <summary>扩展2</summary>
|
||||
[DisplayName("扩展2")]
|
||||
[Description("扩展2")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Ex2", "扩展2", "")]
|
||||
public Int32 Ex2 { get => _Ex2; set { if (OnPropertyChanging("Ex2", value)) { _Ex2 = value; OnPropertyChanged("Ex2"); } } }
|
||||
|
||||
private Double _Ex3;
|
||||
/// <summary>扩展3</summary>
|
||||
[DisplayName("扩展3")]
|
||||
[Description("扩展3")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Ex3", "扩展3", "")]
|
||||
public Double Ex3 { get => _Ex3; set { if (OnPropertyChanging("Ex3", value)) { _Ex3 = value; OnPropertyChanged("Ex3"); } } }
|
||||
|
||||
private String _Ex4;
|
||||
/// <summary>扩展4</summary>
|
||||
[DisplayName("扩展4")]
|
||||
[Description("扩展4")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Ex4", "扩展4", "")]
|
||||
public String Ex4 { get => _Ex4; set { if (OnPropertyChanging("Ex4", value)) { _Ex4 = value; OnPropertyChanged("Ex4"); } } }
|
||||
|
||||
private String _Ex5;
|
||||
/// <summary>扩展5</summary>
|
||||
[DisplayName("扩展5")]
|
||||
[Description("扩展5")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Ex5", "扩展5", "")]
|
||||
public String Ex5 { get => _Ex5; set { if (OnPropertyChanging("Ex5", value)) { _Ex5 = value; OnPropertyChanged("Ex5"); } } }
|
||||
|
||||
private String _Ex6;
|
||||
/// <summary>扩展6</summary>
|
||||
[DisplayName("扩展6")]
|
||||
[Description("扩展6")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Ex6", "扩展6", "")]
|
||||
public String Ex6 { get => _Ex6; set { if (OnPropertyChanging("Ex6", value)) { _Ex6 = value; OnPropertyChanged("Ex6"); } } }
|
||||
|
||||
private String _CreateUser;
|
||||
/// <summary>创建者</summary>
|
||||
[DisplayName("创建者")]
|
||||
[Description("创建者")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("CreateUser", "创建者", "")]
|
||||
public String CreateUser { get => _CreateUser; set { if (OnPropertyChanging("CreateUser", value)) { _CreateUser = value; OnPropertyChanged("CreateUser"); } } }
|
||||
|
||||
private Int32 _CreateUserID;
|
||||
/// <summary>创建用户</summary>
|
||||
[DisplayName("创建用户")]
|
||||
[Description("创建用户")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("CreateUserID", "创建用户", "")]
|
||||
public Int32 CreateUserID { get => _CreateUserID; set { if (OnPropertyChanging("CreateUserID", value)) { _CreateUserID = value; OnPropertyChanged("CreateUserID"); } } }
|
||||
|
||||
private String _CreateIP;
|
||||
/// <summary>创建地址</summary>
|
||||
[DisplayName("创建地址")]
|
||||
[Description("创建地址")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("CreateIP", "创建地址", "")]
|
||||
public String CreateIP { get => _CreateIP; set { if (OnPropertyChanging("CreateIP", value)) { _CreateIP = value; OnPropertyChanged("CreateIP"); } } }
|
||||
|
||||
private DateTime _CreateTime;
|
||||
/// <summary>时间</summary>
|
||||
[DisplayName("时间")]
|
||||
[Description("时间")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("CreateTime", "时间", "")]
|
||||
public DateTime CreateTime { get => _CreateTime; set { if (OnPropertyChanging("CreateTime", value)) { _CreateTime = value; OnPropertyChanged("CreateTime"); } } }
|
||||
|
||||
private Byte[] _Remark;
|
||||
/// <summary>详细信息</summary>
|
||||
[DisplayName("详细信息")]
|
||||
[Description("详细信息")]
|
||||
[DataObjectField(false, false, true, 0)]
|
||||
[BindColumn("Remark", "详细信息", "")]
|
||||
public Byte[] Remark { get => _Remark; set { if (OnPropertyChanging("Remark", value)) { _Remark = value; OnPropertyChanged("Remark"); } } }
|
||||
#endregion
|
||||
|
||||
#region 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
public override Object this[String name]
|
||||
get => name switch
|
||||
{
|
||||
get
|
||||
"ID" => _ID,
|
||||
"Category" => _Category,
|
||||
"Action" => _Action,
|
||||
"LinkID" => _LinkID,
|
||||
"Success" => _Success,
|
||||
"UserName" => _UserName,
|
||||
"Ex1" => _Ex1,
|
||||
"Ex2" => _Ex2,
|
||||
"Ex3" => _Ex3,
|
||||
"Ex4" => _Ex4,
|
||||
"Ex5" => _Ex5,
|
||||
"Ex6" => _Ex6,
|
||||
"CreateUser" => _CreateUser,
|
||||
"CreateUserID" => _CreateUserID,
|
||||
"CreateIP" => _CreateIP,
|
||||
"CreateTime" => _CreateTime,
|
||||
"Remark" => _Remark,
|
||||
_ => base[name]
|
||||
};
|
||||
set
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "ID": return _ID;
|
||||
case "Category": return _Category;
|
||||
case "Action": return _Action;
|
||||
case "LinkID": return _LinkID;
|
||||
case "Success": return _Success;
|
||||
case "UserName": return _UserName;
|
||||
case "Ex1": return _Ex1;
|
||||
case "Ex2": return _Ex2;
|
||||
case "Ex3": return _Ex3;
|
||||
case "Ex4": return _Ex4;
|
||||
case "Ex5": return _Ex5;
|
||||
case "Ex6": return _Ex6;
|
||||
case "CreateUser": return _CreateUser;
|
||||
case "CreateUserID": return _CreateUserID;
|
||||
case "CreateIP": return _CreateIP;
|
||||
case "CreateTime": return _CreateTime;
|
||||
case "Remark": return _Remark;
|
||||
default: return base[name];
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "ID": _ID = value.ToLong(); break;
|
||||
case "Category": _Category = Convert.ToString(value); break;
|
||||
case "Action": _Action = Convert.ToString(value); break;
|
||||
case "LinkID": _LinkID = value.ToInt(); break;
|
||||
case "Success": _Success = value.ToBoolean(); break;
|
||||
case "UserName": _UserName = Convert.ToString(value); break;
|
||||
case "Ex1": _Ex1 = value.ToInt(); break;
|
||||
case "Ex2": _Ex2 = value.ToInt(); break;
|
||||
case "Ex3": _Ex3 = value.ToDouble(); break;
|
||||
case "Ex4": _Ex4 = Convert.ToString(value); break;
|
||||
case "Ex5": _Ex5 = Convert.ToString(value); break;
|
||||
case "Ex6": _Ex6 = Convert.ToString(value); break;
|
||||
case "CreateUser": _CreateUser = Convert.ToString(value); break;
|
||||
case "CreateUserID": _CreateUserID = value.ToInt(); break;
|
||||
case "CreateIP": _CreateIP = Convert.ToString(value); break;
|
||||
case "CreateTime": _CreateTime = value.ToDateTime(); break;
|
||||
case "Remark": _Remark = (Byte[])value; break;
|
||||
default: base[name] = value; break;
|
||||
}
|
||||
case "ID": _ID = value.ToLong(); break;
|
||||
case "Category": _Category = Convert.ToString(value); break;
|
||||
case "Action": _Action = Convert.ToString(value); break;
|
||||
case "LinkID": _LinkID = value.ToInt(); break;
|
||||
case "Success": _Success = value.ToBoolean(); break;
|
||||
case "UserName": _UserName = Convert.ToString(value); break;
|
||||
case "Ex1": _Ex1 = value.ToInt(); break;
|
||||
case "Ex2": _Ex2 = value.ToInt(); break;
|
||||
case "Ex3": _Ex3 = value.ToDouble(); break;
|
||||
case "Ex4": _Ex4 = Convert.ToString(value); break;
|
||||
case "Ex5": _Ex5 = Convert.ToString(value); break;
|
||||
case "Ex6": _Ex6 = Convert.ToString(value); break;
|
||||
case "CreateUser": _CreateUser = Convert.ToString(value); break;
|
||||
case "CreateUserID": _CreateUserID = value.ToInt(); break;
|
||||
case "CreateIP": _CreateIP = Convert.ToString(value); break;
|
||||
case "CreateTime": _CreateTime = value.ToDateTime(); break;
|
||||
case "Remark": _Remark = (Byte[])value; break;
|
||||
default: base[name] = value; break;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得日志字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public static readonly Field ID = FindByName("ID");
|
||||
|
||||
/// <summary>类别</summary>
|
||||
public static readonly Field Category = FindByName("Category");
|
||||
|
||||
/// <summary>操作</summary>
|
||||
public static readonly Field Action = FindByName("Action");
|
||||
|
||||
/// <summary>链接</summary>
|
||||
public static readonly Field LinkID = FindByName("LinkID");
|
||||
|
||||
/// <summary>成功</summary>
|
||||
public static readonly Field Success = FindByName("Success");
|
||||
|
||||
/// <summary>用户名</summary>
|
||||
public static readonly Field UserName = FindByName("UserName");
|
||||
|
||||
/// <summary>扩展1</summary>
|
||||
public static readonly Field Ex1 = FindByName("Ex1");
|
||||
|
||||
/// <summary>扩展2</summary>
|
||||
public static readonly Field Ex2 = FindByName("Ex2");
|
||||
|
||||
/// <summary>扩展3</summary>
|
||||
public static readonly Field Ex3 = FindByName("Ex3");
|
||||
|
||||
/// <summary>扩展4</summary>
|
||||
public static readonly Field Ex4 = FindByName("Ex4");
|
||||
|
||||
/// <summary>扩展5</summary>
|
||||
public static readonly Field Ex5 = FindByName("Ex5");
|
||||
|
||||
/// <summary>扩展6</summary>
|
||||
public static readonly Field Ex6 = FindByName("Ex6");
|
||||
|
||||
/// <summary>创建者</summary>
|
||||
public static readonly Field CreateUser = FindByName("CreateUser");
|
||||
|
||||
/// <summary>创建用户</summary>
|
||||
public static readonly Field CreateUserID = FindByName("CreateUserID");
|
||||
|
||||
/// <summary>创建地址</summary>
|
||||
public static readonly Field CreateIP = FindByName("CreateIP");
|
||||
|
||||
/// <summary>时间</summary>
|
||||
public static readonly Field CreateTime = FindByName("CreateTime");
|
||||
|
||||
/// <summary>详细信息</summary>
|
||||
public static readonly Field Remark = FindByName("Remark");
|
||||
|
||||
static Field FindByName(String name) => Meta.Table.FindByName(name);
|
||||
}
|
||||
|
||||
/// <summary>取得日志字段名称的快捷方式</summary>
|
||||
public partial class __
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public const String ID = "ID";
|
||||
|
||||
/// <summary>类别</summary>
|
||||
public const String Category = "Category";
|
||||
|
||||
/// <summary>操作</summary>
|
||||
public const String Action = "Action";
|
||||
|
||||
/// <summary>链接</summary>
|
||||
public const String LinkID = "LinkID";
|
||||
|
||||
/// <summary>成功</summary>
|
||||
public const String Success = "Success";
|
||||
|
||||
/// <summary>用户名</summary>
|
||||
public const String UserName = "UserName";
|
||||
|
||||
/// <summary>扩展1</summary>
|
||||
public const String Ex1 = "Ex1";
|
||||
|
||||
/// <summary>扩展2</summary>
|
||||
public const String Ex2 = "Ex2";
|
||||
|
||||
/// <summary>扩展3</summary>
|
||||
public const String Ex3 = "Ex3";
|
||||
|
||||
/// <summary>扩展4</summary>
|
||||
public const String Ex4 = "Ex4";
|
||||
|
||||
/// <summary>扩展5</summary>
|
||||
public const String Ex5 = "Ex5";
|
||||
|
||||
/// <summary>扩展6</summary>
|
||||
public const String Ex6 = "Ex6";
|
||||
|
||||
/// <summary>创建者</summary>
|
||||
public const String CreateUser = "CreateUser";
|
||||
|
||||
/// <summary>创建用户</summary>
|
||||
public const String CreateUserID = "CreateUserID";
|
||||
|
||||
/// <summary>创建地址</summary>
|
||||
public const String CreateIP = "CreateIP";
|
||||
|
||||
/// <summary>时间</summary>
|
||||
public const String CreateTime = "CreateTime";
|
||||
|
||||
/// <summary>详细信息</summary>
|
||||
public const String Remark = "Remark";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
/// <summary>根据操作、类别查找</summary>
|
||||
/// <param name="action">操作</param>
|
||||
/// <param name="category">类别</param>
|
||||
/// <returns>实体列表</returns>
|
||||
public static IList<Log2> FindAllByActionAndCategory(String action, String category)
|
||||
{
|
||||
if (action.IsNullOrEmpty()) return [];
|
||||
if (category.IsNullOrEmpty()) return [];
|
||||
|
||||
return FindAll(_.Action == action & _.Category == category);
|
||||
}
|
||||
|
||||
/// <summary>根据类别、链接查找</summary>
|
||||
/// <param name="category">类别</param>
|
||||
/// <param name="linkId">链接</param>
|
||||
/// <returns>实体列表</returns>
|
||||
public static IList<Log2> FindAllByCategoryAndLinkID(String category, Int32 linkId)
|
||||
{
|
||||
if (category.IsNullOrEmpty()) return [];
|
||||
if (linkId < 0) return [];
|
||||
|
||||
return FindAll(_.Category == category & _.LinkID == linkId);
|
||||
}
|
||||
|
||||
/// <summary>根据操作查找</summary>
|
||||
/// <param name="action">操作</param>
|
||||
/// <returns>实体列表</returns>
|
||||
public static IList<Log2> FindAllByAction(String action)
|
||||
{
|
||||
if (action.IsNullOrEmpty()) return [];
|
||||
|
||||
return FindAll(_.Action == action);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 数据清理
|
||||
/// <summary>清理指定时间段内的数据</summary>
|
||||
/// <param name="start">开始时间。未指定时清理小于指定时间的所有数据</param>
|
||||
/// <param name="end">结束时间</param>
|
||||
/// <returns>清理行数</returns>
|
||||
public static Int32 DeleteWith(DateTime start, DateTime end)
|
||||
{
|
||||
return Delete(_.ID.Between(start, end, Meta.Factory.Snow));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得日志字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public static readonly Field ID = FindByName("ID");
|
||||
|
||||
/// <summary>类别</summary>
|
||||
public static readonly Field Category = FindByName("Category");
|
||||
|
||||
/// <summary>操作</summary>
|
||||
public static readonly Field Action = FindByName("Action");
|
||||
|
||||
/// <summary>链接</summary>
|
||||
public static readonly Field LinkID = FindByName("LinkID");
|
||||
|
||||
/// <summary>成功</summary>
|
||||
public static readonly Field Success = FindByName("Success");
|
||||
|
||||
/// <summary>用户名</summary>
|
||||
public static readonly Field UserName = FindByName("UserName");
|
||||
|
||||
/// <summary>扩展1</summary>
|
||||
public static readonly Field Ex1 = FindByName("Ex1");
|
||||
|
||||
/// <summary>扩展2</summary>
|
||||
public static readonly Field Ex2 = FindByName("Ex2");
|
||||
|
||||
/// <summary>扩展3</summary>
|
||||
public static readonly Field Ex3 = FindByName("Ex3");
|
||||
|
||||
/// <summary>扩展4</summary>
|
||||
public static readonly Field Ex4 = FindByName("Ex4");
|
||||
|
||||
/// <summary>扩展5</summary>
|
||||
public static readonly Field Ex5 = FindByName("Ex5");
|
||||
|
||||
/// <summary>扩展6</summary>
|
||||
public static readonly Field Ex6 = FindByName("Ex6");
|
||||
|
||||
/// <summary>创建者</summary>
|
||||
public static readonly Field CreateUser = FindByName("CreateUser");
|
||||
|
||||
/// <summary>创建用户</summary>
|
||||
public static readonly Field CreateUserID = FindByName("CreateUserID");
|
||||
|
||||
/// <summary>创建地址</summary>
|
||||
public static readonly Field CreateIP = FindByName("CreateIP");
|
||||
|
||||
/// <summary>时间</summary>
|
||||
public static readonly Field CreateTime = FindByName("CreateTime");
|
||||
|
||||
/// <summary>详细信息</summary>
|
||||
public static readonly Field Remark = FindByName("Remark");
|
||||
|
||||
static Field FindByName(String name) => Meta.Table.FindByName(name);
|
||||
}
|
||||
|
||||
/// <summary>取得日志字段名称的快捷方式</summary>
|
||||
public partial class __
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public const String ID = "ID";
|
||||
|
||||
/// <summary>类别</summary>
|
||||
public const String Category = "Category";
|
||||
|
||||
/// <summary>操作</summary>
|
||||
public const String Action = "Action";
|
||||
|
||||
/// <summary>链接</summary>
|
||||
public const String LinkID = "LinkID";
|
||||
|
||||
/// <summary>成功</summary>
|
||||
public const String Success = "Success";
|
||||
|
||||
/// <summary>用户名</summary>
|
||||
public const String UserName = "UserName";
|
||||
|
||||
/// <summary>扩展1</summary>
|
||||
public const String Ex1 = "Ex1";
|
||||
|
||||
/// <summary>扩展2</summary>
|
||||
public const String Ex2 = "Ex2";
|
||||
|
||||
/// <summary>扩展3</summary>
|
||||
public const String Ex3 = "Ex3";
|
||||
|
||||
/// <summary>扩展4</summary>
|
||||
public const String Ex4 = "Ex4";
|
||||
|
||||
/// <summary>扩展5</summary>
|
||||
public const String Ex5 = "Ex5";
|
||||
|
||||
/// <summary>扩展6</summary>
|
||||
public const String Ex6 = "Ex6";
|
||||
|
||||
/// <summary>创建者</summary>
|
||||
public const String CreateUser = "CreateUser";
|
||||
|
||||
/// <summary>创建用户</summary>
|
||||
public const String CreateUserID = "CreateUserID";
|
||||
|
||||
/// <summary>创建地址</summary>
|
||||
public const String CreateIP = "CreateIP";
|
||||
|
||||
/// <summary>时间</summary>
|
||||
public const String CreateTime = "CreateTime";
|
||||
|
||||
/// <summary>详细信息</summary>
|
||||
public const String Remark = "Remark";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -1,105 +1,110 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using XCode;
|
||||
using XCode.Cache;
|
||||
using XCode.Configuration;
|
||||
using XCode.DataAccessLayer;
|
||||
|
||||
namespace XUnitTest.XCode.TestEntity
|
||||
namespace XUnitTest.XCode.TestEntity;
|
||||
|
||||
/// <summary>汽车指标。时序数据</summary>
|
||||
[Serializable]
|
||||
[DataObject]
|
||||
[Description("汽车指标。时序数据")]
|
||||
[BindTable("Car_Meter", Description = "汽车指标。时序数据", ConnName = "test", DbType = DatabaseType.None)]
|
||||
public partial class CarMeter
|
||||
{
|
||||
/// <summary>汽车指标。时序数据</summary>
|
||||
[Serializable]
|
||||
[DataObject]
|
||||
[Description("汽车指标。时序数据")]
|
||||
[BindTable("Car_Meter", Description = "汽车指标。时序数据", ConnName = "test", DbType = DatabaseType.None)]
|
||||
public partial class CarMeter
|
||||
#region 属性
|
||||
private DateTime _Ts;
|
||||
/// <summary>时间戳</summary>
|
||||
[DisplayName("时间戳")]
|
||||
[Description("时间戳")]
|
||||
[DataObjectField(true, false, true, 0)]
|
||||
[BindColumn("Ts", "时间戳", "")]
|
||||
public DateTime Ts { get => _Ts; set { if (OnPropertyChanging("Ts", value)) { _Ts = value; OnPropertyChanged("Ts"); } } }
|
||||
|
||||
private Int32 _Speed;
|
||||
/// <summary>速度</summary>
|
||||
[DisplayName("速度")]
|
||||
[Description("速度")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Speed", "速度", "")]
|
||||
public Int32 Speed { get => _Speed; set { if (OnPropertyChanging("Speed", value)) { _Speed = value; OnPropertyChanged("Speed"); } } }
|
||||
|
||||
private Single _Temp;
|
||||
/// <summary>温度</summary>
|
||||
[DisplayName("温度")]
|
||||
[Description("温度")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Temp", "温度", "")]
|
||||
public Single Temp { get => _Temp; set { if (OnPropertyChanging("Temp", value)) { _Temp = value; OnPropertyChanged("Temp"); } } }
|
||||
#endregion
|
||||
|
||||
#region 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
public override Object this[String name]
|
||||
{
|
||||
#region 属性
|
||||
private DateTime _Ts;
|
||||
/// <summary>时间戳</summary>
|
||||
[DisplayName("时间戳")]
|
||||
[Description("时间戳")]
|
||||
[DataObjectField(true, false, true, 0)]
|
||||
[BindColumn("Ts", "时间戳", "")]
|
||||
public DateTime Ts { get => _Ts; set { if (OnPropertyChanging("Ts", value)) { _Ts = value; OnPropertyChanged("Ts"); } } }
|
||||
|
||||
private Int32 _Speed;
|
||||
/// <summary>速度</summary>
|
||||
[DisplayName("速度")]
|
||||
[Description("速度")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Speed", "速度", "")]
|
||||
public Int32 Speed { get => _Speed; set { if (OnPropertyChanging("Speed", value)) { _Speed = value; OnPropertyChanged("Speed"); } } }
|
||||
|
||||
private Single _Temp;
|
||||
/// <summary>温度</summary>
|
||||
[DisplayName("温度")]
|
||||
[Description("温度")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Temp", "温度", "")]
|
||||
public Single Temp { get => _Temp; set { if (OnPropertyChanging("Temp", value)) { _Temp = value; OnPropertyChanged("Temp"); } } }
|
||||
#endregion
|
||||
|
||||
#region 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
public override Object this[String name]
|
||||
get => name switch
|
||||
{
|
||||
get
|
||||
"Ts" => _Ts,
|
||||
"Speed" => _Speed,
|
||||
"Temp" => _Temp,
|
||||
_ => base[name]
|
||||
};
|
||||
set
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "Ts": return _Ts;
|
||||
case "Speed": return _Speed;
|
||||
case "Temp": return _Temp;
|
||||
default: return base[name];
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "Ts": _Ts = value.ToDateTime(); break;
|
||||
case "Speed": _Speed = value.ToInt(); break;
|
||||
case "Temp": _Temp = Convert.ToSingle(value); break;
|
||||
default: base[name] = value; break;
|
||||
}
|
||||
case "Ts": _Ts = value.ToDateTime(); break;
|
||||
case "Speed": _Speed = value.ToInt(); break;
|
||||
case "Temp": _Temp = Convert.ToSingle(value); break;
|
||||
default: base[name] = value; break;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得汽车指标字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
{
|
||||
/// <summary>时间戳</summary>
|
||||
public static readonly Field Ts = FindByName("Ts");
|
||||
|
||||
/// <summary>速度</summary>
|
||||
public static readonly Field Speed = FindByName("Speed");
|
||||
|
||||
/// <summary>温度</summary>
|
||||
public static readonly Field Temp = FindByName("Temp");
|
||||
|
||||
static Field FindByName(String name) => Meta.Table.FindByName(name);
|
||||
}
|
||||
|
||||
/// <summary>取得汽车指标字段名称的快捷方式</summary>
|
||||
public partial class __
|
||||
{
|
||||
/// <summary>时间戳</summary>
|
||||
public const String Ts = "Ts";
|
||||
|
||||
/// <summary>速度</summary>
|
||||
public const String Speed = "Speed";
|
||||
|
||||
/// <summary>温度</summary>
|
||||
public const String Temp = "Temp";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得汽车指标字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
{
|
||||
/// <summary>时间戳</summary>
|
||||
public static readonly Field Ts = FindByName("Ts");
|
||||
|
||||
/// <summary>速度</summary>
|
||||
public static readonly Field Speed = FindByName("Speed");
|
||||
|
||||
/// <summary>温度</summary>
|
||||
public static readonly Field Temp = FindByName("Temp");
|
||||
|
||||
static Field FindByName(String name) => Meta.Table.FindByName(name);
|
||||
}
|
||||
|
||||
/// <summary>取得汽车指标字段名称的快捷方式</summary>
|
||||
public partial class __
|
||||
{
|
||||
/// <summary>时间戳</summary>
|
||||
public const String Ts = "Ts";
|
||||
|
||||
/// <summary>速度</summary>
|
||||
public const String Speed = "Speed";
|
||||
|
||||
/// <summary>温度</summary>
|
||||
public const String Temp = "Temp";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,153 +1,158 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using XCode;
|
||||
using XCode.Cache;
|
||||
using XCode.Configuration;
|
||||
using XCode.DataAccessLayer;
|
||||
|
||||
namespace XUnitTest.XCode.TestEntity
|
||||
namespace XUnitTest.XCode.TestEntity;
|
||||
|
||||
/// <summary>电能指标。时序数据</summary>
|
||||
[Serializable]
|
||||
[DataObject]
|
||||
[Description("电能指标。时序数据")]
|
||||
[BindTable("power_meter", Description = "电能指标。时序数据", ConnName = "test", DbType = DatabaseType.None)]
|
||||
public partial class PowerMeter
|
||||
{
|
||||
/// <summary>电能指标。时序数据</summary>
|
||||
[Serializable]
|
||||
[DataObject]
|
||||
[Description("电能指标。时序数据")]
|
||||
[BindTable("power_meter", Description = "电能指标。时序数据", ConnName = "test", DbType = DatabaseType.None)]
|
||||
public partial class PowerMeter
|
||||
#region 属性
|
||||
private DateTime _Ts;
|
||||
/// <summary>时间戳</summary>
|
||||
[DisplayName("时间戳")]
|
||||
[Description("时间戳")]
|
||||
[DataObjectField(true, false, true, 0)]
|
||||
[BindColumn("Ts", "时间戳", "")]
|
||||
public DateTime Ts { get => _Ts; set { if (OnPropertyChanging("Ts", value)) { _Ts = value; OnPropertyChanged("Ts"); } } }
|
||||
|
||||
private Single _Current;
|
||||
/// <summary>电流</summary>
|
||||
[DisplayName("电流")]
|
||||
[Description("电流")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Current", "电流", "")]
|
||||
public Single Current { get => _Current; set { if (OnPropertyChanging("Current", value)) { _Current = value; OnPropertyChanged("Current"); } } }
|
||||
|
||||
private Int32 _Voltage;
|
||||
/// <summary>电压</summary>
|
||||
[DisplayName("电压")]
|
||||
[Description("电压")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Voltage", "电压", "")]
|
||||
public Int32 Voltage { get => _Voltage; set { if (OnPropertyChanging("Voltage", value)) { _Voltage = value; OnPropertyChanged("Voltage"); } } }
|
||||
|
||||
private Single _Phase;
|
||||
/// <summary>相位</summary>
|
||||
[DisplayName("相位")]
|
||||
[Description("相位")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Phase", "相位", "")]
|
||||
public Single Phase { get => _Phase; set { if (OnPropertyChanging("Phase", value)) { _Phase = value; OnPropertyChanged("Phase"); } } }
|
||||
|
||||
private String _Location;
|
||||
/// <summary>位置</summary>
|
||||
[DisplayName("位置")]
|
||||
[Description("位置")]
|
||||
[DataObjectField(false, false, true, 64)]
|
||||
[BindColumn("Location", "位置", "", Master = true)]
|
||||
public String Location { get => _Location; set { if (OnPropertyChanging("Location", value)) { _Location = value; OnPropertyChanged("Location"); } } }
|
||||
|
||||
private Int32 _GroupId;
|
||||
/// <summary>分组</summary>
|
||||
[DisplayName("分组")]
|
||||
[Description("分组")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("GroupId", "分组", "", Master = true)]
|
||||
public Int32 GroupId { get => _GroupId; set { if (OnPropertyChanging("GroupId", value)) { _GroupId = value; OnPropertyChanged("GroupId"); } } }
|
||||
#endregion
|
||||
|
||||
#region 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
public override Object this[String name]
|
||||
{
|
||||
#region 属性
|
||||
private DateTime _Ts;
|
||||
/// <summary>时间戳</summary>
|
||||
[DisplayName("时间戳")]
|
||||
[Description("时间戳")]
|
||||
[DataObjectField(true, false, true, 0)]
|
||||
[BindColumn("Ts", "时间戳", "")]
|
||||
public DateTime Ts { get => _Ts; set { if (OnPropertyChanging("Ts", value)) { _Ts = value; OnPropertyChanged("Ts"); } } }
|
||||
|
||||
private Single _Current;
|
||||
/// <summary>电流</summary>
|
||||
[DisplayName("电流")]
|
||||
[Description("电流")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Current", "电流", "")]
|
||||
public Single Current { get => _Current; set { if (OnPropertyChanging("Current", value)) { _Current = value; OnPropertyChanged("Current"); } } }
|
||||
|
||||
private Int32 _Voltage;
|
||||
/// <summary>电压</summary>
|
||||
[DisplayName("电压")]
|
||||
[Description("电压")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Voltage", "电压", "")]
|
||||
public Int32 Voltage { get => _Voltage; set { if (OnPropertyChanging("Voltage", value)) { _Voltage = value; OnPropertyChanged("Voltage"); } } }
|
||||
|
||||
private Single _Phase;
|
||||
/// <summary>相位</summary>
|
||||
[DisplayName("相位")]
|
||||
[Description("相位")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Phase", "相位", "")]
|
||||
public Single Phase { get => _Phase; set { if (OnPropertyChanging("Phase", value)) { _Phase = value; OnPropertyChanged("Phase"); } } }
|
||||
|
||||
private String _Location;
|
||||
/// <summary>位置</summary>
|
||||
[DisplayName("位置")]
|
||||
[Description("位置")]
|
||||
[DataObjectField(false, false, true, 64)]
|
||||
[BindColumn("Location", "位置", "", Master = true)]
|
||||
public String Location { get => _Location; set { if (OnPropertyChanging("Location", value)) { _Location = value; OnPropertyChanged("Location"); } } }
|
||||
|
||||
private Int32 _GroupId;
|
||||
/// <summary>分组</summary>
|
||||
[DisplayName("分组")]
|
||||
[Description("分组")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("GroupId", "分组", "", Master = true)]
|
||||
public Int32 GroupId { get => _GroupId; set { if (OnPropertyChanging("GroupId", value)) { _GroupId = value; OnPropertyChanged("GroupId"); } } }
|
||||
#endregion
|
||||
|
||||
#region 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
public override Object this[String name]
|
||||
get => name switch
|
||||
{
|
||||
get
|
||||
"Ts" => _Ts,
|
||||
"Current" => _Current,
|
||||
"Voltage" => _Voltage,
|
||||
"Phase" => _Phase,
|
||||
"Location" => _Location,
|
||||
"GroupId" => _GroupId,
|
||||
_ => base[name]
|
||||
};
|
||||
set
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "Ts": return _Ts;
|
||||
case "Current": return _Current;
|
||||
case "Voltage": return _Voltage;
|
||||
case "Phase": return _Phase;
|
||||
case "Location": return _Location;
|
||||
case "GroupId": return _GroupId;
|
||||
default: return base[name];
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "Ts": _Ts = value.ToDateTime(); break;
|
||||
case "Current": _Current = Convert.ToSingle(value); break;
|
||||
case "Voltage": _Voltage = value.ToInt(); break;
|
||||
case "Phase": _Phase = Convert.ToSingle(value); break;
|
||||
case "Location": _Location = Convert.ToString(value); break;
|
||||
case "GroupId": _GroupId = value.ToInt(); break;
|
||||
default: base[name] = value; break;
|
||||
}
|
||||
case "Ts": _Ts = value.ToDateTime(); break;
|
||||
case "Current": _Current = Convert.ToSingle(value); break;
|
||||
case "Voltage": _Voltage = value.ToInt(); break;
|
||||
case "Phase": _Phase = Convert.ToSingle(value); break;
|
||||
case "Location": _Location = Convert.ToString(value); break;
|
||||
case "GroupId": _GroupId = value.ToInt(); break;
|
||||
default: base[name] = value; break;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得电能指标字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
{
|
||||
/// <summary>时间戳</summary>
|
||||
public static readonly Field Ts = FindByName("Ts");
|
||||
|
||||
/// <summary>电流</summary>
|
||||
public static readonly Field Current = FindByName("Current");
|
||||
|
||||
/// <summary>电压</summary>
|
||||
public static readonly Field Voltage = FindByName("Voltage");
|
||||
|
||||
/// <summary>相位</summary>
|
||||
public static readonly Field Phase = FindByName("Phase");
|
||||
|
||||
/// <summary>位置</summary>
|
||||
public static readonly Field Location = FindByName("Location");
|
||||
|
||||
/// <summary>分组</summary>
|
||||
public static readonly Field GroupId = FindByName("GroupId");
|
||||
|
||||
static Field FindByName(String name) => Meta.Table.FindByName(name);
|
||||
}
|
||||
|
||||
/// <summary>取得电能指标字段名称的快捷方式</summary>
|
||||
public partial class __
|
||||
{
|
||||
/// <summary>时间戳</summary>
|
||||
public const String Ts = "Ts";
|
||||
|
||||
/// <summary>电流</summary>
|
||||
public const String Current = "Current";
|
||||
|
||||
/// <summary>电压</summary>
|
||||
public const String Voltage = "Voltage";
|
||||
|
||||
/// <summary>相位</summary>
|
||||
public const String Phase = "Phase";
|
||||
|
||||
/// <summary>位置</summary>
|
||||
public const String Location = "Location";
|
||||
|
||||
/// <summary>分组</summary>
|
||||
public const String GroupId = "GroupId";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得电能指标字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
{
|
||||
/// <summary>时间戳</summary>
|
||||
public static readonly Field Ts = FindByName("Ts");
|
||||
|
||||
/// <summary>电流</summary>
|
||||
public static readonly Field Current = FindByName("Current");
|
||||
|
||||
/// <summary>电压</summary>
|
||||
public static readonly Field Voltage = FindByName("Voltage");
|
||||
|
||||
/// <summary>相位</summary>
|
||||
public static readonly Field Phase = FindByName("Phase");
|
||||
|
||||
/// <summary>位置</summary>
|
||||
public static readonly Field Location = FindByName("Location");
|
||||
|
||||
/// <summary>分组</summary>
|
||||
public static readonly Field GroupId = FindByName("GroupId");
|
||||
|
||||
static Field FindByName(String name) => Meta.Table.FindByName(name);
|
||||
}
|
||||
|
||||
/// <summary>取得电能指标字段名称的快捷方式</summary>
|
||||
public partial class __
|
||||
{
|
||||
/// <summary>时间戳</summary>
|
||||
public const String Ts = "Ts";
|
||||
|
||||
/// <summary>电流</summary>
|
||||
public const String Current = "Current";
|
||||
|
||||
/// <summary>电压</summary>
|
||||
public const String Voltage = "Voltage";
|
||||
|
||||
/// <summary>相位</summary>
|
||||
public const String Phase = "Phase";
|
||||
|
||||
/// <summary>位置</summary>
|
||||
public const String Location = "Location";
|
||||
|
||||
/// <summary>分组</summary>
|
||||
public const String GroupId = "GroupId";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -1,251 +1,268 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using XCode;
|
||||
using XCode.Cache;
|
||||
using XCode.Configuration;
|
||||
using XCode.DataAccessLayer;
|
||||
|
||||
namespace XUnitTest.XCode.TestEntity
|
||||
namespace XUnitTest.XCode.TestEntity;
|
||||
|
||||
/// <summary>菜单</summary>
|
||||
[Serializable]
|
||||
[DataObject]
|
||||
[Description("菜单")]
|
||||
[BindIndex("IX_Menu2_Name", false, "Name")]
|
||||
[BindIndex("IU_Menu2_ParentID_Name", true, "ParentID,Name")]
|
||||
[BindTable("Menu2", Description = "菜单", ConnName = "test", DbType = DatabaseType.None)]
|
||||
public partial class Menu2
|
||||
{
|
||||
/// <summary>菜单</summary>
|
||||
[Serializable]
|
||||
[DataObject]
|
||||
[Description("菜单")]
|
||||
[BindIndex("IX_Menu2_Name", false, "Name")]
|
||||
[BindIndex("IU_Menu2_ParentID_Name", true, "ParentID,Name")]
|
||||
[BindTable("Menu2", Description = "菜单", ConnName = "test", DbType = DatabaseType.None)]
|
||||
public partial class Menu2
|
||||
#region 属性
|
||||
private Int32 _ID;
|
||||
/// <summary>编号</summary>
|
||||
[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 _Name;
|
||||
/// <summary>名称</summary>
|
||||
[DisplayName("名称")]
|
||||
[Description("名称")]
|
||||
[DataObjectField(false, false, false, 50)]
|
||||
[BindColumn("Name", "名称", "", Master = true)]
|
||||
public String Name { get => _Name; set { if (OnPropertyChanging("Name", value)) { _Name = value; OnPropertyChanged("Name"); } } }
|
||||
|
||||
private String _DisplayName;
|
||||
/// <summary>显示名</summary>
|
||||
[DisplayName("显示名")]
|
||||
[Description("显示名")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("DisplayName", "显示名", "")]
|
||||
public String DisplayName { get => _DisplayName; set { if (OnPropertyChanging("DisplayName", value)) { _DisplayName = value; OnPropertyChanged("DisplayName"); } } }
|
||||
|
||||
private String _FullName;
|
||||
/// <summary>全名</summary>
|
||||
[DisplayName("全名")]
|
||||
[Description("全名")]
|
||||
[DataObjectField(false, false, true, 200)]
|
||||
[BindColumn("FullName", "全名", "")]
|
||||
public String FullName { get => _FullName; set { if (OnPropertyChanging("FullName", value)) { _FullName = value; OnPropertyChanged("FullName"); } } }
|
||||
|
||||
private Int32 _ParentID;
|
||||
/// <summary>父编号</summary>
|
||||
[DisplayName("父编号")]
|
||||
[Description("父编号")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("ParentID", "父编号", "")]
|
||||
public Int32 ParentID { get => _ParentID; set { if (OnPropertyChanging("ParentID", value)) { _ParentID = value; OnPropertyChanged("ParentID"); } } }
|
||||
|
||||
private String _Url;
|
||||
/// <summary>链接</summary>
|
||||
[DisplayName("链接")]
|
||||
[Description("链接")]
|
||||
[DataObjectField(false, false, true, 200)]
|
||||
[BindColumn("Url", "链接", "")]
|
||||
public String Url { get => _Url; set { if (OnPropertyChanging("Url", value)) { _Url = value; OnPropertyChanged("Url"); } } }
|
||||
|
||||
private Int32 _Sort;
|
||||
/// <summary>排序</summary>
|
||||
[DisplayName("排序")]
|
||||
[Description("排序")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Sort", "排序", "")]
|
||||
public Int32 Sort { get => _Sort; set { if (OnPropertyChanging("Sort", value)) { _Sort = value; OnPropertyChanged("Sort"); } } }
|
||||
|
||||
private String _Icon;
|
||||
/// <summary>图标</summary>
|
||||
[DisplayName("图标")]
|
||||
[Description("图标")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Icon", "图标", "")]
|
||||
public String Icon { get => _Icon; set { if (OnPropertyChanging("Icon", value)) { _Icon = value; OnPropertyChanged("Icon"); } } }
|
||||
|
||||
private Boolean _Visible;
|
||||
/// <summary>可见</summary>
|
||||
[DisplayName("可见")]
|
||||
[Description("可见")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Visible", "可见", "")]
|
||||
public Boolean Visible { get => _Visible; set { if (OnPropertyChanging("Visible", value)) { _Visible = value; OnPropertyChanged("Visible"); } } }
|
||||
|
||||
private Boolean _Necessary;
|
||||
/// <summary>必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色</summary>
|
||||
[DisplayName("必要")]
|
||||
[Description("必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Necessary", "必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色", "")]
|
||||
public Boolean Necessary { get => _Necessary; set { if (OnPropertyChanging("Necessary", value)) { _Necessary = value; OnPropertyChanged("Necessary"); } } }
|
||||
|
||||
private String _Permission;
|
||||
/// <summary>权限子项。逗号分隔,每个权限子项名值竖线分隔</summary>
|
||||
[DisplayName("权限子项")]
|
||||
[Description("权限子项。逗号分隔,每个权限子项名值竖线分隔")]
|
||||
[DataObjectField(false, false, true, 200)]
|
||||
[BindColumn("Permission", "权限子项。逗号分隔,每个权限子项名值竖线分隔", "")]
|
||||
public String Permission { get => _Permission; set { if (OnPropertyChanging("Permission", value)) { _Permission = value; OnPropertyChanged("Permission"); } } }
|
||||
|
||||
private String _Remark;
|
||||
/// <summary>备注</summary>
|
||||
[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 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
public override Object this[String name]
|
||||
{
|
||||
#region 属性
|
||||
private Int32 _ID;
|
||||
/// <summary>编号</summary>
|
||||
[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 _Name;
|
||||
/// <summary>名称</summary>
|
||||
[DisplayName("名称")]
|
||||
[Description("名称")]
|
||||
[DataObjectField(false, false, false, 50)]
|
||||
[BindColumn("Name", "名称", "", Master = true)]
|
||||
public String Name { get => _Name; set { if (OnPropertyChanging("Name", value)) { _Name = value; OnPropertyChanged("Name"); } } }
|
||||
|
||||
private String _DisplayName;
|
||||
/// <summary>显示名</summary>
|
||||
[DisplayName("显示名")]
|
||||
[Description("显示名")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("DisplayName", "显示名", "")]
|
||||
public String DisplayName { get => _DisplayName; set { if (OnPropertyChanging("DisplayName", value)) { _DisplayName = value; OnPropertyChanged("DisplayName"); } } }
|
||||
|
||||
private String _FullName;
|
||||
/// <summary>全名</summary>
|
||||
[DisplayName("全名")]
|
||||
[Description("全名")]
|
||||
[DataObjectField(false, false, true, 200)]
|
||||
[BindColumn("FullName", "全名", "")]
|
||||
public String FullName { get => _FullName; set { if (OnPropertyChanging("FullName", value)) { _FullName = value; OnPropertyChanged("FullName"); } } }
|
||||
|
||||
private Int32 _ParentID;
|
||||
/// <summary>父编号</summary>
|
||||
[DisplayName("父编号")]
|
||||
[Description("父编号")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("ParentID", "父编号", "")]
|
||||
public Int32 ParentID { get => _ParentID; set { if (OnPropertyChanging("ParentID", value)) { _ParentID = value; OnPropertyChanged("ParentID"); } } }
|
||||
|
||||
private String _Url;
|
||||
/// <summary>链接</summary>
|
||||
[DisplayName("链接")]
|
||||
[Description("链接")]
|
||||
[DataObjectField(false, false, true, 200)]
|
||||
[BindColumn("Url", "链接", "")]
|
||||
public String Url { get => _Url; set { if (OnPropertyChanging("Url", value)) { _Url = value; OnPropertyChanged("Url"); } } }
|
||||
|
||||
private Int32 _Sort;
|
||||
/// <summary>排序</summary>
|
||||
[DisplayName("排序")]
|
||||
[Description("排序")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Sort", "排序", "")]
|
||||
public Int32 Sort { get => _Sort; set { if (OnPropertyChanging("Sort", value)) { _Sort = value; OnPropertyChanged("Sort"); } } }
|
||||
|
||||
private String _Icon;
|
||||
/// <summary>图标</summary>
|
||||
[DisplayName("图标")]
|
||||
[Description("图标")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Icon", "图标", "")]
|
||||
public String Icon { get => _Icon; set { if (OnPropertyChanging("Icon", value)) { _Icon = value; OnPropertyChanged("Icon"); } } }
|
||||
|
||||
private Boolean _Visible;
|
||||
/// <summary>可见</summary>
|
||||
[DisplayName("可见")]
|
||||
[Description("可见")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Visible", "可见", "")]
|
||||
public Boolean Visible { get => _Visible; set { if (OnPropertyChanging("Visible", value)) { _Visible = value; OnPropertyChanged("Visible"); } } }
|
||||
|
||||
private Boolean _Necessary;
|
||||
/// <summary>必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色</summary>
|
||||
[DisplayName("必要")]
|
||||
[Description("必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Necessary", "必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色", "")]
|
||||
public Boolean Necessary { get => _Necessary; set { if (OnPropertyChanging("Necessary", value)) { _Necessary = value; OnPropertyChanged("Necessary"); } } }
|
||||
|
||||
private String _Permission;
|
||||
/// <summary>权限子项。逗号分隔,每个权限子项名值竖线分隔</summary>
|
||||
[DisplayName("权限子项")]
|
||||
[Description("权限子项。逗号分隔,每个权限子项名值竖线分隔")]
|
||||
[DataObjectField(false, false, true, 200)]
|
||||
[BindColumn("Permission", "权限子项。逗号分隔,每个权限子项名值竖线分隔", "")]
|
||||
public String Permission { get => _Permission; set { if (OnPropertyChanging("Permission", value)) { _Permission = value; OnPropertyChanged("Permission"); } } }
|
||||
|
||||
private String _Remark;
|
||||
/// <summary>备注</summary>
|
||||
[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 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
public override Object this[String name]
|
||||
get => name switch
|
||||
{
|
||||
get
|
||||
"ID" => _ID,
|
||||
"Name" => _Name,
|
||||
"DisplayName" => _DisplayName,
|
||||
"FullName" => _FullName,
|
||||
"ParentID" => _ParentID,
|
||||
"Url" => _Url,
|
||||
"Sort" => _Sort,
|
||||
"Icon" => _Icon,
|
||||
"Visible" => _Visible,
|
||||
"Necessary" => _Necessary,
|
||||
"Permission" => _Permission,
|
||||
"Remark" => _Remark,
|
||||
_ => base[name]
|
||||
};
|
||||
set
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "ID": return _ID;
|
||||
case "Name": return _Name;
|
||||
case "DisplayName": return _DisplayName;
|
||||
case "FullName": return _FullName;
|
||||
case "ParentID": return _ParentID;
|
||||
case "Url": return _Url;
|
||||
case "Sort": return _Sort;
|
||||
case "Icon": return _Icon;
|
||||
case "Visible": return _Visible;
|
||||
case "Necessary": return _Necessary;
|
||||
case "Permission": return _Permission;
|
||||
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 "DisplayName": _DisplayName = Convert.ToString(value); break;
|
||||
case "FullName": _FullName = Convert.ToString(value); break;
|
||||
case "ParentID": _ParentID = value.ToInt(); break;
|
||||
case "Url": _Url = Convert.ToString(value); break;
|
||||
case "Sort": _Sort = value.ToInt(); break;
|
||||
case "Icon": _Icon = Convert.ToString(value); break;
|
||||
case "Visible": _Visible = value.ToBoolean(); break;
|
||||
case "Necessary": _Necessary = value.ToBoolean(); break;
|
||||
case "Permission": _Permission = Convert.ToString(value); break;
|
||||
case "Remark": _Remark = Convert.ToString(value); break;
|
||||
default: base[name] = value; break;
|
||||
}
|
||||
case "ID": _ID = value.ToInt(); break;
|
||||
case "Name": _Name = Convert.ToString(value); break;
|
||||
case "DisplayName": _DisplayName = Convert.ToString(value); break;
|
||||
case "FullName": _FullName = Convert.ToString(value); break;
|
||||
case "ParentID": _ParentID = value.ToInt(); break;
|
||||
case "Url": _Url = Convert.ToString(value); break;
|
||||
case "Sort": _Sort = value.ToInt(); break;
|
||||
case "Icon": _Icon = Convert.ToString(value); break;
|
||||
case "Visible": _Visible = value.ToBoolean(); break;
|
||||
case "Necessary": _Necessary = value.ToBoolean(); break;
|
||||
case "Permission": _Permission = Convert.ToString(value); break;
|
||||
case "Remark": _Remark = Convert.ToString(value); break;
|
||||
default: base[name] = value; break;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得菜单字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public static readonly Field ID = FindByName("ID");
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public static readonly Field Name = FindByName("Name");
|
||||
|
||||
/// <summary>显示名</summary>
|
||||
public static readonly Field DisplayName = FindByName("DisplayName");
|
||||
|
||||
/// <summary>全名</summary>
|
||||
public static readonly Field FullName = FindByName("FullName");
|
||||
|
||||
/// <summary>父编号</summary>
|
||||
public static readonly Field ParentID = FindByName("ParentID");
|
||||
|
||||
/// <summary>链接</summary>
|
||||
public static readonly Field Url = FindByName("Url");
|
||||
|
||||
/// <summary>排序</summary>
|
||||
public static readonly Field Sort = FindByName("Sort");
|
||||
|
||||
/// <summary>图标</summary>
|
||||
public static readonly Field Icon = FindByName("Icon");
|
||||
|
||||
/// <summary>可见</summary>
|
||||
public static readonly Field Visible = FindByName("Visible");
|
||||
|
||||
/// <summary>必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色</summary>
|
||||
public static readonly Field Necessary = FindByName("Necessary");
|
||||
|
||||
/// <summary>权限子项。逗号分隔,每个权限子项名值竖线分隔</summary>
|
||||
public static readonly Field Permission = FindByName("Permission");
|
||||
|
||||
/// <summary>备注</summary>
|
||||
public static readonly Field Remark = FindByName("Remark");
|
||||
|
||||
static Field FindByName(String name) => Meta.Table.FindByName(name);
|
||||
}
|
||||
|
||||
/// <summary>取得菜单字段名称的快捷方式</summary>
|
||||
public partial class __
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public const String ID = "ID";
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public const String Name = "Name";
|
||||
|
||||
/// <summary>显示名</summary>
|
||||
public const String DisplayName = "DisplayName";
|
||||
|
||||
/// <summary>全名</summary>
|
||||
public const String FullName = "FullName";
|
||||
|
||||
/// <summary>父编号</summary>
|
||||
public const String ParentID = "ParentID";
|
||||
|
||||
/// <summary>链接</summary>
|
||||
public const String Url = "Url";
|
||||
|
||||
/// <summary>排序</summary>
|
||||
public const String Sort = "Sort";
|
||||
|
||||
/// <summary>图标</summary>
|
||||
public const String Icon = "Icon";
|
||||
|
||||
/// <summary>可见</summary>
|
||||
public const String Visible = "Visible";
|
||||
|
||||
/// <summary>必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色</summary>
|
||||
public const String Necessary = "Necessary";
|
||||
|
||||
/// <summary>权限子项。逗号分隔,每个权限子项名值竖线分隔</summary>
|
||||
public const String Permission = "Permission";
|
||||
|
||||
/// <summary>备注</summary>
|
||||
public const String Remark = "Remark";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
/// <summary>根据父编号查找</summary>
|
||||
/// <param name="parentId">父编号</param>
|
||||
/// <returns>实体列表</returns>
|
||||
public static IList<Menu2> FindAllByParentID(Int32 parentId)
|
||||
{
|
||||
if (parentId < 0) return [];
|
||||
|
||||
// 实体缓存
|
||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.ParentID == parentId);
|
||||
|
||||
return FindAll(_.ParentID == parentId);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得菜单字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public static readonly Field ID = FindByName("ID");
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public static readonly Field Name = FindByName("Name");
|
||||
|
||||
/// <summary>显示名</summary>
|
||||
public static readonly Field DisplayName = FindByName("DisplayName");
|
||||
|
||||
/// <summary>全名</summary>
|
||||
public static readonly Field FullName = FindByName("FullName");
|
||||
|
||||
/// <summary>父编号</summary>
|
||||
public static readonly Field ParentID = FindByName("ParentID");
|
||||
|
||||
/// <summary>链接</summary>
|
||||
public static readonly Field Url = FindByName("Url");
|
||||
|
||||
/// <summary>排序</summary>
|
||||
public static readonly Field Sort = FindByName("Sort");
|
||||
|
||||
/// <summary>图标</summary>
|
||||
public static readonly Field Icon = FindByName("Icon");
|
||||
|
||||
/// <summary>可见</summary>
|
||||
public static readonly Field Visible = FindByName("Visible");
|
||||
|
||||
/// <summary>必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色</summary>
|
||||
public static readonly Field Necessary = FindByName("Necessary");
|
||||
|
||||
/// <summary>权限子项。逗号分隔,每个权限子项名值竖线分隔</summary>
|
||||
public static readonly Field Permission = FindByName("Permission");
|
||||
|
||||
/// <summary>备注</summary>
|
||||
public static readonly Field Remark = FindByName("Remark");
|
||||
|
||||
static Field FindByName(String name) => Meta.Table.FindByName(name);
|
||||
}
|
||||
|
||||
/// <summary>取得菜单字段名称的快捷方式</summary>
|
||||
public partial class __
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public const String ID = "ID";
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public const String Name = "Name";
|
||||
|
||||
/// <summary>显示名</summary>
|
||||
public const String DisplayName = "DisplayName";
|
||||
|
||||
/// <summary>全名</summary>
|
||||
public const String FullName = "FullName";
|
||||
|
||||
/// <summary>父编号</summary>
|
||||
public const String ParentID = "ParentID";
|
||||
|
||||
/// <summary>链接</summary>
|
||||
public const String Url = "Url";
|
||||
|
||||
/// <summary>排序</summary>
|
||||
public const String Sort = "Sort";
|
||||
|
||||
/// <summary>图标</summary>
|
||||
public const String Icon = "Icon";
|
||||
|
||||
/// <summary>可见</summary>
|
||||
public const String Visible = "Visible";
|
||||
|
||||
/// <summary>必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色</summary>
|
||||
public const String Necessary = "Necessary";
|
||||
|
||||
/// <summary>权限子项。逗号分隔,每个权限子项名值竖线分隔</summary>
|
||||
public const String Permission = "Permission";
|
||||
|
||||
/// <summary>备注</summary>
|
||||
public const String Remark = "Remark";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -1,249 +1,254 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using XCode;
|
||||
using XCode.Cache;
|
||||
using XCode.Configuration;
|
||||
using XCode.DataAccessLayer;
|
||||
|
||||
namespace XUnitTest.XCode.TestEntity
|
||||
namespace XUnitTest.XCode.TestEntity;
|
||||
|
||||
/// <summary>菜单3</summary>
|
||||
[Serializable]
|
||||
[DataObject]
|
||||
[Description("菜单3")]
|
||||
[BindTable("#MenuX", Description = "菜单3", ConnName = "test", DbType = DatabaseType.None)]
|
||||
public partial class Menu3
|
||||
{
|
||||
/// <summary>菜单3</summary>
|
||||
[Serializable]
|
||||
[DataObject]
|
||||
[Description("菜单3")]
|
||||
[BindTable("#MenuX", Description = "菜单3", ConnName = "test", DbType = DatabaseType.None)]
|
||||
public partial class Menu3
|
||||
#region 属性
|
||||
private Int32 _ID;
|
||||
/// <summary>编号</summary>
|
||||
[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 _Name;
|
||||
/// <summary>名称</summary>
|
||||
[DisplayName("名称")]
|
||||
[Description("名称")]
|
||||
[DataObjectField(false, false, false, 50)]
|
||||
[BindColumn("Name", "名称", "", Master = true)]
|
||||
public String Name { get => _Name; set { if (OnPropertyChanging("Name", value)) { _Name = value; OnPropertyChanged("Name"); } } }
|
||||
|
||||
private String _DisplayName;
|
||||
/// <summary>显示名</summary>
|
||||
[DisplayName("显示名")]
|
||||
[Description("显示名")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("DisplayName", "显示名", "")]
|
||||
public String DisplayName { get => _DisplayName; set { if (OnPropertyChanging("DisplayName", value)) { _DisplayName = value; OnPropertyChanged("DisplayName"); } } }
|
||||
|
||||
private String _FullName;
|
||||
/// <summary>全名</summary>
|
||||
[DisplayName("全名")]
|
||||
[Description("全名")]
|
||||
[DataObjectField(false, false, true, 200)]
|
||||
[BindColumn("FullName", "全名", "")]
|
||||
public String FullName { get => _FullName; set { if (OnPropertyChanging("FullName", value)) { _FullName = value; OnPropertyChanged("FullName"); } } }
|
||||
|
||||
private Int32 _ParentID;
|
||||
/// <summary>父编号</summary>
|
||||
[DisplayName("父编号")]
|
||||
[Description("父编号")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("ParentID", "父编号", "")]
|
||||
public Int32 ParentID { get => _ParentID; set { if (OnPropertyChanging("ParentID", value)) { _ParentID = value; OnPropertyChanged("ParentID"); } } }
|
||||
|
||||
private String _Url;
|
||||
/// <summary>链接</summary>
|
||||
[DisplayName("链接")]
|
||||
[Description("链接")]
|
||||
[DataObjectField(false, false, true, 200)]
|
||||
[BindColumn("Url", "链接", "")]
|
||||
public String Url { get => _Url; set { if (OnPropertyChanging("Url", value)) { _Url = value; OnPropertyChanged("Url"); } } }
|
||||
|
||||
private Int32 _Sort;
|
||||
/// <summary>排序</summary>
|
||||
[DisplayName("排序")]
|
||||
[Description("排序")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Sort", "排序", "")]
|
||||
public Int32 Sort { get => _Sort; set { if (OnPropertyChanging("Sort", value)) { _Sort = value; OnPropertyChanged("Sort"); } } }
|
||||
|
||||
private String _Icon;
|
||||
/// <summary>图标</summary>
|
||||
[DisplayName("图标")]
|
||||
[Description("图标")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Icon", "图标", "")]
|
||||
public String Icon { get => _Icon; set { if (OnPropertyChanging("Icon", value)) { _Icon = value; OnPropertyChanged("Icon"); } } }
|
||||
|
||||
private Boolean _Visible;
|
||||
/// <summary>可见</summary>
|
||||
[DisplayName("可见")]
|
||||
[Description("可见")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Visible", "可见", "")]
|
||||
public Boolean Visible { get => _Visible; set { if (OnPropertyChanging("Visible", value)) { _Visible = value; OnPropertyChanged("Visible"); } } }
|
||||
|
||||
private Boolean _Necessary;
|
||||
/// <summary>必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色</summary>
|
||||
[DisplayName("必要")]
|
||||
[Description("必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Necessary", "必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色", "")]
|
||||
public Boolean Necessary { get => _Necessary; set { if (OnPropertyChanging("Necessary", value)) { _Necessary = value; OnPropertyChanged("Necessary"); } } }
|
||||
|
||||
private String _Permission;
|
||||
/// <summary>权限子项。逗号分隔,每个权限子项名值竖线分隔</summary>
|
||||
[DisplayName("权限子项")]
|
||||
[Description("权限子项。逗号分隔,每个权限子项名值竖线分隔")]
|
||||
[DataObjectField(false, false, true, 200)]
|
||||
[BindColumn("Permission", "权限子项。逗号分隔,每个权限子项名值竖线分隔", "")]
|
||||
public String Permission { get => _Permission; set { if (OnPropertyChanging("Permission", value)) { _Permission = value; OnPropertyChanged("Permission"); } } }
|
||||
|
||||
private String _Remark;
|
||||
/// <summary>备注</summary>
|
||||
[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 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
public override Object this[String name]
|
||||
{
|
||||
#region 属性
|
||||
private Int32 _ID;
|
||||
/// <summary>编号</summary>
|
||||
[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 _Name;
|
||||
/// <summary>名称</summary>
|
||||
[DisplayName("名称")]
|
||||
[Description("名称")]
|
||||
[DataObjectField(false, false, false, 50)]
|
||||
[BindColumn("Name", "名称", "", Master = true)]
|
||||
public String Name { get => _Name; set { if (OnPropertyChanging("Name", value)) { _Name = value; OnPropertyChanged("Name"); } } }
|
||||
|
||||
private String _DisplayName;
|
||||
/// <summary>显示名</summary>
|
||||
[DisplayName("显示名")]
|
||||
[Description("显示名")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("DisplayName", "显示名", "")]
|
||||
public String DisplayName { get => _DisplayName; set { if (OnPropertyChanging("DisplayName", value)) { _DisplayName = value; OnPropertyChanged("DisplayName"); } } }
|
||||
|
||||
private String _FullName;
|
||||
/// <summary>全名</summary>
|
||||
[DisplayName("全名")]
|
||||
[Description("全名")]
|
||||
[DataObjectField(false, false, true, 200)]
|
||||
[BindColumn("FullName", "全名", "")]
|
||||
public String FullName { get => _FullName; set { if (OnPropertyChanging("FullName", value)) { _FullName = value; OnPropertyChanged("FullName"); } } }
|
||||
|
||||
private Int32 _ParentID;
|
||||
/// <summary>父编号</summary>
|
||||
[DisplayName("父编号")]
|
||||
[Description("父编号")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("ParentID", "父编号", "")]
|
||||
public Int32 ParentID { get => _ParentID; set { if (OnPropertyChanging("ParentID", value)) { _ParentID = value; OnPropertyChanged("ParentID"); } } }
|
||||
|
||||
private String _Url;
|
||||
/// <summary>链接</summary>
|
||||
[DisplayName("链接")]
|
||||
[Description("链接")]
|
||||
[DataObjectField(false, false, true, 200)]
|
||||
[BindColumn("Url", "链接", "")]
|
||||
public String Url { get => _Url; set { if (OnPropertyChanging("Url", value)) { _Url = value; OnPropertyChanged("Url"); } } }
|
||||
|
||||
private Int32 _Sort;
|
||||
/// <summary>排序</summary>
|
||||
[DisplayName("排序")]
|
||||
[Description("排序")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Sort", "排序", "")]
|
||||
public Int32 Sort { get => _Sort; set { if (OnPropertyChanging("Sort", value)) { _Sort = value; OnPropertyChanged("Sort"); } } }
|
||||
|
||||
private String _Icon;
|
||||
/// <summary>图标</summary>
|
||||
[DisplayName("图标")]
|
||||
[Description("图标")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Icon", "图标", "")]
|
||||
public String Icon { get => _Icon; set { if (OnPropertyChanging("Icon", value)) { _Icon = value; OnPropertyChanged("Icon"); } } }
|
||||
|
||||
private Boolean _Visible;
|
||||
/// <summary>可见</summary>
|
||||
[DisplayName("可见")]
|
||||
[Description("可见")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Visible", "可见", "")]
|
||||
public Boolean Visible { get => _Visible; set { if (OnPropertyChanging("Visible", value)) { _Visible = value; OnPropertyChanged("Visible"); } } }
|
||||
|
||||
private Boolean _Necessary;
|
||||
/// <summary>必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色</summary>
|
||||
[DisplayName("必要")]
|
||||
[Description("必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Necessary", "必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色", "")]
|
||||
public Boolean Necessary { get => _Necessary; set { if (OnPropertyChanging("Necessary", value)) { _Necessary = value; OnPropertyChanged("Necessary"); } } }
|
||||
|
||||
private String _Permission;
|
||||
/// <summary>权限子项。逗号分隔,每个权限子项名值竖线分隔</summary>
|
||||
[DisplayName("权限子项")]
|
||||
[Description("权限子项。逗号分隔,每个权限子项名值竖线分隔")]
|
||||
[DataObjectField(false, false, true, 200)]
|
||||
[BindColumn("Permission", "权限子项。逗号分隔,每个权限子项名值竖线分隔", "")]
|
||||
public String Permission { get => _Permission; set { if (OnPropertyChanging("Permission", value)) { _Permission = value; OnPropertyChanged("Permission"); } } }
|
||||
|
||||
private String _Remark;
|
||||
/// <summary>备注</summary>
|
||||
[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 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
public override Object this[String name]
|
||||
get => name switch
|
||||
{
|
||||
get
|
||||
"ID" => _ID,
|
||||
"Name" => _Name,
|
||||
"DisplayName" => _DisplayName,
|
||||
"FullName" => _FullName,
|
||||
"ParentID" => _ParentID,
|
||||
"Url" => _Url,
|
||||
"Sort" => _Sort,
|
||||
"Icon" => _Icon,
|
||||
"Visible" => _Visible,
|
||||
"Necessary" => _Necessary,
|
||||
"Permission" => _Permission,
|
||||
"Remark" => _Remark,
|
||||
_ => base[name]
|
||||
};
|
||||
set
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "ID": return _ID;
|
||||
case "Name": return _Name;
|
||||
case "DisplayName": return _DisplayName;
|
||||
case "FullName": return _FullName;
|
||||
case "ParentID": return _ParentID;
|
||||
case "Url": return _Url;
|
||||
case "Sort": return _Sort;
|
||||
case "Icon": return _Icon;
|
||||
case "Visible": return _Visible;
|
||||
case "Necessary": return _Necessary;
|
||||
case "Permission": return _Permission;
|
||||
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 "DisplayName": _DisplayName = Convert.ToString(value); break;
|
||||
case "FullName": _FullName = Convert.ToString(value); break;
|
||||
case "ParentID": _ParentID = value.ToInt(); break;
|
||||
case "Url": _Url = Convert.ToString(value); break;
|
||||
case "Sort": _Sort = value.ToInt(); break;
|
||||
case "Icon": _Icon = Convert.ToString(value); break;
|
||||
case "Visible": _Visible = value.ToBoolean(); break;
|
||||
case "Necessary": _Necessary = value.ToBoolean(); break;
|
||||
case "Permission": _Permission = Convert.ToString(value); break;
|
||||
case "Remark": _Remark = Convert.ToString(value); break;
|
||||
default: base[name] = value; break;
|
||||
}
|
||||
case "ID": _ID = value.ToInt(); break;
|
||||
case "Name": _Name = Convert.ToString(value); break;
|
||||
case "DisplayName": _DisplayName = Convert.ToString(value); break;
|
||||
case "FullName": _FullName = Convert.ToString(value); break;
|
||||
case "ParentID": _ParentID = value.ToInt(); break;
|
||||
case "Url": _Url = Convert.ToString(value); break;
|
||||
case "Sort": _Sort = value.ToInt(); break;
|
||||
case "Icon": _Icon = Convert.ToString(value); break;
|
||||
case "Visible": _Visible = value.ToBoolean(); break;
|
||||
case "Necessary": _Necessary = value.ToBoolean(); break;
|
||||
case "Permission": _Permission = Convert.ToString(value); break;
|
||||
case "Remark": _Remark = Convert.ToString(value); break;
|
||||
default: base[name] = value; break;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得菜单3字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public static readonly Field ID = FindByName("ID");
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public static readonly Field Name = FindByName("Name");
|
||||
|
||||
/// <summary>显示名</summary>
|
||||
public static readonly Field DisplayName = FindByName("DisplayName");
|
||||
|
||||
/// <summary>全名</summary>
|
||||
public static readonly Field FullName = FindByName("FullName");
|
||||
|
||||
/// <summary>父编号</summary>
|
||||
public static readonly Field ParentID = FindByName("ParentID");
|
||||
|
||||
/// <summary>链接</summary>
|
||||
public static readonly Field Url = FindByName("Url");
|
||||
|
||||
/// <summary>排序</summary>
|
||||
public static readonly Field Sort = FindByName("Sort");
|
||||
|
||||
/// <summary>图标</summary>
|
||||
public static readonly Field Icon = FindByName("Icon");
|
||||
|
||||
/// <summary>可见</summary>
|
||||
public static readonly Field Visible = FindByName("Visible");
|
||||
|
||||
/// <summary>必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色</summary>
|
||||
public static readonly Field Necessary = FindByName("Necessary");
|
||||
|
||||
/// <summary>权限子项。逗号分隔,每个权限子项名值竖线分隔</summary>
|
||||
public static readonly Field Permission = FindByName("Permission");
|
||||
|
||||
/// <summary>备注</summary>
|
||||
public static readonly Field Remark = FindByName("Remark");
|
||||
|
||||
static Field FindByName(String name) => Meta.Table.FindByName(name);
|
||||
}
|
||||
|
||||
/// <summary>取得菜单3字段名称的快捷方式</summary>
|
||||
public partial class __
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public const String ID = "ID";
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public const String Name = "Name";
|
||||
|
||||
/// <summary>显示名</summary>
|
||||
public const String DisplayName = "DisplayName";
|
||||
|
||||
/// <summary>全名</summary>
|
||||
public const String FullName = "FullName";
|
||||
|
||||
/// <summary>父编号</summary>
|
||||
public const String ParentID = "ParentID";
|
||||
|
||||
/// <summary>链接</summary>
|
||||
public const String Url = "Url";
|
||||
|
||||
/// <summary>排序</summary>
|
||||
public const String Sort = "Sort";
|
||||
|
||||
/// <summary>图标</summary>
|
||||
public const String Icon = "Icon";
|
||||
|
||||
/// <summary>可见</summary>
|
||||
public const String Visible = "Visible";
|
||||
|
||||
/// <summary>必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色</summary>
|
||||
public const String Necessary = "Necessary";
|
||||
|
||||
/// <summary>权限子项。逗号分隔,每个权限子项名值竖线分隔</summary>
|
||||
public const String Permission = "Permission";
|
||||
|
||||
/// <summary>备注</summary>
|
||||
public const String Remark = "Remark";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得菜单3字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public static readonly Field ID = FindByName("ID");
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public static readonly Field Name = FindByName("Name");
|
||||
|
||||
/// <summary>显示名</summary>
|
||||
public static readonly Field DisplayName = FindByName("DisplayName");
|
||||
|
||||
/// <summary>全名</summary>
|
||||
public static readonly Field FullName = FindByName("FullName");
|
||||
|
||||
/// <summary>父编号</summary>
|
||||
public static readonly Field ParentID = FindByName("ParentID");
|
||||
|
||||
/// <summary>链接</summary>
|
||||
public static readonly Field Url = FindByName("Url");
|
||||
|
||||
/// <summary>排序</summary>
|
||||
public static readonly Field Sort = FindByName("Sort");
|
||||
|
||||
/// <summary>图标</summary>
|
||||
public static readonly Field Icon = FindByName("Icon");
|
||||
|
||||
/// <summary>可见</summary>
|
||||
public static readonly Field Visible = FindByName("Visible");
|
||||
|
||||
/// <summary>必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色</summary>
|
||||
public static readonly Field Necessary = FindByName("Necessary");
|
||||
|
||||
/// <summary>权限子项。逗号分隔,每个权限子项名值竖线分隔</summary>
|
||||
public static readonly Field Permission = FindByName("Permission");
|
||||
|
||||
/// <summary>备注</summary>
|
||||
public static readonly Field Remark = FindByName("Remark");
|
||||
|
||||
static Field FindByName(String name) => Meta.Table.FindByName(name);
|
||||
}
|
||||
|
||||
/// <summary>取得菜单3字段名称的快捷方式</summary>
|
||||
public partial class __
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public const String ID = "ID";
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public const String Name = "Name";
|
||||
|
||||
/// <summary>显示名</summary>
|
||||
public const String DisplayName = "DisplayName";
|
||||
|
||||
/// <summary>全名</summary>
|
||||
public const String FullName = "FullName";
|
||||
|
||||
/// <summary>父编号</summary>
|
||||
public const String ParentID = "ParentID";
|
||||
|
||||
/// <summary>链接</summary>
|
||||
public const String Url = "Url";
|
||||
|
||||
/// <summary>排序</summary>
|
||||
public const String Sort = "Sort";
|
||||
|
||||
/// <summary>图标</summary>
|
||||
public const String Icon = "Icon";
|
||||
|
||||
/// <summary>可见</summary>
|
||||
public const String Visible = "Visible";
|
||||
|
||||
/// <summary>必要。必要的菜单,必须至少有角色拥有这些权限,如果没有则自动授权给系统角色</summary>
|
||||
public const String Necessary = "Necessary";
|
||||
|
||||
/// <summary>权限子项。逗号分隔,每个权限子项名值竖线分隔</summary>
|
||||
public const String Permission = "Permission";
|
||||
|
||||
/// <summary>备注</summary>
|
||||
public const String Remark = "Remark";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -1,234 +1,239 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using XCode;
|
||||
using XCode.Cache;
|
||||
using XCode.Configuration;
|
||||
using XCode.DataAccessLayer;
|
||||
|
||||
namespace XUnitTest.XCode.TestEntity
|
||||
namespace XUnitTest.XCode.TestEntity;
|
||||
|
||||
/// <summary>角色</summary>
|
||||
[Serializable]
|
||||
[DataObject]
|
||||
[Description("角色")]
|
||||
[BindIndex("IU_Role2_Name", true, "Name")]
|
||||
[BindTable("Role2", Description = "角色", ConnName = "test", DbType = DatabaseType.None)]
|
||||
public partial class Role2
|
||||
{
|
||||
/// <summary>角色</summary>
|
||||
[Serializable]
|
||||
[DataObject]
|
||||
[Description("角色")]
|
||||
[BindIndex("IU_Role2_Name", true, "Name")]
|
||||
[BindTable("Role2", Description = "角色", ConnName = "test", DbType = DatabaseType.None)]
|
||||
public partial class Role2
|
||||
#region 属性
|
||||
private Int32 _ID;
|
||||
/// <summary>编号</summary>
|
||||
[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 _Name;
|
||||
/// <summary>名称</summary>
|
||||
[DisplayName("名称")]
|
||||
[Description("名称")]
|
||||
[DataObjectField(false, false, false, 50)]
|
||||
[BindColumn("Name", "名称", "", Master = true)]
|
||||
public String Name { get => _Name; set { if (OnPropertyChanging("Name", value)) { _Name = value; OnPropertyChanged("Name"); } } }
|
||||
|
||||
private Boolean _IsSystem;
|
||||
/// <summary>系统。用于业务系统开发使用,不受数据权限约束,禁止修改名称或删除</summary>
|
||||
[DisplayName("系统")]
|
||||
[Description("系统。用于业务系统开发使用,不受数据权限约束,禁止修改名称或删除")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("IsSystem", "系统。用于业务系统开发使用,不受数据权限约束,禁止修改名称或删除", "")]
|
||||
public Boolean IsSystem { get => _IsSystem; set { if (OnPropertyChanging("IsSystem", value)) { _IsSystem = value; OnPropertyChanged("IsSystem"); } } }
|
||||
|
||||
private String _Remark;
|
||||
/// <summary>说明</summary>
|
||||
[DisplayName("说明")]
|
||||
[Description("说明")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Remark", "说明", "")]
|
||||
public String Remark { get => _Remark; set { if (OnPropertyChanging("Remark", value)) { _Remark = value; OnPropertyChanged("Remark"); } } }
|
||||
|
||||
private String _Permission;
|
||||
/// <summary>权限。对不同资源的权限,逗号分隔,每个资源的权限子项竖线分隔</summary>
|
||||
[DisplayName("权限")]
|
||||
[Description("权限。对不同资源的权限,逗号分隔,每个资源的权限子项竖线分隔")]
|
||||
[DataObjectField(false, false, true, 500)]
|
||||
[BindColumn("Permission", "权限。对不同资源的权限,逗号分隔,每个资源的权限子项竖线分隔", "")]
|
||||
public String Permission { get => _Permission; set { if (OnPropertyChanging("Permission", value)) { _Permission = value; OnPropertyChanged("Permission"); } } }
|
||||
|
||||
private Int32 _CreateUserID;
|
||||
/// <summary>创建用户</summary>
|
||||
[DisplayName("创建用户")]
|
||||
[Description("创建用户")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("CreateUserID", "创建用户", "")]
|
||||
public Int32 CreateUserID { get => _CreateUserID; set { if (OnPropertyChanging("CreateUserID", value)) { _CreateUserID = value; OnPropertyChanged("CreateUserID"); } } }
|
||||
|
||||
private String _CreateIP;
|
||||
/// <summary>创建地址</summary>
|
||||
[DisplayName("创建地址")]
|
||||
[Description("创建地址")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("CreateIP", "创建地址", "")]
|
||||
public String CreateIP { get => _CreateIP; set { if (OnPropertyChanging("CreateIP", value)) { _CreateIP = value; OnPropertyChanged("CreateIP"); } } }
|
||||
|
||||
private DateTime _CreateTime;
|
||||
/// <summary>创建时间</summary>
|
||||
[DisplayName("创建时间")]
|
||||
[Description("创建时间")]
|
||||
[DataObjectField(false, false, true, 0)]
|
||||
[BindColumn("CreateTime", "创建时间", "")]
|
||||
public DateTime CreateTime { get => _CreateTime; set { if (OnPropertyChanging("CreateTime", value)) { _CreateTime = value; OnPropertyChanged("CreateTime"); } } }
|
||||
|
||||
private Int32 _UpdateUserID;
|
||||
/// <summary>更新用户</summary>
|
||||
[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;
|
||||
/// <summary>更新地址</summary>
|
||||
[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;
|
||||
/// <summary>更新时间</summary>
|
||||
[DisplayName("更新时间")]
|
||||
[Description("更新时间")]
|
||||
[DataObjectField(false, false, true, 0)]
|
||||
[BindColumn("UpdateTime", "更新时间", "")]
|
||||
public DateTime UpdateTime { get => _UpdateTime; set { if (OnPropertyChanging("UpdateTime", value)) { _UpdateTime = value; OnPropertyChanged("UpdateTime"); } } }
|
||||
#endregion
|
||||
|
||||
#region 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
public override Object this[String name]
|
||||
{
|
||||
#region 属性
|
||||
private Int32 _ID;
|
||||
/// <summary>编号</summary>
|
||||
[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 _Name;
|
||||
/// <summary>名称</summary>
|
||||
[DisplayName("名称")]
|
||||
[Description("名称")]
|
||||
[DataObjectField(false, false, false, 50)]
|
||||
[BindColumn("Name", "名称", "", Master = true)]
|
||||
public String Name { get => _Name; set { if (OnPropertyChanging("Name", value)) { _Name = value; OnPropertyChanged("Name"); } } }
|
||||
|
||||
private Boolean _IsSystem;
|
||||
/// <summary>系统。用于业务系统开发使用,不受数据权限约束,禁止修改名称或删除</summary>
|
||||
[DisplayName("系统")]
|
||||
[Description("系统。用于业务系统开发使用,不受数据权限约束,禁止修改名称或删除")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("IsSystem", "系统。用于业务系统开发使用,不受数据权限约束,禁止修改名称或删除", "")]
|
||||
public Boolean IsSystem { get => _IsSystem; set { if (OnPropertyChanging("IsSystem", value)) { _IsSystem = value; OnPropertyChanged("IsSystem"); } } }
|
||||
|
||||
private String _Remark;
|
||||
/// <summary>说明</summary>
|
||||
[DisplayName("说明")]
|
||||
[Description("说明")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Remark", "说明", "")]
|
||||
public String Remark { get => _Remark; set { if (OnPropertyChanging("Remark", value)) { _Remark = value; OnPropertyChanged("Remark"); } } }
|
||||
|
||||
private String _Permission;
|
||||
/// <summary>权限。对不同资源的权限,逗号分隔,每个资源的权限子项竖线分隔</summary>
|
||||
[DisplayName("权限")]
|
||||
[Description("权限。对不同资源的权限,逗号分隔,每个资源的权限子项竖线分隔")]
|
||||
[DataObjectField(false, false, true, 500)]
|
||||
[BindColumn("Permission", "权限。对不同资源的权限,逗号分隔,每个资源的权限子项竖线分隔", "")]
|
||||
public String Permission { get => _Permission; set { if (OnPropertyChanging("Permission", value)) { _Permission = value; OnPropertyChanged("Permission"); } } }
|
||||
|
||||
private Int32 _CreateUserID;
|
||||
/// <summary>创建用户</summary>
|
||||
[DisplayName("创建用户")]
|
||||
[Description("创建用户")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("CreateUserID", "创建用户", "")]
|
||||
public Int32 CreateUserID { get => _CreateUserID; set { if (OnPropertyChanging("CreateUserID", value)) { _CreateUserID = value; OnPropertyChanged("CreateUserID"); } } }
|
||||
|
||||
private String _CreateIP;
|
||||
/// <summary>创建地址</summary>
|
||||
[DisplayName("创建地址")]
|
||||
[Description("创建地址")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("CreateIP", "创建地址", "")]
|
||||
public String CreateIP { get => _CreateIP; set { if (OnPropertyChanging("CreateIP", value)) { _CreateIP = value; OnPropertyChanged("CreateIP"); } } }
|
||||
|
||||
private DateTime _CreateTime;
|
||||
/// <summary>创建时间</summary>
|
||||
[DisplayName("创建时间")]
|
||||
[Description("创建时间")]
|
||||
[DataObjectField(false, false, true, 0)]
|
||||
[BindColumn("CreateTime", "创建时间", "")]
|
||||
public DateTime CreateTime { get => _CreateTime; set { if (OnPropertyChanging("CreateTime", value)) { _CreateTime = value; OnPropertyChanged("CreateTime"); } } }
|
||||
|
||||
private Int32 _UpdateUserID;
|
||||
/// <summary>更新用户</summary>
|
||||
[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;
|
||||
/// <summary>更新地址</summary>
|
||||
[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;
|
||||
/// <summary>更新时间</summary>
|
||||
[DisplayName("更新时间")]
|
||||
[Description("更新时间")]
|
||||
[DataObjectField(false, false, true, 0)]
|
||||
[BindColumn("UpdateTime", "更新时间", "")]
|
||||
public DateTime UpdateTime { get => _UpdateTime; set { if (OnPropertyChanging("UpdateTime", value)) { _UpdateTime = value; OnPropertyChanged("UpdateTime"); } } }
|
||||
#endregion
|
||||
|
||||
#region 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
public override Object this[String name]
|
||||
get => name switch
|
||||
{
|
||||
get
|
||||
"ID" => _ID,
|
||||
"Name" => _Name,
|
||||
"IsSystem" => _IsSystem,
|
||||
"Remark" => _Remark,
|
||||
"Permission" => _Permission,
|
||||
"CreateUserID" => _CreateUserID,
|
||||
"CreateIP" => _CreateIP,
|
||||
"CreateTime" => _CreateTime,
|
||||
"UpdateUserID" => _UpdateUserID,
|
||||
"UpdateIP" => _UpdateIP,
|
||||
"UpdateTime" => _UpdateTime,
|
||||
_ => base[name]
|
||||
};
|
||||
set
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "ID": return _ID;
|
||||
case "Name": return _Name;
|
||||
case "IsSystem": return _IsSystem;
|
||||
case "Remark": return _Remark;
|
||||
case "Permission": return _Permission;
|
||||
case "CreateUserID": return _CreateUserID;
|
||||
case "CreateIP": return _CreateIP;
|
||||
case "CreateTime": return _CreateTime;
|
||||
case "UpdateUserID": return _UpdateUserID;
|
||||
case "UpdateIP": return _UpdateIP;
|
||||
case "UpdateTime": return _UpdateTime;
|
||||
default: return base[name];
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "ID": _ID = value.ToInt(); break;
|
||||
case "Name": _Name = Convert.ToString(value); break;
|
||||
case "IsSystem": _IsSystem = value.ToBoolean(); break;
|
||||
case "Remark": _Remark = Convert.ToString(value); break;
|
||||
case "Permission": _Permission = Convert.ToString(value); break;
|
||||
case "CreateUserID": _CreateUserID = value.ToInt(); break;
|
||||
case "CreateIP": _CreateIP = Convert.ToString(value); break;
|
||||
case "CreateTime": _CreateTime = value.ToDateTime(); break;
|
||||
case "UpdateUserID": _UpdateUserID = value.ToInt(); break;
|
||||
case "UpdateIP": _UpdateIP = Convert.ToString(value); break;
|
||||
case "UpdateTime": _UpdateTime = value.ToDateTime(); break;
|
||||
default: base[name] = value; break;
|
||||
}
|
||||
case "ID": _ID = value.ToInt(); break;
|
||||
case "Name": _Name = Convert.ToString(value); break;
|
||||
case "IsSystem": _IsSystem = value.ToBoolean(); break;
|
||||
case "Remark": _Remark = Convert.ToString(value); break;
|
||||
case "Permission": _Permission = Convert.ToString(value); break;
|
||||
case "CreateUserID": _CreateUserID = value.ToInt(); break;
|
||||
case "CreateIP": _CreateIP = Convert.ToString(value); break;
|
||||
case "CreateTime": _CreateTime = value.ToDateTime(); break;
|
||||
case "UpdateUserID": _UpdateUserID = value.ToInt(); break;
|
||||
case "UpdateIP": _UpdateIP = Convert.ToString(value); break;
|
||||
case "UpdateTime": _UpdateTime = value.ToDateTime(); break;
|
||||
default: base[name] = value; break;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得角色字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public static readonly Field ID = FindByName("ID");
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public static readonly Field Name = FindByName("Name");
|
||||
|
||||
/// <summary>系统。用于业务系统开发使用,不受数据权限约束,禁止修改名称或删除</summary>
|
||||
public static readonly Field IsSystem = FindByName("IsSystem");
|
||||
|
||||
/// <summary>说明</summary>
|
||||
public static readonly Field Remark = FindByName("Remark");
|
||||
|
||||
/// <summary>权限。对不同资源的权限,逗号分隔,每个资源的权限子项竖线分隔</summary>
|
||||
public static readonly Field Permission = FindByName("Permission");
|
||||
|
||||
/// <summary>创建用户</summary>
|
||||
public static readonly Field CreateUserID = FindByName("CreateUserID");
|
||||
|
||||
/// <summary>创建地址</summary>
|
||||
public static readonly Field CreateIP = FindByName("CreateIP");
|
||||
|
||||
/// <summary>创建时间</summary>
|
||||
public static readonly Field CreateTime = FindByName("CreateTime");
|
||||
|
||||
/// <summary>更新用户</summary>
|
||||
public static readonly Field UpdateUserID = FindByName("UpdateUserID");
|
||||
|
||||
/// <summary>更新地址</summary>
|
||||
public static readonly Field UpdateIP = FindByName("UpdateIP");
|
||||
|
||||
/// <summary>更新时间</summary>
|
||||
public static readonly Field UpdateTime = FindByName("UpdateTime");
|
||||
|
||||
static Field FindByName(String name) => Meta.Table.FindByName(name);
|
||||
}
|
||||
|
||||
/// <summary>取得角色字段名称的快捷方式</summary>
|
||||
public partial class __
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public const String ID = "ID";
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public const String Name = "Name";
|
||||
|
||||
/// <summary>系统。用于业务系统开发使用,不受数据权限约束,禁止修改名称或删除</summary>
|
||||
public const String IsSystem = "IsSystem";
|
||||
|
||||
/// <summary>说明</summary>
|
||||
public const String Remark = "Remark";
|
||||
|
||||
/// <summary>权限。对不同资源的权限,逗号分隔,每个资源的权限子项竖线分隔</summary>
|
||||
public const String Permission = "Permission";
|
||||
|
||||
/// <summary>创建用户</summary>
|
||||
public const String CreateUserID = "CreateUserID";
|
||||
|
||||
/// <summary>创建地址</summary>
|
||||
public const String CreateIP = "CreateIP";
|
||||
|
||||
/// <summary>创建时间</summary>
|
||||
public const String CreateTime = "CreateTime";
|
||||
|
||||
/// <summary>更新用户</summary>
|
||||
public const String UpdateUserID = "UpdateUserID";
|
||||
|
||||
/// <summary>更新地址</summary>
|
||||
public const String UpdateIP = "UpdateIP";
|
||||
|
||||
/// <summary>更新时间</summary>
|
||||
public const String UpdateTime = "UpdateTime";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得角色字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public static readonly Field ID = FindByName("ID");
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public static readonly Field Name = FindByName("Name");
|
||||
|
||||
/// <summary>系统。用于业务系统开发使用,不受数据权限约束,禁止修改名称或删除</summary>
|
||||
public static readonly Field IsSystem = FindByName("IsSystem");
|
||||
|
||||
/// <summary>说明</summary>
|
||||
public static readonly Field Remark = FindByName("Remark");
|
||||
|
||||
/// <summary>权限。对不同资源的权限,逗号分隔,每个资源的权限子项竖线分隔</summary>
|
||||
public static readonly Field Permission = FindByName("Permission");
|
||||
|
||||
/// <summary>创建用户</summary>
|
||||
public static readonly Field CreateUserID = FindByName("CreateUserID");
|
||||
|
||||
/// <summary>创建地址</summary>
|
||||
public static readonly Field CreateIP = FindByName("CreateIP");
|
||||
|
||||
/// <summary>创建时间</summary>
|
||||
public static readonly Field CreateTime = FindByName("CreateTime");
|
||||
|
||||
/// <summary>更新用户</summary>
|
||||
public static readonly Field UpdateUserID = FindByName("UpdateUserID");
|
||||
|
||||
/// <summary>更新地址</summary>
|
||||
public static readonly Field UpdateIP = FindByName("UpdateIP");
|
||||
|
||||
/// <summary>更新时间</summary>
|
||||
public static readonly Field UpdateTime = FindByName("UpdateTime");
|
||||
|
||||
static Field FindByName(String name) => Meta.Table.FindByName(name);
|
||||
}
|
||||
|
||||
/// <summary>取得角色字段名称的快捷方式</summary>
|
||||
public partial class __
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public const String ID = "ID";
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public const String Name = "Name";
|
||||
|
||||
/// <summary>系统。用于业务系统开发使用,不受数据权限约束,禁止修改名称或删除</summary>
|
||||
public const String IsSystem = "IsSystem";
|
||||
|
||||
/// <summary>说明</summary>
|
||||
public const String Remark = "Remark";
|
||||
|
||||
/// <summary>权限。对不同资源的权限,逗号分隔,每个资源的权限子项竖线分隔</summary>
|
||||
public const String Permission = "Permission";
|
||||
|
||||
/// <summary>创建用户</summary>
|
||||
public const String CreateUserID = "CreateUserID";
|
||||
|
||||
/// <summary>创建地址</summary>
|
||||
public const String CreateIP = "CreateIP";
|
||||
|
||||
/// <summary>创建时间</summary>
|
||||
public const String CreateTime = "CreateTime";
|
||||
|
||||
/// <summary>更新用户</summary>
|
||||
public const String UpdateUserID = "UpdateUserID";
|
||||
|
||||
/// <summary>更新地址</summary>
|
||||
public const String UpdateIP = "UpdateIP";
|
||||
|
||||
/// <summary>更新时间</summary>
|
||||
public const String UpdateTime = "UpdateTime";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -85,11 +85,11 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
|
||||
<PackageReference Include="NewLife.Core" Version="11.3.2025.101" />
|
||||
<PackageReference Include="NewLife.Core" Version="11.3.2025.109-beta0435" />
|
||||
<PackageReference Include="NewLife.IP" Version="2.2.2025.101" />
|
||||
<PackageReference Include="NewLife.UnitTest" Version="1.0.2025.101" />
|
||||
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="9.0.0" />
|
||||
<PackageReference Include="xunit" Version="2.9.2" />
|
||||
<PackageReference Include="xunit" Version="2.9.3" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
|
|
Loading…
Reference in New Issue