List <TemplateMessage> GetTemplatesFromRepository() { List <TemplateMessage> templates = new List <TemplateMessage>(); using (ISession currentSession = BasicSessionMgr.GetSession()) { if (currentSession != null) { NotificationRepository oDal = new NotificationRepository(currentSession); templates = oDal.PreLoadTemplates(); } } return(templates); }
public void NotifyToUsers(NotificationToPerson Notification) { try { using (ISession currentSession = BasicSessionMgr.GetSession()) { if (currentSession != null) { NotificationRepository oDal = new NotificationRepository(currentSession, GetCachedTemplates()); oDal.AddNotificationMessage(Notification, Notification.PersonsID); } } } catch (Exception ex) { ErrorHandler pError = new ErrorHandler(); pError.addMessageToPoisonQueue(Notification, ex); } }
public void NotifyForPermission(NotificationToPermission Notification) { try { List <int> DestinationPersons = GetUsersByPermission(Notification.CommunityID, Notification.ModuleID, Notification.Permission); using (ISession currentSession = BasicSessionMgr.GetSession()) { if (currentSession != null) { NotificationRepository oDal = new NotificationRepository(currentSession, GetCachedTemplates()); oDal.AddNotificationMessage(Notification, DestinationPersons); } } } catch (Exception ex) { ErrorHandler pError = new ErrorHandler(); pError.addMessageToPoisonQueue(Notification, ex); } }
public void NotifyForPermissionItemInt(NotificationToItemInt Notification) { try { List <int> DestinationPersons = CommunityService().GetItemIntMembersID(Notification.CommunityID, Notification.ModuleCode, Notification.ItemID, Notification.ObjectTypeID, Notification.Permission).ToList <int>(); using (ISession currentSession = BasicSessionMgr.GetSession()) { if (currentSession != null) { NotificationRepository oDal = new NotificationRepository(currentSession, GetCachedTemplates()); oDal.AddNotificationMessage(Notification, DestinationPersons); } } } catch (Exception ex) { ErrorHandler pError = new ErrorHandler(); pError.addMessageToPoisonQueue(Notification, ex); } }
public void NotifyToCommunity(NotificationToCommunity NotificationCommunity) { try { List <int> DestinationPersons = GetUsersByCommunity(NotificationCommunity.CommunityID);//CommunityService().GetCommunityMembersID(NotificationCommunity.CommunityID).ToList<int>(); using (ISession currentSession = BasicSessionMgr.GetSession()) { if (currentSession != null) { NotificationRepository oDal = new NotificationRepository(currentSession, GetCachedTemplates()); oDal.AddNotificationMessage(NotificationCommunity, DestinationPersons); } } } catch (Exception ex) { ErrorHandler pError = new ErrorHandler(); pError.addMessageToPoisonQueue(NotificationCommunity, ex); } }