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;
        }
        public IndexBook(Route route)
        {
            var b = new Worker.Books.Book.Index(page: route.Page, perpage: route.PerPage, titlePart: route.TitlePart, isChecked: route.IsChecked);

            this.Route       = route;
            this.Route.Count = b.Count;

            this.List = b.List.Select(c => new Item(c)).ToList();
        }
        public CreateBook(Guid parentDocumentId)
        {
            this.ParentDocumentId = parentDocumentId;

            var i = new Worker.Books.Book.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;
            }
        }
Example #4
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;
            }
        }
Example #5
0
        public IndexBookForShelf(Guid parentDocumentId)
        {
            var b = new Worker.Books.Book.Index(parentDocumentId: parentDocumentId, order: 1);

            this.List = b.List.Select(c => new Item(c)).ToList();
        }