mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2026-06-27 06:43:08 +08:00
完成机构与用户管理
This commit is contained in:
@@ -16,7 +16,7 @@ namespace OpenAuth.App
|
||||
|
||||
public void Login(string userName, string password)
|
||||
{
|
||||
var user = _repository.FindByAccount(userName);
|
||||
var user = _repository.FindSingle(u =>u.Account ==userName);
|
||||
if (user == null)
|
||||
{
|
||||
throw new Exception("<22>û<EFBFBD><C3BB>ʺŲ<CABA><C5B2><EFBFBD><EFBFBD><EFBFBD>");
|
||||
|
||||
@@ -44,8 +44,10 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="LoginApp.cs" />
|
||||
<Compile Include="UserManagerApp.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="OrgManagerApp.cs" />
|
||||
<Compile Include="ViewModel\UserView.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj">
|
||||
@@ -57,6 +59,7 @@
|
||||
<Name>OpenAuth.Domain</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<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.
|
||||
|
||||
@@ -15,9 +15,9 @@ namespace OpenAuth.App
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
public IEnumerable<Org> GetAll()
|
||||
public IList<Org> GetAll()
|
||||
{
|
||||
return _repository.LoadOrgs();
|
||||
return _repository.LoadOrgs().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -26,16 +26,16 @@ namespace OpenAuth.App
|
||||
/// </summary>
|
||||
/// <param name="orgId">The org unique identifier.</param>
|
||||
/// <returns>IEnumerable{Org}.</returns>
|
||||
public IEnumerable<Org> LoadDirectChildren(int orgId)
|
||||
public IList<Org> LoadDirectChildren(int orgId)
|
||||
{
|
||||
return _repository.Find(u => u.ParentId == orgId);
|
||||
return _repository.Find(u => u.ParentId == orgId).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到部门的所有子部门
|
||||
/// <para>如果orgId为0,表示取得所有部门</para>
|
||||
/// </summary>
|
||||
public IEnumerable<Org> LoadAllChildren(int orgId)
|
||||
public IList<Org> LoadAllChildren(int orgId)
|
||||
{
|
||||
string cascadeId = "0.";
|
||||
if (orgId != 0)
|
||||
@@ -46,7 +46,7 @@ namespace OpenAuth.App
|
||||
cascadeId = org.CascadeId;
|
||||
}
|
||||
|
||||
return _repository.Find(u => u.CascadeId.Contains(cascadeId) && u.Id != orgId);
|
||||
return _repository.Find(u => u.CascadeId.Contains(cascadeId) && u.Id != orgId).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的常规信息通过以下
|
||||
// 特性集控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("OpenAuth.App")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("OpenAuth.App")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 使此程序集中的类型
|
||||
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
|
||||
// 则将该类型上的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("83c7318e-df7b-4774-8299-7e2728e9b590")]
|
||||
|
||||
// 程序集的版本信息由下面四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的常规信息通过以下
|
||||
// 特性集控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("OpenAuth.App")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("OpenAuth.App")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 使此程序集中的类型
|
||||
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
|
||||
// 则将该类型上的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("83c7318e-df7b-4774-8299-7e2728e9b590")]
|
||||
|
||||
// 程序集的版本信息由下面四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
Reference in New Issue
Block a user