统一处理多对多表映射

This commit is contained in:
yubaolee
2015-11-30 11:58:18 +08:00
parent 92ead80909
commit 464f04bb32
36 changed files with 968 additions and 3372 deletions

View File

@@ -1,14 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OpenAuth.Domain.Interface
{
public interface IUserModuleRepository : IRepository<UserModule>
{
void DeleteByUser(params int[] userIds);
void AddUserModule(int userId, params int[] moduleIds);
}
}

View File

@@ -11,12 +11,5 @@ namespace OpenAuth.Domain.Interface
int GetUserCntInOrgs(params int[] orgIds);
IEnumerable<User> LoadInOrgs(int pageindex, int pagesize, params int[] orgIds);
void SetOrg(int userId, params int[] orgIds);
/// <summary>
/// ɾ<><C9BE><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>Ϣ
/// </summary>
void Delete(int id);
}
}

View File

@@ -1,14 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OpenAuth.Domain.Interface
{
public interface IUserRoleRepository : IRepository<UserRole>
{
void DeleteByUser(params int[] userIds);
void AddUserRole(int userId, params int[] roleIds);
}
}

View File

@@ -65,7 +65,7 @@ namespace OpenAuth.Domain
public string IconName { get; set; }
/// <summary>
/// 当前状态
/// 状态
/// </summary>
/// <returns></returns>
public int Status { get; set; }

View File

@@ -35,7 +35,7 @@ namespace OpenAuth.Domain
public int Type { get; set; }
/// <summary>
/// 所属功能模块流水号
/// 功能模块Id
/// </summary>
/// <returns></returns>
public int ModuleId { get; set; }

View File

@@ -17,7 +17,7 @@ namespace OpenAuth.Domain
public int Id { get; set; }
/// <summary>
/// 页面元素流水号
/// 元素流水号
/// </summary>
/// <returns></returns>
public int ElementId { get; set; }

View File

@@ -46,22 +46,18 @@
<Compile Include="Interface\IOrgRepository.cs" />
<Compile Include="Interface\IRepository.cs" />
<Compile Include="Interface\IRoleRepository.cs" />
<Compile Include="Interface\IUserRoleRepository.cs" />
<Compile Include="Interface\IUserModuleRepository.cs" />
<Compile Include="Interface\IRelevanceRepository.cs" />
<Compile Include="Interface\IUserRepository.cs" />
<Compile Include="Module.cs" />
<Compile Include="ModuleElement.cs" />
<Compile Include="ModuleElementGrant.cs" />
<Compile Include="ModuleRole.cs" />
<Compile Include="Org.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Relevance.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.

View File

@@ -65,7 +65,7 @@ namespace OpenAuth.Domain
public string IconName { get; set; }
/// <summary>
/// 当前状态
/// 状态
/// </summary>
/// <returns></returns>
public int Status { get; set; }

View File

@@ -1,63 +1,77 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
namespace OpenAuth.Domain
{
/// <summary>
/// 用户ID
/// </summary>
public partial class ModuleRole
{
/// <summary>
/// 用户ID
/// </summary>
/// <returns></returns>
public int Id { get; set; }
/// <summary>
/// 角色流水号
/// </summary>
/// <returns></returns>
public int RoleId { get; set; }
/// <summary>
/// 所属功能模块流水号
/// </summary>
/// <returns></returns>
public int ModuleId { get; set; }
/// <summary>
/// 组织类型
/// </summary>
/// <returns></returns>
public int Type { get; set; }
/// <summary>
/// 授权时间
/// </summary>
/// <returns></returns>
public System.DateTime OperateTime { get; set; }
/// <summary>
/// 授权人流水号
/// </summary>
/// <returns></returns>
public int OperatorId { get; set; }
public ModuleRole()
{
this.Id= 0;
this.RoleId= 0;
this.ModuleId= 0;
this.Type= 0;
this.OperateTime= DateTime.Now;
this.OperatorId= 0;
}
}
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
namespace OpenAuth.Domain
{
/// <summary>
/// 用户ID
/// </summary>
public partial class Relevance
{
/// <summary>
/// 用户ID
/// </summary>
/// <returns></returns>
public int Id { get; set; }
/// <summary>
/// 第一个表主键ID
/// </summary>
/// <returns></returns>
public int FirstId { get; set; }
/// <summary>
/// 第二个表主键ID
/// </summary>
/// <returns></returns>
public int SecondId { get; set; }
/// <summary>
/// 描述
/// </summary>
/// <returns></returns>
public string Description { get; set; }
/// <summary>
///
/// </summary>
/// <returns></returns>
public string Key { get; set; }
/// <summary>
/// 状态
/// </summary>
/// <returns></returns>
public int Status { get; set; }
/// <summary>
/// 授权时间
/// </summary>
/// <returns></returns>
public System.DateTime OperateTime { get; set; }
/// <summary>
/// 授权人
/// </summary>
/// <returns></returns>
public int OperatorId { get; set; }
public Relevance()
{
this.Id= 0;
this.FirstId= 0;
this.SecondId= 0;
this.Description= string.Empty;
this.Key= string.Empty;
this.Status= 0;
this.OperateTime= DateTime.Now;
this.OperatorId= 0;
}
}
}

View File

@@ -17,13 +17,13 @@ namespace OpenAuth.Domain
public int Id { get; set; }
/// <summary>
/// 名称
/// 组织名称
/// </summary>
/// <returns></returns>
public string Name { get; set; }
/// <summary>
/// 当前状态
/// 状态
/// </summary>
/// <returns></returns>
public int Status { get; set; }

View File

@@ -41,7 +41,7 @@ namespace OpenAuth.Domain
public int Sex { get; set; }
/// <summary>
/// 当前状态
/// 状态
/// </summary>
/// <returns></returns>
public int Status { get; set; }

View File

@@ -1,63 +0,0 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
namespace OpenAuth.Domain
{
/// <summary>
/// 用户ID
/// </summary>
public partial class UserModule
{
/// <summary>
/// 用户ID
/// </summary>
/// <returns></returns>
public int Id { get; set; }
/// <summary>
/// 用户流水号
/// </summary>
/// <returns></returns>
public int UserId { get; set; }
/// <summary>
/// 所属功能模块流水号
/// </summary>
/// <returns></returns>
public int ModuleId { get; set; }
/// <summary>
/// 组织类型
/// </summary>
/// <returns></returns>
public int Type { get; set; }
/// <summary>
/// 授权时间
/// </summary>
/// <returns></returns>
public System.DateTime OperateTime { get; set; }
/// <summary>
/// 授权人流水号
/// </summary>
/// <returns></returns>
public int OperatorId { get; set; }
public UserModule()
{
this.Id= 0;
this.UserId= 0;
this.ModuleId= 0;
this.Type= 0;
this.OperateTime= DateTime.Now;
this.OperatorId= 0;
}
}
}

View File

@@ -1,56 +0,0 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
namespace OpenAuth.Domain
{
/// <summary>
/// 用户ID
/// </summary>
public partial class UserOrg
{
/// <summary>
/// 用户ID
/// </summary>
/// <returns></returns>
public int Id { get; set; }
/// <summary>
///
/// </summary>
/// <returns></returns>
public int OrgId { get; set; }
/// <summary>
/// 用户流水号
/// </summary>
/// <returns></returns>
public int UserId { get; set; }
/// <summary>
/// 授权时间
/// </summary>
/// <returns></returns>
public System.DateTime OperateTime { get; set; }
/// <summary>
/// 授权人流水号
/// </summary>
/// <returns></returns>
public int OperatorId { get; set; }
public UserOrg()
{
this.Id= 0;
this.OrgId= 0;
this.UserId= 0;
this.OperateTime= DateTime.Now;
this.OperatorId= 0;
}
}
}

View File

@@ -1,56 +0,0 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
namespace OpenAuth.Domain
{
/// <summary>
/// 用户ID
/// </summary>
public partial class UserRole
{
/// <summary>
/// 用户ID
/// </summary>
/// <returns></returns>
public int Id { get; set; }
/// <summary>
/// 角色流水号
/// </summary>
/// <returns></returns>
public int RoleId { get; set; }
/// <summary>
/// 用户流水号
/// </summary>
/// <returns></returns>
public int UserId { get; set; }
/// <summary>
/// 授权时间
/// </summary>
/// <returns></returns>
public System.DateTime OperateTime { get; set; }
/// <summary>
/// 授权人流水号
/// </summary>
/// <returns></returns>
public int OperatorId { get; set; }
public UserRole()
{
this.Id= 0;
this.RoleId= 0;
this.UserId= 0;
this.OperateTime= DateTime.Now;
this.OperatorId= 0;
}
}
}