cronjob + ลงเวลากรณีพิเดศษ

This commit is contained in:
Suphonchai Phoonsawat 2023-11-24 11:23:18 +07:00
parent 72f64728bb
commit e76d994098
16 changed files with 1518 additions and 9 deletions

View file

@ -28,12 +28,37 @@ namespace BMA.EHR.Application.Repositories
#region " Methods "
public async Task<bool> UpdateDutyTimeAsync(Guid profileId, Guid roundId, DateTime effectiveDate)
{
try
{
var profile = await _dbContext.Set<Profile>().FirstOrDefaultAsync(x => x.Id == profileId);
if (profile == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
else
{
profile.DutyTimeId = roundId;
profile.DutyTimeEffectiveDate = effectiveDate;
await UpdateAsync(profile);
return true;
}
}
catch
{
throw;
}
}
public async Task<List<Profile>> SearchProfile(string? citizenId, string? firstName, string? lastName)
{
try
{
var data = _dbContext.Set<Profile>().AsQueryable();
if (citizenId != null)
data = data.Where(x => x.CitizenId!.Contains(citizenId));