Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
 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);
     }
 }
Esempio n. 4
0
 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);
     }
 }
Esempio n. 5
0
        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);
            }
        }