mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-11-09 02:44:44 +08:00
可访问机构控制调整到UserSession
This commit is contained in:
@@ -15,7 +15,7 @@ namespace OpenAuth.App
|
||||
|
||||
public IEnumerable<Category> Get(string type)
|
||||
{
|
||||
return UnitWork.Find<Category>(u => u.TypeId == type);
|
||||
return Repository.Find(u => u.TypeId == type);
|
||||
}
|
||||
|
||||
public void Add(Category category)
|
||||
@@ -24,19 +24,12 @@ namespace OpenAuth.App
|
||||
{
|
||||
category.Id = Guid.NewGuid().ToString();
|
||||
}
|
||||
UnitWork.Add(category);
|
||||
UnitWork.Save();
|
||||
Repository.Add(category);
|
||||
}
|
||||
|
||||
public void Update(Category category)
|
||||
{
|
||||
UnitWork.Update<Category>(u =>u.Id,category);
|
||||
UnitWork.Save();
|
||||
}
|
||||
|
||||
public void Delete(string[] ids)
|
||||
{
|
||||
UnitWork.Delete<Category>(u => ids.Contains(u.Id));
|
||||
Repository.Update(u =>u.Id,category);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -95,28 +95,5 @@ namespace OpenAuth.App
|
||||
return UnitWork.Find<Org>(u => moduleIds.Contains(u.Id)).ToList();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到部门的所有子部门
|
||||
/// <para>如果orgId为空,表示取得所有部门</para>
|
||||
/// </summary>
|
||||
public TableData LoadAllChildren(string orgId)
|
||||
{
|
||||
string cascadeId = ".0.";
|
||||
if (!string.IsNullOrEmpty(orgId))
|
||||
{
|
||||
var org = Repository.FindSingle(u => u.Id == orgId);
|
||||
if (org == null)
|
||||
throw new Exception("未能找到指定对象信息");
|
||||
cascadeId = org.CascadeId;
|
||||
}
|
||||
|
||||
var query = Repository.Find(u => u.CascadeId.Contains(cascadeId));
|
||||
return new TableData
|
||||
{
|
||||
data = query.ToList(),
|
||||
count = query.Count(),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user