Ejemplo n.º 1
0
        private void UpdateSubscriptions()
        {
            var objCtlEventSubscriptions = new EventSubscriptionController();
            var lstEventSubscriptions    = default(ArrayList);

            lstEventSubscriptions = objCtlEventSubscriptions.EventsSubscriptionGetModule(this.ModuleId);
            if (lstEventSubscriptions.Count == 0)
            {
                return;
            }

            var objEventInfo = new EventInfoHelper(this.ModuleId, this.TabId, this.PortalId, null);
            var lstusers     = objEventInfo.GetEventModuleViewers();

            var objEventSubscription = default(EventSubscriptionInfo);

            foreach (EventSubscriptionInfo tempLoopVar_objEventSubscription in lstEventSubscriptions)
            {
                objEventSubscription = tempLoopVar_objEventSubscription;
                if (!lstusers.Contains(objEventSubscription.UserID))
                {
                    var objCtlUser = new UserController();
                    var objUser    = objCtlUser.GetUser(this.PortalId, objEventSubscription.UserID);

                    if (ReferenceEquals(objUser, null) || !objUser.IsSuperUser)
                    {
                        objCtlEventSubscriptions.EventsSubscriptionDeleteUser(
                            objEventSubscription.UserID, this.ModuleId);
                    }
                }
            }
        }