public DetailsChapter(Guid id)
        {
            var chapter = new Worker.Books.Chapter.Details(id);

            if (!chapter._isExist)
            {
                return;
            }

            this.DocumentId       = chapter.DocumentId;
            this.ParentDocumentId = chapter.ParentDocumentId;
            this.TimeStamp        = chapter.TimeStamp;

            this.Title      = chapter.Title;
            this.Priority   = chapter.Priority;
            this.IsChecked  = chapter.IsChecked;
            this.UpdateTime = chapter.UpdateTime;

            var i = new Worker.Books.Chapter.Index(parentDocumentId: id);

            if (i.List.Count() == 0)
            {
                this.IsNoChild = true;
            }

            this._isExist = true;
        }
        public MoveChapter(Guid documentId)
        {
            var b = new Worker.Books.Chapter.Details(documentId);

            this._isExist = b._isExist;
            if (!b._isExist)
            {
                return;
            }

            this.DocumentId = b.DocumentId;
            this.TimeStamp  = b.TimeStamp;
        }
        private void AddParent(Guid parentDocumentId, int level)
        {
            var chapter = new Worker.Books.Chapter.Details(parentDocumentId);

            if (chapter._isExist)
            {
                this.List.Add(new Item(chapter, level, false));
                this.AddParent(chapter.ParentDocumentId, level - 1);
            }
            else
            {
                var book = new Worker.Books.Book.Details(parentDocumentId);
                this.List.Add(new Item(book, level));
            }
        }
Exemplo n.º 4
0
        public Item(Worker.Books.Chapter.Details d)
        {
            if (!d._isExist)
            {
                return;
            }

            this.DocumentId = d.DocumentId;

            this.Title     = d.Title;
            this.Priority  = d.Priority;
            this.IsChecked = d.IsChecked;

            this._isExist = true;
        }
        public DirectoryChapter(Guid documentId)
        {
            this.List = new List <Item>();

            var chapter = new Worker.Books.Chapter.Details(documentId);

            if (!chapter._isExist)
            {
                return;
            }

            this.AddSilbingChapter(chapter.ParentDocumentId, documentId);

            this.AddParent(chapter.ParentDocumentId, -1);

            this.Solve();
        }
Exemplo n.º 6
0
        public Item(Worker.Books.Chapter.Details d, int level, bool isCurrentChapter)
        {
            if (!d._isExist)
            {
                return;
            }

            this.DocumentId       = d.DocumentId;
            this.Level            = level;
            this.IsCurrentChapter = isCurrentChapter;

            this.Title     = d.Title;
            this.Priority  = d.Priority;
            this.IsChecked = d.IsChecked;

            this._isExist = true;
        }
        public Worker.ValidateResult Save()
        {
            var currentDocument = new Worker.Books.Chapter.Details(this.CurrentDocumentId);

            var b = new Worker.Books.Chapter.Create
            {
                ParentDocumentId = currentDocument.ParentDocumentId,
                Title            = this.Title,
                Priority         = this.Priority,
                CurrentDocumentIdToSetFinished = this.CurrentDocumentIdToSetFinished,
            };

            var result = b.Save();

            if (result.Result)
            {
                this.DocumentId = b.DocumentId;
            }

            return(result);
        }
        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;
            }
        }
Exemplo n.º 9
0
        public EditChapter(Guid documentId)
        {
            var b = new Worker.Books.Chapter.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;
            }
        }