Exemple #1
0
        public MessageResult UnbindNotification(int notificationId)
        {
            var notification = ReadNotificationProperties(notificationId);

            notification.WorkFlowId = null;
            NotificationRepository.UpdateProperties(notification);
            return(MessageResult.Info(NotificationStrings.UnbindedMessage));
        }
        public MessageResult PreAction(int fieldId)
        {
            if (HasAlreadyRun())
            {
                return(MessageResult.Info(MultistepActionStrings.ActionHasAlreadyRun));
            }

            return(!IsDefaultValueDefined(fieldId) ? MessageResult.Info(FieldStrings.DefaultValueIsNotDefined) : null);
        }
Exemple #3
0
        public static MessageResult EnableArticlePermissions(int id)
        {
            var content = ReadForUpdate(id);

            if (!content.AllowItemsPermission)
            {
                content.AllowItemsPermission = true;
                Update(content);
                return(MessageResult.Info(ContentStrings.ArticlePermissionsComplete));
            }

            return(null);
        }
Exemple #4
0
        public MessageResult PromotePageObject(int id)
        {
            var obj = ReadObjectProperties(id);

            if (obj.ParentObjectId.HasValue)
            {
                return(MessageResult.Info(TemplateStrings.UnableToPromote));
            }

            obj.PageId = null;
            UpdateObjectProperties(obj, null);
            return(MessageResult.Info(string.Format(TemplateStrings.ObjectPromoted, obj.Name)));
        }
Exemple #5
0
        public override MessageResult PreAction(int siteId, int contentId)
        {
            if (ContentRepository.IsAnyAggregatedFields(contentId))
            {
                return(MessageResult.Info(ContentStrings.OperationIsNotAllowedForAggregated));
            }

            if (ContentRepository.GetAggregatedContents(contentId).Any())
            {
                return(MessageResult.Info(ContentStrings.OperationIsNotAllowedForRoot));
            }

            return(base.PreAction(siteId, contentId));
        }
 internal static MessageResult RestoreObjectFormatVersion(int versionId)
 {
     try
     {
         using (var scope = new QPConnectionScope())
         {
             Common.RestoreObjectFormatVersion(scope.DbConnection, versionId);
         }
         return(MessageResult.Info(string.Format(TemplateStrings.VersionRestored, versionId)));
     }
     catch (Exception)
     {
         return(MessageResult.Info(string.Format(TemplateStrings.VersionRestoreError, versionId)));
     }
 }