private int?CreateDocumentTypeFolder(Item item, int parentId, int userId = 0) { var result = _contentTypeService.CreateContentTypeContainer(parentId, item.Name, userId); if (result.Success) { return(result.Result.Entity.Id); } else { return(null); } }
public int CreateFolder(string name) { var folder = _contentTypeService.GetContentTypeContainers(name, 1) .FirstOrDefault(); if (folder == null) { var attempt = _contentTypeService.CreateContentTypeContainer(-1, name); if (attempt.Success) { LogHelper.Info <ContentTypeBuilder>("Created Folder: {0} [{1}]", () => name, () => attempt.Result.Entity.Id); return(attempt.Result.Entity.Id); } else { LogHelper.Warn <ContentTypeBuilder>("Failed Created Folder: {0}", () => name); return(-1); } } LogHelper.Info <ContentTypeBuilder>("Found Existing: [{0}] {1}", () => folder.Id, () => folder.Name); return(folder.Id); }