예제 #1
0
        public IActionResult UpdateOtherDocument(int id, OtherDocumentEditViewModel viewModel)
        {
            _otherDocumentService.Save(viewModel.GetModel() /*
                                                             * Сюда нужно передать стратегию обновления, так как мы не знаем как именно данные запрашивались,
                                                             * судя по всему он будет храниться во viewModel и отдаваться клиенту и возвращаться, либо формировать основываясь на бизнес логике */);
            var updatedOtherDocument = _otherDocumentService.Get(id);

            return(Ok(updatedOtherDocument));
        }
예제 #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());
        }
예제 #3
0
        public IActionResult InsertOtherDocument(int id, OtherDocumentEditViewModel viewModel)
        {
            _otherDocumentService.Save(viewModel.GetModel());

            return(Ok());
        }