public override void LoadNotifications()
{
try
{
cache.Clear();
notifications.Clear();
IList<SelectiveOperation> selectiveOperations = repo.GetAllSelectiveOperation();
IList<KeyValuePair<Guid, int>> generalPipeAmount = repo.GetPipesCountPerMillSizeType();
foreach (SelectiveOperation s in selectiveOperations)
{
cache.AddOrReplace(s.PipeSizeTypeId,s.PipeSizeTypeName, s.OperationId, s.OperationCode, s.OperationName, s.SelectivePercent, s.PipesCount,0);
cache.SetPipeAmount(s.OperationId, generalPipeAmount.First(kvp => kvp.Key == s.PipeSizeTypeId).Value);
if (cache.IsExpired(s.OperationId))
{
notifications.Add(
CreateNotification(s.OperationId, cache.GetOwnerName(s.OperationId), cache.GetCheckValue(s.OperationId), cache.GetInformation(s.OperationId)));
}
}
}
catch (Exception ex)
{
log.Error("Unable to load Selective Operation Notifications: ", ex);
}
NotificationService.Instance.NotifyInterested();
}