Fixed PCRB attendees bug

This commit is contained in:
Chase Tucker 2025-02-06 10:58:54 -07:00
parent 40e7a3f8e0
commit 1946623c9e
3 changed files with 1162 additions and 1118 deletions

View File

@ -485,6 +485,20 @@ public class PCRBService : IPCRBService {
int rowsAffected = await _dalService.ExecuteAsync(queryBuilder.ToString());
if (rowsAffected <= 0) throw new Exception("update failed in database");
IEnumerable<PCRBAttendee>? attendees = _cache.Get<IEnumerable<PCRBAttendee>>($"pcrbAttendees{attendee.PlanNumber}");
if (attendees is not null) {
foreach (PCRBAttendee cachedAttendee in attendees) {
if (cachedAttendee.ID == attendee.ID) {
cachedAttendee.Location = attendee.Location;
cachedAttendee.Attended = attendee.Attended;
cachedAttendee.JobTitle = attendee.JobTitle;
cachedAttendee.AttendeeID = attendee.AttendeeID;
cachedAttendee.Step = attendee.Step;
}
}
_cache.Set($"pcrbAttendees{attendee.PlanNumber}", attendees, DateTimeOffset.Now.AddMinutes(15));
}
} catch (Exception ex) {
_logger.LogError($"Unable to update attendee, because {ex.Message}");
throw;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff