Example #1
0
        public AddResult NewFolder(int parentId, string text, string dbdata)
        {
            AddResult result = new AddResult();
            result.Success = true;
            result.Code = AddResult.StatusCode.Success;
            try
            {
                Node parent = Node.SelectById(parentId, this.GetAgent());
                Expect.IsNotNull(parent, "The specified parent node was not found: nodeid(" + parentId.ToString() + ")");
                parent.AddFolder(text, dbdata);
            }
            catch (NodeNameAlreadyExistsException nnaee)
            {
                result.Success = false;
                result.Code = AddResult.StatusCode.ItemExists;
                result.Message = nnaee.Message;
            }
            catch (Exception ex)
            {
                result.Success = false;
                result.Message = ex.Message;
            #if DEBUG
                result.Message += "\r\n" + ex.StackTrace;
            #endif
            }

            return result;
        }