edit permission normal

This commit is contained in:
kittapath 2025-12-06 18:03:33 +07:00
parent 5451c49dbe
commit 436370312e
16 changed files with 174 additions and 57 deletions

View file

@ -324,8 +324,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
}
else if (role == "NORMAL")
{
retirementResigns = retirementResigns
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
retirementResigns = retirementResigns.Where(x =>
node == 0 ? x.rootDnaOldId == nodeId && x.child1DnaOldId == null :
node == 1 ? x.child1DnaOldId == nodeId && x.child2DnaOldId == null :
node == 2 ? x.child2DnaOldId == nodeId && x.child3DnaOldId == null :
node == 3 ? x.child3DnaOldId == nodeId && x.child4DnaOldId == null :
node == 4 ? x.child4DnaOldId == nodeId :
true
).ToList();
}
return Success(retirementResigns);
@ -432,8 +438,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
}
else if (role == "NORMAL")
{
retirementResigns = retirementResigns
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
retirementResigns = retirementResigns.Where(x =>
node == 0 ? x.rootDnaOldId == nodeId && x.child1DnaOldId == null :
node == 1 ? x.child1DnaOldId == nodeId && x.child2DnaOldId == null :
node == 2 ? x.child2DnaOldId == nodeId && x.child3DnaOldId == null :
node == 3 ? x.child3DnaOldId == nodeId && x.child4DnaOldId == null :
node == 4 ? x.child4DnaOldId == nodeId :
true
).ToList();
}
return Success(retirementResigns);
@ -2197,8 +2209,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
}
else if (role == "NORMAL")
{
data = data
.Where(x => node == 0 ? x.child1DnaId == null : (node == 1 ? x.child2DnaId == null : (node == 2 ? x.child3DnaId == null : (node == 3 ? x.child4DnaId == null : true)))).ToList();
data = data.Where(x =>
node == 0 ? x.rootDnaId == nodeId && x.child1DnaId == null :
node == 1 ? x.child1DnaId == nodeId && x.child2DnaId == null :
node == 2 ? x.child2DnaId == nodeId && x.child3DnaId == null :
node == 3 ? x.child3DnaId == nodeId && x.child4DnaId == null :
node == 4 ? x.child4DnaId == nodeId :
true
).ToList();
}
return Success(data);
}