public DetailsShelf(Guid id)
        {
            var shelf = new Worker.Books.Shelf.Details(id);

            if (!shelf._isExist)
            {
                return;
            }

            this.DocumentId = shelf.DocumentId;
            this.TimeStamp  = shelf.TimeStamp;

            this.Title      = shelf.Title;
            this.Priority   = shelf.Priority;
            this.UpdateTime = shelf.UpdateTime;

            var iBook  = new Worker.Books.Book.Index(parentDocumentId: id);
            var iShelf = new Worker.Books.Shelf.Index(parentDocumentId: id);

            if (iBook.List.Count() == 0 && iShelf.List.Count() == 0)
            {
                this.IsNoChild = true;
            }

            this._isExist = true;
        }
        private void AddPrioShelf(Worker.Books.Shelf.Details shelf)
        {
            this.List.Add(new Item(shelf));

            if (shelf.ParentDocumentId.HasValue)
            {
                this.AddPrioShelf(new Worker.Books.Shelf.Details(shelf.ParentDocumentId.Value));
            }
        }
Пример #3
0
        public Item(Worker.Books.Shelf.Details d)
        {
            if (!d._isExist)
            {
                return;
            }

            this.DocumentId = d.DocumentId;

            this.Title = d.Title;

            this._isExist = true;
        }
Пример #4
0
        public ListShelfForShelf(Guid documentId)
        {
            var shelf = new Worker.Books.Shelf.Details(documentId);

            this.List = new List <Item>();

            if (shelf.ParentDocumentId.HasValue)
            {
                this.AddPrioShelf(new Worker.Books.Shelf.Details(shelf.ParentDocumentId.Value));
            }

            this.List.Reverse();
        }
        public MoveShelf(Guid documentId)
        {
            var b = new Worker.Books.Shelf.Details(documentId);

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

            this.DocumentId = b.DocumentId;
            this.TimeStamp  = b.TimeStamp;
        }
Пример #6
0
        public Item(Worker.Books.Shelf.Details d)
        {
            if (!d._isExist)
            {
                return;
            }

            this.DocumentId = d.DocumentId;

            this.Title      = d.Title;
            this.Priority   = d.Priority;
            this.UpdateTime = d.UpdateTime;

            this._isExist = true;
        }
        public Item(Worker.Books.Book.Details d)
        {
            if (!d._isExist)
            {
                return;
            }

            var shelf = new Worker.Books.Shelf.Details(d.ParentDocumentId);

            if (!shelf._isExist)
            {
                return;
            }

            this.DocumentId = d.DocumentId;

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

            this.BookShelfName = shelf.Title;
            while (shelf.ParentDocumentId.HasValue)
            {
                shelf = new Worker.Books.Shelf.Details(shelf.ParentDocumentId.Value);

                if (!shelf._isExist)
                {
                    return;
                }

                this.BookShelfName = shelf.Title + ">>" + this.BookShelfName;
            }

            this._isExist = true;
        }
Пример #8
0
        public EditShelf(Guid documentId)
        {
            var b = new Worker.Books.Shelf.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;

            var iBook  = new Worker.Books.Book.Index(parentDocumentId: documentId);
            var iShelf = new Worker.Books.Shelf.Index(parentDocumentId: documentId);

            if (iBook.List.Count() == 0 && iShelf.List.Count() == 0)
            {
                this.IsNoChild = true;
            }
        }