Ejemplo n.º 1
0
        public MessageResult RemovePageTemplate(int id)
        {
            var template = PageTemplateRepository.GetPageTemplatePropertiesById(id);

            if (template == null)
            {
                throw new ApplicationException(string.Format(TemplateStrings.TemplateNotFound, id));
            }

            if (template.LockedByAnyoneElse)
            {
                return(MessageResult.Error(string.Format(TemplateStrings.LockedByAnyoneElse, template.LockedByDisplayName)));
            }

            ManagePageTemplateFolders(template, FolderManagingType.DeleteFolder);
            PageTemplateRepository.DeletePageTemplate(id);

            return(null);
        }