User NFCCode is rögzítésre kerüljön
This commit is contained in:
@@ -552,5 +552,35 @@ namespace WorkFlowCheck.API.Controllers
|
||||
if (retVal.Data == null || retVal.Data.Count <= 0) { retVal.IsSuccess = false; retVal.Errors.Add("No data!"); }
|
||||
return retVal;
|
||||
}
|
||||
|
||||
[HttpPost("UpdateAllMobileUser")]
|
||||
public async Task<ApiResponseDTO<List<MobileUserDTO>>> UpdateAllMobileUser([FromBody] List<MobileUserDTO> mobileUserListDTO)
|
||||
{
|
||||
var retVal = new ApiResponseDTO<List<MobileUserDTO>>()
|
||||
{
|
||||
IsSuccess = true
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
foreach (var mobileUserDTO in mobileUserListDTO)
|
||||
{
|
||||
var userDTO = await _userService.GetUserAsync(mobileUserDTO.Id);
|
||||
if (userDTO != null && userDTO.Id == mobileUserDTO.Id)
|
||||
{
|
||||
userDTO.NFCCode = mobileUserDTO.NFCCode;
|
||||
var result = await _userService.UpdateUserAsync(userDTO);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user