Esempio n. 1
0
        public IReadOnlyCollection <OtherDocumentPayment> GetByOtherDocumentId(int otherDocumentId,
                                                                               OtherDocumentPaymentWorkItemStrategy otherDocumentPaymentWorkItemStrategy)
        {
            var spec = ToSpecification(otherDocumentPaymentWorkItemStrategy)
                       .And(new Specification <OtherDocumentPaymentDto>(w => w.OtherDocumentId == otherDocumentId));

            return(Repository.GetBySpecification(specification: spec).Select(w => w.Reconstitute()).ToList());
        }
Esempio n. 2
0
        public IActionResult OtherDocumentInfo(
            int id,
            bool attachments            = true,
            bool payments               = true,
            bool items                  = true,
            bool cacheResult            = true,
            bool deleted                = false,
            bool withNestedItems        = true,
            bool withOneMoreNestedItems = true
            )
        {
            var nestedItemWorkItemStrategy =
                new NestedItemWorkItemStrategy(withOneMoreNestedItems, deleted, cacheResult);
            var otherDocumentItemWorkItemStrategy =
                new OtherDocumentItemWorkItemStrategy(withNestedItems, nestedItemWorkItemStrategy, deleted,
                                                      cacheResult);
            var otherDocumentPaymentWorkItemStrategy = new OtherDocumentPaymentWorkItemStrategy(deleted, cacheResult);
            var strategy = new OtherDocumentWorkItemStrategy(deleted, attachments, payments, items, cacheResult,
                                                             otherDocumentItemWorkItemStrategy, otherDocumentPaymentWorkItemStrategy);

            var document = _otherDocumentService.Get(id, strategy);

            return(Ok(document));
        }