@@ -59,9 +53,9 @@
@Html.HiddenFor(m =>m.OrgId)
@if (Model.Id == 0) //添加
{
- //这个只用于显示使用,并不会进行提交处理,真正提交的是cascadeId
-
- 所属部门:
+
+
\ No newline at end of file
diff --git a/OpenAuth.Repository/OrgRepository.cs b/OpenAuth.Repository/OrgRepository.cs
index 5f629fee..c9ee66ad 100644
--- a/OpenAuth.Repository/OrgRepository.cs
+++ b/OpenAuth.Repository/OrgRepository.cs
@@ -24,5 +24,19 @@ namespace OpenAuth.Repository
return result;
}
+
+ public IEnumerable GetSubOrgs(int orgId)
+ {
+ string cascadeId = "0.";
+ if (orgId != 0)
+ {
+ var org = FindSingle(u => u.Id == orgId);
+ if (org == null)
+ throw new Exception("未能找到指定对象信息");
+ cascadeId = org.CascadeId;
+ }
+
+ return Find(u => u.CascadeId.Contains(cascadeId) && u.Id != orgId);
+ }
}
}
diff --git a/OpenAuth.Repository/StockRepository.cs b/OpenAuth.Repository/StockRepository.cs
index 504abbbc..1e1349b0 100644
--- a/OpenAuth.Repository/StockRepository.cs
+++ b/OpenAuth.Repository/StockRepository.cs
@@ -15,7 +15,7 @@ namespace OpenAuth.Repository
public IEnumerable LoadInOrgs(params int[] orgId)
{
- var result = from stock in Context.Stocks where orgId.Contains(stock.Id)
+ var result = from stock in Context.Stocks where orgId.Contains(stock.OrgId)
select stock;
return result;
diff --git a/建表&初始化数据.sql b/建表&初始化数据.sql
index c221e0e8..a5416e20 100644
Binary files a/建表&初始化数据.sql and b/建表&初始化数据.sql differ
|