采用全新的数据库架构

This commit is contained in:
yubaolee
2015-10-26 21:58:12 +08:00
parent 366d3a5351
commit 13d44f28b6
91 changed files with 21208 additions and 9430 deletions

View File

@@ -1,15 +0,0 @@
namespace OpenAuth.Domain
{
public partial class Button
{
public string ButtonId { get; set; }
public string FullName { get; set; }
public string Img { get; set; }
public string Event { get; set; }
public string Control_ID { get; set; }
public string Category { get; set; }
public string Description { get; set; }
public bool Enabled { get; set; }
public int SortCode { get; set; }
}
}

View File

@@ -1,10 +0,0 @@
namespace OpenAuth.Domain
{
public partial class DataPermission
{
public string Id { get; set; }
public string RoleId { get; set; }
public string ResourceId { get; set; }
public string ObjectId { get; set; }
}
}

View File

@@ -1,13 +0,0 @@
namespace OpenAuth.Domain
{
public partial class Department
{
public string DepartmentId { get; set; }
public string ParentId { get; set; }
public string FullName { get; set; }
public string Description { get; set; }
public bool Enabled { get; set; }
public int SortCode { get; set; }
public bool DeleteMark { get; set; }
}
}

View File

@@ -1,6 +0,0 @@
namespace OpenAuth.Domain.Interface
{
public interface IMenuRepository
{
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OpenAuth.Domain.Interface
{
public interface IOrgRepository
{
IEnumerable<Org> LoadOrgs();
}
}

View File

@@ -0,0 +1,40 @@
// ***********************************************************************
// Assembly : OpenAuth.Domain
// Author : yubaolee
// Created : 10-25-2015
//
// Last Modified By : yubaolee
// Last Modified On : 10-25-2015
// ***********************************************************************
// <copyright file="IRepository.cs" company="www.cnblogs.com/yubaolee">
// Copyright (c) www.cnblogs.com/yubaolee. All rights reserved.
// </copyright>
// <summary>仓储接口</summary>
// ***********************************************************************
using System;
using System.Linq;
using System.Linq.Expressions;
namespace OpenAuth.Domain.Interface
{
public interface IRepository<T> where T : class
{
T FindSingle(Expression<Func<T, bool>> exp = null);
IQueryable<T> Find(Expression<Func<T, bool>> exp = null);
IQueryable<T> Find(int pageindex = 1, int pagesize = 10, string orderby = "",
Expression<Func<T, bool>> exp = null);
int GetCount(Expression<Func<T, bool>> exp = null);
void Add(T entity);
void Update(T entity);
void Delete(T entity);
void Save();
}
}

View File

@@ -1,18 +0,0 @@
namespace OpenAuth.Domain
{
public partial class Menu
{
public string MenuId { get; set; }
public string ParentId { get; set; }
public string FullName { get; set; }
public string Description { get; set; }
public string Img { get; set; }
public int Category { get; set; }
public string NavigateUrl { get; set; }
public string FormName { get; set; }
public string Target { get; set; }
public bool IsUnfold { get; set; }
public bool Enabled { get; set; }
public int SortCode { get; set; }
}
}

View File

@@ -1,9 +0,0 @@
namespace OpenAuth.Domain
{
public partial class MenuButton
{
public string MenuButtonId { get; set; }
public string MenuId { get; set; }
public string ButtonId { get; set; }
}
}

22
OpenAuth.Domain/Module.cs Normal file
View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
namespace OpenAuth.Domain
{
public partial class Module
{
public int Id { get; set; }
public string CascadeId { get; set; }
public string Name { get; set; }
public string Url { get; set; }
public string HotKey { get; set; }
public int ParentId { get; set; }
public bool IsLeaf { get; set; }
public bool IsAutoExpand { get; set; }
public string IconName { get; set; }
public int Status { get; set; }
public string ParentName { get; set; }
public string Vector { get; set; }
public int SortNo { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace OpenAuth.Domain
{
public partial class ModuleRole
{
public int Id { get; set; }
public int RoleId { get; set; }
public int ModuleId { get; set; }
public int Type { get; set; }
public System.DateTime OperateTime { get; set; }
public int OperatorId { get; set; }
}
}

View File

@@ -1,66 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6108DA8E-92A1-4ABE-B9F5-26D64D55CA2C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenAuth.Domain</RootNamespace>
<AssemblyName>OpenAuth.Domain</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Button.cs" />
<Compile Include="DataPermission.cs" />
<Compile Include="Department.cs" />
<Compile Include="Interface\IMenuRepository.cs" />
<Compile Include="Interface\IUserRepository.cs" />
<Compile Include="Menu.cs" />
<Compile Include="MenuButton.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Role.cs" />
<Compile Include="RoleMenu.cs" />
<Compile Include="RoleMenuButton.cs" />
<Compile Include="sysdiagram.cs" />
<Compile Include="User.cs" />
<Compile Include="UserDepartment.cs" />
<Compile Include="UserRole.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6108DA8E-92A1-4ABE-B9F5-26D64D55CA2C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenAuth.Domain</RootNamespace>
<AssemblyName>OpenAuth.Domain</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Interface\IOrgRepository.cs" />
<Compile Include="Interface\IRepository.cs" />
<Compile Include="Interface\IUserRepository.cs" />
<Compile Include="Module.cs" />
<Compile Include="ModuleRole.cs" />
<Compile Include="Org.cs" />
<Compile Include="Page.cs" />
<Compile Include="PageElement.cs" />
<Compile Include="PageElementGrant.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Role.cs" />
<Compile Include="User.cs" />
<Compile Include="UserCfg.cs" />
<Compile Include="UserExt.cs" />
<Compile Include="UserModule.cs" />
<Compile Include="UserOrg.cs" />
<Compile Include="UserRole.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

25
OpenAuth.Domain/Org.cs Normal file
View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace OpenAuth.Domain
{
public partial class Org
{
public int Id { get; set; }
public string CascadeId { get; set; }
public string Name { get; set; }
public string HotKey { get; set; }
public int ParentId { get; set; }
public string ParentName { get; set; }
public bool IsLeaf { get; set; }
public bool IsAutoExpand { get; set; }
public string IconName { get; set; }
public int Status { get; set; }
public int Type { get; set; }
public string BizCode { get; set; }
public string CustomCode { get; set; }
public System.DateTime CreateTime { get; set; }
public int CreateId { get; set; }
public int SortNo { get; set; }
}
}

20
OpenAuth.Domain/Page.cs Normal file
View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
namespace OpenAuth.Domain
{
public partial class Page
{
public int Id { get; set; }
public int ModuleId { get; set; }
public string Name { get; set; }
public string Url { get; set; }
public int Type { get; set; }
public bool Enabled { get; set; }
public bool IsDefault { get; set; }
public string Icon { get; set; }
public string IconBig { get; set; }
public string Vector { get; set; }
public int SortNo { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace OpenAuth.Domain
{
public partial class PageElement
{
public int Id { get; set; }
public string DomId { get; set; }
public string Name { get; set; }
public int Type { get; set; }
public int ModuleId { get; set; }
public string Remark { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace OpenAuth.Domain
{
public partial class PageElementGrant
{
public int Id { get; set; }
public int ElementId { get; set; }
public int UserId { get; set; }
public int RoleId { get; set; }
public int PostId { get; set; }
public int GrantType { get; set; }
}
}

View File

@@ -1,15 +1,17 @@
namespace OpenAuth.Domain
{
public partial class Role
{
public string RoleId { get; set; }
public string ParentId { get; set; }
public string FullName { get; set; }
public string Category { get; set; }
public string Description { get; set; }
public bool Enabled { get; set; }
public int SortCode { get; set; }
public bool DeleteMark { get; set; }
public string DepartmentId { get; set; }
}
}
using System;
using System.Collections.Generic;
namespace OpenAuth.Domain
{
public partial class Role
{
public int Id { get; set; }
public string Name { get; set; }
public int Status { get; set; }
public int Type { get; set; }
public System.DateTime CreateTime { get; set; }
public string CreateId { get; set; }
public int CreateOrgId { get; set; }
public string CreateOrgCascadeId { get; set; }
}
}

View File

@@ -1,9 +0,0 @@
namespace OpenAuth.Domain
{
public partial class RoleMenu
{
public string RoleMenuId { get; set; }
public string RoleId { get; set; }
public string MenuId { get; set; }
}
}

View File

@@ -1,10 +0,0 @@
namespace OpenAuth.Domain
{
public partial class RoleMenuButton
{
public string RoleMenuButtonId { get; set; }
public string RoleId { get; set; }
public string MenuId { get; set; }
public string ButtonId { get; set; }
}
}

View File

@@ -1,25 +1,19 @@
using System;
namespace OpenAuth.Domain
{
public partial class User
{
public string UserId { get; set; }
public string Account { get; set; }
public string Password { get; set; }
public string RealName { get; set; }
public string RoleId { get; set; }
public bool Enabled { get; set; }
public bool DeleteMark { get; set; }
public void CheckLogin(string password)
{
if(this.Password != password)
throw new Exception("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
if(!this.Enabled)
throw new Exception("<22>û<EFBFBD><C3BB>Ѿ<EFBFBD><D1BE><EFBFBD>ͣ<EFBFBD><CDA3>");
if (DeleteMark)
throw new Exception("<22><><EFBFBD>˺<EFBFBD><CBBA>Ѿ<EFBFBD><D1BE><EFBFBD>ɾ<EFBFBD><C9BE>");
}
}
}
using System;
using System.Collections.Generic;
namespace OpenAuth.Domain
{
public partial class User
{
public int Id { get; set; }
public string Account { get; set; }
public string Password { get; set; }
public string Name { get; set; }
public int Sex { get; set; }
public int Status { get; set; }
public int Type { get; set; }
public string BizCode { get; set; }
public System.DateTime CreateTime { get; set; }
public int CreateId { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace OpenAuth.Domain
{
public partial class UserCfg
{
public int Id { get; set; }
public string Theme { get; set; }
public string Skin { get; set; }
public string NavBarStyle { get; set; }
public string TabFocusColor { get; set; }
public int NavTabIndex { get; set; }
}
}

View File

@@ -1,9 +0,0 @@
namespace OpenAuth.Domain
{
public partial class UserDepartment
{
public string UserDepartmentId { get; set; }
public string DepartmentId { get; set; }
public string UserId { get; set; }
}
}

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
namespace OpenAuth.Domain
{
public partial class UserExt
{
public int Id { get; set; }
public string Email { get; set; }
public string Phone_ { get; set; }
public string Mobile { get; set; }
public string Address { get; set; }
public string Zip { get; set; }
public string Birthday { get; set; }
public string IdCard { get; set; }
public string QQ { get; set; }
public string DynamicField { get; set; }
public int ByteArrayId { get; set; }
public string Remark { get; set; }
public string Field1 { get; set; }
public string Field2 { get; set; }
public string Field3 { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace OpenAuth.Domain
{
public partial class UserModule
{
public int Id { get; set; }
public int UserId { get; set; }
public int ModuleId { get; set; }
public int Type { get; set; }
public System.DateTime OperateTime { get; set; }
public int OperatorId { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
namespace OpenAuth.Domain
{
public partial class UserOrg
{
public int Id { get; set; }
public int OrgId { get; set; }
public int UserId { get; set; }
public System.DateTime OperateTime { get; set; }
public int OperatorId { get; set; }
}
}

View File

@@ -1,9 +1,14 @@
namespace OpenAuth.Domain
{
public partial class UserRole
{
public string UserRoleId { get; set; }
public string UserId { get; set; }
public string RoleId { get; set; }
}
}
using System;
using System.Collections.Generic;
namespace OpenAuth.Domain
{
public partial class UserRole
{
public int Id { get; set; }
public int RoleId { get; set; }
public int UserId { get; set; }
public System.DateTime OperateTime { get; set; }
public int OperatorId { get; set; }
}
}

View File

@@ -1,13 +0,0 @@
using System;
namespace OpenAuth.Domain
{
public partial class sysdiagram
{
public string name { get; set; }
public int principal_id { get; set; }
public int diagram_id { get; set; }
public Nullable<int> version { get; set; }
public byte[] definition { get; set; }
}
}