Fix ลบรายการสอบติด Error & ปรับ paging หน้ารายชื่อ #1811
This commit is contained in:
parent
3727cef238
commit
dcc1c3aeba
1 changed files with 20 additions and 15 deletions
|
|
@ -910,19 +910,19 @@ namespace BMA.EHR.Recruit.Service.Controllers
|
|||
var data = await _context.RecruitImports.AsQueryable()
|
||||
.Include(x => x.ImportHostories)
|
||||
.Include(x => x.ImportFile)
|
||||
.Include(x => x.Recruits)
|
||||
.ThenInclude(x => x.Addresses)
|
||||
.Include(x => x.Recruits)
|
||||
.ThenInclude(x => x.Occupations)
|
||||
.Include(x => x.Recruits)
|
||||
.ThenInclude(x => x.Certificates)
|
||||
.Include(x => x.Recruits)
|
||||
.ThenInclude(x => x.Educations)
|
||||
.Include(x => x.Recruits)
|
||||
.ThenInclude(x => x.Payments)
|
||||
.Include(x => x.Recruits)
|
||||
.ThenInclude(x => x.Documents)
|
||||
.ThenInclude(x => x.DocumentFile)
|
||||
//.Include(x => x.Recruits)
|
||||
//.ThenInclude(x => x.Addresses)
|
||||
//.Include(x => x.Recruits)
|
||||
//.ThenInclude(x => x.Occupations)
|
||||
//.Include(x => x.Recruits)
|
||||
//.ThenInclude(x => x.Certificates)
|
||||
//.Include(x => x.Recruits)
|
||||
//.ThenInclude(x => x.Educations)
|
||||
//.Include(x => x.Recruits)
|
||||
//.ThenInclude(x => x.Payments)
|
||||
//.Include(x => x.Recruits)
|
||||
//.ThenInclude(x => x.Documents)
|
||||
//.ThenInclude(x => x.DocumentFile)
|
||||
.Include(x => x.ScoreImport)
|
||||
.ThenInclude(x => x.ImportFile)
|
||||
.Include(x => x.ScoreImport)
|
||||
|
|
@ -1693,6 +1693,11 @@ namespace BMA.EHR.Recruit.Service.Controllers
|
|||
cmd.Parameters.Add(new MySqlParameter("@r", req.ExamResult));
|
||||
}
|
||||
|
||||
sb.Append(" ORDER BY examID ");
|
||||
sb.Append(" LIMIT @PageSize OFFSET @Offset ");
|
||||
cmd.Parameters.Add(new MySqlParameter("@PageSize", req.PageSize));
|
||||
cmd.Parameters.Add(new MySqlParameter("@Offset", ((req.Page - 1) * req.PageSize)));
|
||||
|
||||
cmd.CommandText = sb.ToString();
|
||||
|
||||
_context.Database.OpenConnection();
|
||||
|
|
@ -1735,8 +1740,8 @@ namespace BMA.EHR.Recruit.Service.Controllers
|
|||
|
||||
}
|
||||
|
||||
if (data != null && data.Count > 0)
|
||||
data = data.Skip((req.Page - 1) * req.PageSize).Take(req.PageSize).ToList();
|
||||
//if (data != null && data.Count > 0)
|
||||
// data = data.Skip((req.Page - 1) * req.PageSize).Take(req.PageSize).ToList();
|
||||
|
||||
dynamic header = null;
|
||||
using (var cmd = _context.Database.GetDbConnection().CreateCommand())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue