เอา paging ออก
This commit is contained in:
parent
e8cf09b7ac
commit
99a3cfd052
8 changed files with 163 additions and 155 deletions
|
|
@ -69,7 +69,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet()]
|
||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||
// public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_PROMOTION_OFFICER");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
|
|
@ -164,30 +165,30 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
// if (PlacementAdmin == true)
|
||||
// placementAppointments.Where(x => x.Status.Trim().ToUpper().Contains("PENDING"));
|
||||
|
||||
if (keyword != "")
|
||||
{
|
||||
var data = placementAppointments.Where(x =>
|
||||
(x.citizenId != null && x.citizenId.Contains(keyword)) ||
|
||||
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||
(x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||
(x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||
(x.OrganizationOld != null && x.OrganizationOld.Contains(keyword)) ||
|
||||
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||
(x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||
(x.Reason != null && x.Reason.Contains(keyword)) ||
|
||||
(x.nodeName != null && x.nodeName.Contains(keyword)))
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Skip((page - 1) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
// if (keyword != "")
|
||||
// {
|
||||
// var data = placementAppointments.Where(x =>
|
||||
// (x.citizenId != null && x.citizenId.Contains(keyword)) ||
|
||||
// (x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||
// (x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||
// (x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||
// (x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||
// (x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||
// (x.OrganizationOld != null && x.OrganizationOld.Contains(keyword)) ||
|
||||
// (x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||
// (x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||
// (x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||
// (x.Reason != null && x.Reason.Contains(keyword)) ||
|
||||
// (x.nodeName != null && x.nodeName.Contains(keyword)))
|
||||
// .OrderByDescending(x => x.CreatedAt)
|
||||
// .Skip((page - 1) * pageSize)
|
||||
// .Take(pageSize)
|
||||
// .ToList();
|
||||
|
||||
placementAppointments = data;
|
||||
}
|
||||
// placementAppointments = data;
|
||||
// }
|
||||
|
||||
return Success(new { data = placementAppointments, total = placementAppointments.Count });
|
||||
return Success(placementAppointments);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -69,7 +69,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet()]
|
||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
|
||||
// public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_PROMOTION_EMP");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
|
|
@ -161,30 +162,30 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
p.typeCommand,
|
||||
})
|
||||
.ToListAsync();
|
||||
if (keyword != "")
|
||||
{
|
||||
var data = placementAppointments.Where(x =>
|
||||
(x.citizenId != null && x.citizenId.Contains(keyword)) ||
|
||||
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||
(x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||
(x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||
(x.OrganizationOld != null && x.OrganizationOld.Contains(keyword)) ||
|
||||
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||
(x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||
(x.Reason != null && x.Reason.Contains(keyword)) ||
|
||||
(x.nodeName != null && x.nodeName.Contains(keyword)))
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Skip((page - 1) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
// if (keyword != "")
|
||||
// {
|
||||
// var data = placementAppointments.Where(x =>
|
||||
// (x.citizenId != null && x.citizenId.Contains(keyword)) ||
|
||||
// (x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||
// (x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||
// (x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||
// (x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||
// (x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||
// (x.OrganizationOld != null && x.OrganizationOld.Contains(keyword)) ||
|
||||
// (x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||
// (x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||
// (x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||
// (x.Reason != null && x.Reason.Contains(keyword)) ||
|
||||
// (x.nodeName != null && x.nodeName.Contains(keyword)))
|
||||
// .OrderByDescending(x => x.CreatedAt)
|
||||
// .Skip((page - 1) * pageSize)
|
||||
// .Take(pageSize)
|
||||
// .ToList();
|
||||
|
||||
placementAppointments = data;
|
||||
}
|
||||
// placementAppointments = data;
|
||||
// }
|
||||
|
||||
return Success(new { data = placementAppointments, total = placementAppointments.Count });
|
||||
return Success(placementAppointments);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -92,7 +92,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
[HttpGet("exam/{year}")]
|
||||
public async Task<ActionResult<ResponseObject>> GetExam(int year, int page = 1, int pageSize = 10, string keyword = "")
|
||||
public async Task<ActionResult<ResponseObject>> GetExam(int year)
|
||||
// public async Task<ActionResult<ResponseObject>> GetExam(int year, int page = 1, int pageSize = 10, string keyword = "")
|
||||
{
|
||||
var data = await _context.Placements.Where(x => year > 0 ? (x.Year == year) : (x.Year > 0))
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
|
|
@ -111,20 +112,20 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
IsExpired = x.EndDate.Date < DateTime.Now.Date,
|
||||
CreatedAt = x.CreatedAt,
|
||||
}).ToListAsync();
|
||||
if (keyword != "")
|
||||
{
|
||||
var data_ = data.Where(x =>
|
||||
(x.ExamRound != null && x.ExamRound.Contains(keyword)) ||
|
||||
(x.ExamOrder != null && x.ExamOrder.Contains(keyword)) ||
|
||||
(x.NumberOfCandidates != null && x.NumberOfCandidates.ToString().Contains(keyword)))
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Skip((page - 1) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
// if (keyword != "")
|
||||
// {
|
||||
// var data_ = data.Where(x =>
|
||||
// (x.ExamRound != null && x.ExamRound.Contains(keyword)) ||
|
||||
// (x.ExamOrder != null && x.ExamOrder.Contains(keyword)) ||
|
||||
// (x.NumberOfCandidates != null && x.NumberOfCandidates.ToString().Contains(keyword)))
|
||||
// .OrderByDescending(x => x.CreatedAt)
|
||||
// .Skip((page - 1) * pageSize)
|
||||
// .Take(pageSize)
|
||||
// .ToList();
|
||||
|
||||
data = data_;
|
||||
}
|
||||
return Success( new { data, total = data.Count });
|
||||
// data = data_;
|
||||
// }
|
||||
return Success(data);
|
||||
}
|
||||
|
||||
[HttpGet("pass/{examId:length(36)}")]
|
||||
|
|
|
|||
|
|
@ -69,7 +69,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet()]
|
||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
|
||||
// public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_TEMPDUTY");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
|
|
@ -142,27 +143,27 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
})
|
||||
.ToListAsync();
|
||||
|
||||
if (keyword != "")
|
||||
{
|
||||
var data = placementOfficers.Where(x =>
|
||||
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||
(x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||
(x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||
(x.PositionOld != null && x.PositionOld.Contains(keyword)) ||
|
||||
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||
(x.Organization != null && x.Organization.Contains(keyword)))
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Skip((page - 1) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
// if (keyword != "")
|
||||
// {
|
||||
// var data = placementOfficers.Where(x =>
|
||||
// (x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||
// (x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||
// (x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||
// (x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||
// (x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||
// (x.PositionOld != null && x.PositionOld.Contains(keyword)) ||
|
||||
// (x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||
// (x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||
// (x.Organization != null && x.Organization.Contains(keyword)))
|
||||
// .OrderByDescending(x => x.CreatedAt)
|
||||
// .Skip((page - 1) * pageSize)
|
||||
// .Take(pageSize)
|
||||
// .ToList();
|
||||
|
||||
placementOfficers = data;
|
||||
}
|
||||
// placementOfficers = data;
|
||||
// }
|
||||
|
||||
return Success(new { data = placementOfficers, total = placementOfficers.Count });
|
||||
return Success(placementOfficers);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet()]
|
||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
|
||||
// public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_TRANSFER_RECEIVE");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
|
|
@ -181,24 +182,24 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
// if (PlacementAdmin == true)
|
||||
// placementReceives.Where(x => x.Status.Trim().ToUpper().Contains("PENDING"));
|
||||
|
||||
if (keyword != "")
|
||||
{
|
||||
var data = placementReceives.Where(x =>
|
||||
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||
(x.citizenId != null && x.citizenId.Contains(keyword)) ||
|
||||
(x.root != null && x.root.Contains(keyword)) ||
|
||||
(x.nodeName != null && x.nodeName.Contains(keyword)) ||
|
||||
(x.nodeShortName != null && x.nodeShortName.Contains(keyword)))
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Skip((page - 1) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
// if (keyword != "")
|
||||
// {
|
||||
// var data = placementReceives.Where(x =>
|
||||
// (x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||
// (x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||
// (x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||
// (x.citizenId != null && x.citizenId.Contains(keyword)) ||
|
||||
// (x.root != null && x.root.Contains(keyword)) ||
|
||||
// (x.nodeName != null && x.nodeName.Contains(keyword)) ||
|
||||
// (x.nodeShortName != null && x.nodeShortName.Contains(keyword)))
|
||||
// .OrderByDescending(x => x.CreatedAt)
|
||||
// .Skip((page - 1) * pageSize)
|
||||
// .Take(pageSize)
|
||||
// .ToList();
|
||||
|
||||
placementReceives = data;
|
||||
}
|
||||
return Success(new { data = placementReceives, total = placementReceives.Count });
|
||||
// placementReceives = data;
|
||||
// }
|
||||
return Success(placementReceives);
|
||||
// }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet()]
|
||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
|
||||
// public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_TEMPDUTY2");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
|
|
@ -148,28 +149,28 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
})
|
||||
.ToListAsync();
|
||||
|
||||
if (keyword != "")
|
||||
{
|
||||
var data = placementRepatriations.Where(x =>
|
||||
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||
(x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||
(x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||
(x.PositionOld != null && x.PositionOld.Contains(keyword)) ||
|
||||
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||
(x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||
(x.Organization != null && x.Organization.Contains(keyword)))
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Skip((page - 1) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
// if (keyword != "")
|
||||
// {
|
||||
// var data = placementRepatriations.Where(x =>
|
||||
// (x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||
// (x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||
// (x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||
// (x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||
// (x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||
// (x.PositionOld != null && x.PositionOld.Contains(keyword)) ||
|
||||
// (x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||
// (x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||
// (x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||
// (x.Organization != null && x.Organization.Contains(keyword)))
|
||||
// .OrderByDescending(x => x.CreatedAt)
|
||||
// .Skip((page - 1) * pageSize)
|
||||
// .Take(pageSize)
|
||||
// .ToList();
|
||||
|
||||
placementRepatriations = data;
|
||||
}
|
||||
// placementRepatriations = data;
|
||||
// }
|
||||
|
||||
return Success(new { data = placementRepatriations, total = placementRepatriations.Count });
|
||||
return Success(placementRepatriations);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet()]
|
||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
|
||||
// public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_TRANSFER_REQ");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
|
|
@ -219,23 +220,23 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
})
|
||||
.ToListAsync();
|
||||
|
||||
if (keyword != "")
|
||||
{
|
||||
var data = placementTransfers.Where(x =>
|
||||
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)))
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Skip((page - 1) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
// if (keyword != "")
|
||||
// {
|
||||
// var data = placementTransfers.Where(x =>
|
||||
// (x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||
// (x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||
// (x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||
// (x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||
// (x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)))
|
||||
// .OrderByDescending(x => x.CreatedAt)
|
||||
// .Skip((page - 1) * pageSize)
|
||||
// .Take(pageSize)
|
||||
// .ToList();
|
||||
|
||||
placementTransfers = data;
|
||||
}
|
||||
// placementTransfers = data;
|
||||
// }
|
||||
|
||||
return Success(new { data = placementTransfers, total = placementTransfers.Count });
|
||||
return Success(placementTransfers);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet()]
|
||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
|
||||
// public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_PLACEMENT_OTHER");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
|
|
@ -146,27 +147,27 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
CommandType = p.CommandType == null ? null : p.CommandType.Name,
|
||||
})
|
||||
.ToListAsync();
|
||||
if (keyword != "")
|
||||
{
|
||||
var data = retirementOthers.Where(x =>
|
||||
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||
(x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||
(x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||
(x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||
(x.Reason != null && x.Reason.Contains(keyword)))
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Skip((page - 1) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
// if (keyword != "")
|
||||
// {
|
||||
// var data = retirementOthers.Where(x =>
|
||||
// (x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||
// (x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||
// (x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||
// (x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||
// (x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||
// (x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||
// (x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||
// (x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||
// (x.Reason != null && x.Reason.Contains(keyword)))
|
||||
// .OrderByDescending(x => x.CreatedAt)
|
||||
// .Skip((page - 1) * pageSize)
|
||||
// .Take(pageSize)
|
||||
// .ToList();
|
||||
|
||||
retirementOthers = data;
|
||||
}
|
||||
// retirementOthers = data;
|
||||
// }
|
||||
|
||||
return Success(new { data = retirementOthers, total = retirementOthers.Count });
|
||||
return Success(retirementOthers);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue