Exemplo n.º 1
0
        /// <summary>
        /// Renames the content level node.
        /// </summary>
        /// <param name="contentLevelNodeId">The content level node id.</param>
        /// <param name="name">The name.</param>
        /// <returns></returns>
        public bool RenameContentLevelNode(int contentLevelNodeId, string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                return(false);
            }

            int num;

            try
            {
                using (IDataStoreContext dataStoreContext = this._DataStore.CreateContext())
                {
                    num = dataStoreContext.cms_ContentLevelNodes_Update(contentLevelNodeId, HttpUtility.HtmlEncode(name));
                }
            }
            catch (Exception ex)
            {
                _Log.Error("Error at cms_ContentLevelNodes_Update", ex);
                throw new DataStoreException(ex, true);
            }

            if (num != 0)
            {
                _Log.ErrorFormat("Conten level node {0} was not renamed to {2} (ErrorCode: {1})."
                                 , contentLevelNodeId
                                 , num
                                 , name);
                return(false);
            }

            return(true);
        }