public DirectoryBook(Guid documentId) { this.List = new List <Item>(); var book = new Worker.Books.Book.Details(documentId); if (!book._isExist) { return; } var chapters = new Worker.Books.Chapter.Index(parentDocumentId: documentId); this.AddChapter(chapters, 0); }
public CreateChapterSubLevel(Guid parentDocumentId) { this.ParentDocumentId = parentDocumentId; var i = new Worker.Books.Chapter.Index(parentDocumentId: parentDocumentId); if (i.List.Count > 0) { var max = i.List.Max(c => c.Priority); if (max.HasValue) { this.Priority = max.Value + 1; } } else { this.Priority = 1; } }
public CreateChapterSameLevel(Guid currentDocumentId) { this.CurrentDocumentId = currentDocumentId; var currentDocument = new Worker.Books.Chapter.Details(currentDocumentId); var i = new Worker.Books.Chapter.Index(parentDocumentId: currentDocument.ParentDocumentId); if (i.List.Count > 0) { var max = i.List.Max(c => c.Priority); if (max.HasValue) { this.Priority = max.Value + 1; } } else { this.Priority = 1; } }
public EditBook(Guid documentId) { var b = new Worker.Books.Book.Details(documentId); this._isExist = b._isExist; if (!b._isExist) { return; } this.DocumentId = b.DocumentId; this.TimeStamp = b.TimeStamp; this.Title = b.Title; this.Priority = b.Priority; this.IsChecked = b.IsChecked; var i = new Worker.Books.Chapter.Index(parentDocumentId: documentId); if (i.List.Count() == 0) { this.IsNoChild = true; } }
public IndexChapterForBook(Guid parentDocumentId) { var chapter = new Worker.Books.Chapter.Index(parentDocumentId: parentDocumentId); this.List = chapter.List.Select(c => new Item(c)).ToList(); }