This commit is contained in:
parent
0a58075428
commit
ec04665f39
21 changed files with 546 additions and 491 deletions
|
|
@ -129,11 +129,23 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
? profileAdmin?.RootDnaId
|
||||
: "";
|
||||
}
|
||||
else if (role == "BROTHER")
|
||||
{
|
||||
nodeId = profileAdmin?.Node == 4
|
||||
? profileAdmin?.Child3DnaId
|
||||
: profileAdmin?.Node == 3
|
||||
? profileAdmin?.Child2DnaId
|
||||
: profileAdmin?.Node == 2
|
||||
? profileAdmin?.Child1DnaId
|
||||
: profileAdmin?.Node == 1 || profileAdmin?.Node == 0
|
||||
? profileAdmin?.RootDnaId
|
||||
: "";
|
||||
}
|
||||
else if (role == "ROOT" || role == "PARENT")
|
||||
{
|
||||
nodeId = profileAdmin?.RootDnaId;
|
||||
}
|
||||
|
||||
|
||||
int? node = profileAdmin?.Node;
|
||||
if (role == "OWNER")
|
||||
{
|
||||
|
|
@ -144,6 +156,11 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
resData = resData
|
||||
.Where(x => node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) : (node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) : (node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) : (node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) : (node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) : (node == null ? true : true)))))).ToList();
|
||||
}
|
||||
else if (role == "BROTHER")
|
||||
{
|
||||
resData = resData
|
||||
.Where(x => node == 4 ? x.Child3DnaId == Guid.Parse(nodeId!) : (node == 3 ? x.Child2DnaId == Guid.Parse(nodeId!) : (node == 2 ? x.Child1DnaId == Guid.Parse(nodeId!) : (node == 1 || node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) : (node == null ? true : true))))).ToList();
|
||||
}
|
||||
else if (role == "ROOT")
|
||||
{
|
||||
resData = resData
|
||||
|
|
@ -326,10 +343,10 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
item.Child1DnaId = profile.Child1DnaId;
|
||||
item.Child2DnaId = profile.Child2DnaId;
|
||||
item.Child3DnaId = profile.Child3DnaId;
|
||||
item.Child4DnaId = profile.Child4DnaId;
|
||||
item.Child4DnaId = profile.Child4DnaId;
|
||||
_context.LeaveBeginnings.Update(item);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
await _context.SaveChangesAsync();
|
||||
return Success("อัพเดทข้อมูลสำเร็จ");
|
||||
|
|
@ -439,7 +456,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
{
|
||||
return Error("ไม่สามารถบันทึกข้อมูล เนื่องจากมีข้อมูลในระบบแล้ว");
|
||||
}
|
||||
|
||||
|
||||
var leaveBeginning = new LeaveBeginning();
|
||||
leaveBeginning.LeaveTypeId = req.LeaveTypeId;
|
||||
leaveBeginning.LeaveYear = req.LeaveYear;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue