コード例 #1
0
ファイル: Forum.cs プロジェクト: KerwinMa/OurUmbraco
 void ForumService_Created(object sender, uForum.ForumEventArgs e)
 {
     var content = Umbraco.Web.UmbracoContext.Current.Application.Services.ContentService.GetById(e.Forum.ParentId);
     if (content.ContentType.Alias == "Project")
     {
         var owner = content.GetValue<int>("owner");
         //NotificationsWeb.BusinessLogic.Forum.Subscribe(e.Forum.Id, owner);
         var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
         ns.SubscribeToForum(e.Forum.Id, owner);
     }
 }
コード例 #2
0
ファイル: Forum.cs プロジェクト: KerwinMa/OurUmbraco
        void TopicService_Created(object sender, uForum.TopicEventArgs e)
        {
            var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
            ns.SubscribeToForumTopic(e.Topic.Id, e.Topic.MemberId);

            //send notification
            InstantNotification not = new InstantNotification();

            //data for notification:
            var membershipHelper = new MembershipHelper(Umbraco.Web.UmbracoContext.Current);
            var member = membershipHelper.GetById(e.Topic.MemberId);
            var memberName = string.Empty;
            if (member != null)
                memberName = member.Name;

            not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "NewTopic", e.Topic, e.Topic.GetUrl(), memberName);
        }
コード例 #3
0
ファイル: Utils.cs プロジェクト: larrynPL/OurUmbraco
 public static bool IsSubscribedToForumTopic(int topicId, int memberId)
 {
     var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
     return ns.IsSubscribedToTopic(topicId, memberId);
 }
コード例 #4
0
 public NotificationsController()
 {
     _notificationService = new NotificationService(DatabaseContext);
 }
コード例 #5
0
ファイル: Forum.cs プロジェクト: KerwinMa/OurUmbraco
 void ForumService_Deleted(object sender, uForum.ForumEventArgs e)
 {
     var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
     ns.RemoveAllForumSubscriptions(e.Forum.Id);
 }