Пример #1
0
 private TreeNode CreateNewTreeNode(string folder, int? parentId, int libraryId, BXCModelEntities context)
 {
     var nodeRepo = new TreeNodeRepository(context);
         var libraryRepo = new LibraryRepository(context);
         var newNode = new TreeNode
                           {
                               Name = folder,
                               TreeNode1 =
                                   parentId == null
                                       ? null
                                       : nodeRepo.GetByID(parentId.Value),
                               Library = libraryRepo.GetByID(libraryId)
                           };
         nodeRepo.AddTreeNode(newNode);
         return newNode;
 }
Пример #2
0
        public TreeNode AddTreeNode(TreeNode nextNode, BXCModelEntities context = null)
        {
            context = context ?? new BXCModelEntities();
            try
            {

                var nodeRepo = new TreeNodeRepository(context);

                return nodeRepo.AddTreeNode(nextNode);
                                }

            catch (Exception ex)
            {
                Log.Error("CreateNode Failed", ex);
                return null;
            }
        }