add in the check user already exist.

This commit is contained in:
Kham
2021-11-05 09:29:10 +11:00
parent 1131159112
commit f409ff1afb
5 changed files with 492 additions and 12 deletions
@@ -60,7 +60,15 @@ namespace CarParkValidationAPI.Repository
model.AddedOn = dto.AddedOn;
return model;
}
public async Task<ResultModel<bool>> CheckAdminUserByStaffLinkNoAsync(string staffLinkNo)
{
var list = await _context.AdminUsers.Where(x => x.StafflinkNo == staffLinkNo).ToListAsync();
return new ResultModel<bool>()
{
Data = false,
StatusCode = 1
};
}
public async Task<ResultModel<List<AdminUserViewDto>>> LoadAdminUserAsync(bool onlyActive)
{
/*
@@ -89,7 +97,8 @@ namespace CarParkValidationAPI.Repository
throw ex;
}
*/
for (int i =0; i < 10; i++)
var list = await _context.AdminUsers.Where(x => x.Active == onlyActive).ToListAsync();
for (int i =0; i < list.Count; i++)
{
AdminUserViewDto dto = new AdminUserViewDto();
dto.Id = i;
@@ -110,7 +119,7 @@ namespace CarParkValidationAPI.Repository
public async Task<ResultModel<AdminUserDto>> LoadAdminUserByIdAsync(int id)
{
AdminUserDto result = null;
/*
try
{
if (id > 0)
@@ -124,9 +133,7 @@ namespace CarParkValidationAPI.Repository
{
throw ex;
}
*/
return new ResultModel<AdminUserDto>()
{
Data = result,