add parent

This commit is contained in:
kittapath 2025-10-07 11:13:28 +07:00
parent ddf899ce5d
commit 9e8fe1b30a
22 changed files with 289 additions and 122 deletions

View file

@ -143,7 +143,7 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
CreatedAt = x.CreatedAt
});
if (!string.IsNullOrEmpty(sortBy))
{
{
{
if (sortBy == "title")
query = descending ? query.OrderByDescending(x => x.Title) : query.OrderBy(x => x.Title);
@ -172,9 +172,9 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
}
}
else
{
query = query.OrderByDescending(x => x.CreatedAt);
}
{
query = query.OrderByDescending(x => x.CreatedAt);
}
var data = query
.Skip((page - 1) * pageSize)
@ -776,6 +776,10 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
{
nodeId = profileAdmin?.RootDnaId;
}
else if (role == "PARENT")
{
nodeId = profileAdmin?.Child1DnaId;
}
var node = profileAdmin?.Node;
var data_search = (from x in _context.DisciplineComplaint_Appeals
@ -807,6 +811,11 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
data_search = data_search
.Where(x => x.rootDnaId == nodeId).ToList();
}
else if (role == "PARENT")
{
data_search = data_search
.Where(x => x.child1DnaId == nodeId).ToList();
}
else if (role == "NORMAL")
{
data_search = data_search

View file

@ -74,20 +74,6 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers
{
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
}
//var profile = new List<GetProfileByKeycloakIdRootDto>();
//if (type.Trim().ToUpper() == "OFFICER")
//{
// profile = await _userProfileRepository.GetProfileWithKeycloakAllOfficer(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD");
//}
//else
//{
// profile = await _userProfileRepository.GetProfileWithKeycloakAllEmployee(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD");
//}
//if (req.posLevel != null || req.posType != null)
//{
// profile = profile.Where(x => x.PositionType == req.posType || x.PositionLevel == req.posLevel).ToList();
//}
var data_search1 = await _context.DisciplineComplaints
.Include(x => x.DisciplineComplaint_Profiles)