public async Task AddSolution(CustomProduct product, CustomProductAddSolutionDto solution)
        {
            product.PreparationCompletionDate = DateTime.Now;
            product.Status = CustomProductStatus.Prepared;
            product.SolutionDescription = solution.SolutionDescription;
            await _service.UploadSolutionFilesAsync(product.CustomProductId, solution.Files);

            _repository.CustomProduct.Update(product);
            await _repository.SaveAsync();
        }
Exemple #2
0
        public async Task <IActionResult> AddSolutionToCustomProduct(int technologistId, int productId, [FromForm] CustomProductAddSolutionDto solution)
        {
            var product = await _repository.CustomProduct.GetProductByIdAsync(productId);

            if (product == null)
            {
                return(NotFound());
            }

            await _customProductService.AddSolution(product, solution);

            return(NoContent());
        }