ow
This commit is contained in:
1 parent
ef688db767
commit
3759fcc14a
8 files changed
+338
-263
No files matched your search
@@ -243,8 +243,11 @@ namespace CloudBuilder.Security.Service
|
||||
IRepository<SecurityFunctionMapViewEntity> repositoryMapView = repository.GetRepository<IRepository<SecurityFunctionMapViewEntity>>();
|
||||
IRepository<SecurityFunctionMapEntity> repositoryMap = repository.GetRepository<IRepository<SecurityFunctionMapEntity>>();
|
||||
SecurityFunctionMapViewEntity[] olds = repositoryMapView.Entities.Where(x => x.SonFunctionName == functionName).ToArray();
|
||||
|
||||
int oldOrderBy = 0;
|
||||
if (olds != null && olds.Length > 0)
|
||||
{
|
||||
if (olds.Length == 1) oldOrderBy = olds[0].Orderby;
|
||||
foreach (SecurityFunctionMapViewEntity old in olds)
|
||||
{
|
||||
repositoryMap.DeleteNow(new SecurityFunctionMapEntity() { FunctionNameSon = old.SonFunctionName, FunctionNameParent = old.ParentFunctionName });
|
||||
@@ -264,7 +267,7 @@ namespace CloudBuilder.Security.Service
|
||||
{
|
||||
FunctionNameSon = functionName,
|
||||
FunctionNameParent = map.ParentFunctionName,
|
||||
Orderby = oldMaps == null ? 1 : maxOrderBy + 1
|
||||
Orderby = oldOrderBy > 0 ? oldOrderBy : (oldMaps == null ? 1 : maxOrderBy + 1)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -286,7 +289,7 @@ namespace CloudBuilder.Security.Service
|
||||
|
||||
if (maps == null || maps.Length == 0) return;
|
||||
int i = 1;
|
||||
foreach (SecurityFunctionMapViewEntity map in maps.OrderBy(x=>x.Orderby).ToArray())
|
||||
foreach (SecurityFunctionMapViewEntity map in maps.OrderBy(x => x.Orderby).ToArray())
|
||||
{
|
||||
repositoryMap.InsertNow(new SecurityFunctionMapEntity()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user