เอา 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.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