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

@ -167,8 +167,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
}
else if (role == "NORMAL")
{
retirementDeceaseds = retirementDeceaseds
.Where(x => node == 0 ? x.child1DnaId == null : (node == 1 ? x.child2DnaId == null : (node == 2 ? x.child3DnaId == null : (node == 3 ? x.child4DnaId == null : true)))).ToList();
retirementDeceaseds = retirementDeceaseds.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(retirementDeceaseds);
}

View file

@ -217,8 +217,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
}
else if (role == "NORMAL")
{
retirementOthers = retirementOthers
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
retirementOthers = retirementOthers.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(retirementOthers);
}

View file

@ -198,8 +198,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
}
else if (role == "NORMAL")
{
retirementOuts = retirementOuts
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
retirementOuts = retirementOuts.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(retirementOuts);
}

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);
}

View file

@ -263,8 +263,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
}
else if (role == "NORMAL")
{
retirementResignEmployees = retirementResignEmployees
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
retirementResignEmployees = retirementResignEmployees.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(retirementResignEmployees);
@ -370,8 +376,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
}
else if (role == "NORMAL")
{
retirementResignEmployees = retirementResignEmployees
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
retirementResignEmployees = retirementResignEmployees.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(retirementResignEmployees);
@ -2113,8 +2125,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);
}