Пример #1
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            var contentPath = HttpContext.Current.Request["ContentPath"] ?? string.Empty;
            var userPath    = HttpContext.Current.Request["UserPath"] ?? string.Empty;
            var isActive    = HttpContext.Current.Request["IsActive"] ?? string.Empty;
            var node        = Node.LoadNode(contentPath);
            var user        = string.IsNullOrEmpty(userPath) ? User.Current as User : Node.Load <User>(userPath);

            if (string.IsNullOrEmpty(isActive) || node == null)
            {
                return;
            }

            if (isActive.ToLower().Equals("false"))
            {
                Subscription.ActivateSubscription(user, node);
            }
            else
            {
                Subscription.InactivateSubscription(user, node);
            }

            CallDone();
        }