Ejemplo n.º 1
0
        public IActionResult GetOtherDocuments(bool attachments = true, bool payments = true, bool items = true,
                                               bool deleted     = false)
        {
            var strategy  = new OtherDocumentWorkItemStrategy(deleted, attachments, payments, items);
            var documents = _otherDocumentService.Get(strategy);

            return(Ok(documents));
        }
Ejemplo n.º 2
0
        public IActionResult UpdateOtherDocument(int id)
        {
            var strategy = new OtherDocumentWorkItemStrategy(withDeleted: false, withAttachments: true, withPayments: false, withItems: true, cacheResult: false,
                                                             otherDocumentItemWorkItemStrategy: new OtherDocumentItemWorkItemStrategy(true, new NestedItemWorkItemStrategy()));

            var otherDocument = _otherDocumentService.Get(id, strategy);
            var viewModel     = new OtherDocumentEditViewModel(otherDocument);

            MakeUserEdit(ref viewModel);

            _otherDocumentService.Save(viewModel.GetModel(), strategy);

            return(Ok());
        }
Ejemplo n.º 3
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));
        }