Beispiel #1
0
        /// <summary>
        /// This will create a notification type used by the module and also handle the actions that must be associated with it.
        /// </summary>
        /// <remarks>This should only ever run once, during 1.0.0 install (via IUpgradeable).
        /// </remarks>
        static internal void AddNotificationTypes()
        {
            var actions      = new List <NotificationTypeAction>();
            var deskModuleId = DesktopModuleController.GetDesktopModuleByFriendlyName("DNNQA").DesktopModuleID;

            var objNotificationType = new NotificationType
            {
                Name            = Constants.NotificationQaFlag,
                Description     = "Q&A Notification",
                DesktopModuleId = deskModuleId
            };

            if (NotificationsController.Instance.GetNotificationType(objNotificationType.Name) != null)
            {
                return;
            }
            var objAction = new NotificationTypeAction
            {
                NameResourceKey        = "AcceptInvite",
                DescriptionResourceKey = "AcceptInvite_Desc",
                APICall = "DesktopModules/DNNQA/API/SocialModuleService.ashx/ActionMethod",
                Order   = 1
            };

            actions.Add(objAction);

            NotificationsController.Instance.CreateNotificationType(objNotificationType);
            NotificationsController.Instance.SetNotificationTypeActions(actions, objNotificationType.NotificationTypeId);
        }
Beispiel #2
0
        /// <summary>
        /// This will create a notification type associated w/ the module and also handle the actions that must be associated with it.
        /// </summary>
        public void AddNotificationTypes()
        {
            var actions      = new List <NotificationTypeAction>();
            var deskModuleId = DesktopModuleController.GetDesktopModuleByFriendlyName(Constants.DESKTOPMODULE_FRIENDLYNAME).DesktopModuleID;

            var objNotificationType = new NotificationType
            {
                Name            = Constants.NOTIFICATION_INVITATIONUSED,
                Description     = "Social Invites: Invitation Used",
                DesktopModuleId = deskModuleId
            };

            if (NotificationsController.Instance.GetNotificationType(objNotificationType.Name) == null)
            {
                var objAction = new NotificationTypeAction
                {
                    NameResourceKey        = "RequestFriend",
                    DescriptionResourceKey = "RequestFriend_Desc",
                    APICall = "DesktopModules/SocialInvite/API/Notification/friend",
                    Order   = 1
                };
                actions.Add(objAction);

                NotificationsController.Instance.CreateNotificationType(objNotificationType);
                NotificationsController.Instance.SetNotificationTypeActions(actions, objNotificationType.NotificationTypeId);
            }
        }