Ejemplo n.º 1
0
        public virtual IActionResult ApiPorcelainSolutionsExUpdatePut([FromBody] SolutionEx solnEx)
        {
            var solutionFrameworks = new List <Framework>();

            try
            {
                solutionFrameworks = _frameworksDatastore.BySolution(solnEx.Solution.Id.ToString()).ToList();
                _datastore.Update(solnEx);
            }
            catch (Crm.CrmApiException ex)
            {
                return(StatusCode((int)ex.HttpStatus, ex.Message));
            }
            finally
            {
                foreach (var solutionFramework in solutionFrameworks)
                {
                    _linkManagerDatastore.FrameworkSolutionAssociate(solutionFramework.Id, solnEx.Solution.Id);
                }
            }

            return(StatusCode(200, solnEx));
        }
        public void Update(SolutionEx solnEx)
        {
            _validator.ValidateAndThrowEx(solnEx, ruleSet: nameof(ISolutionsExLogic.Update));

            _solutionsModifier.ForUpdate(solnEx.Solution);

            solnEx.ClaimedCapability.ForEach(claim => _capabilitiesImplementedModifier.ForUpdate(claim));
            solnEx.ClaimedStandard.ForEach(claim => _standardsApplicableModifier.ForUpdate(claim));

            solnEx.ClaimedCapabilityEvidence.ForEach(evidence => _capabilitiesImplementedEvidenceModifier.ForUpdate(evidence));
            solnEx.ClaimedStandardEvidence.ForEach(evidence => _standardsApplicableEvidenceModifier.ForUpdate(evidence));

            solnEx.ClaimedCapabilityReview.ForEach(review => _capabilitiesImplementedReviewsModifier.ForUpdate(review));
            solnEx.ClaimedStandardReview.ForEach(review => _standardsApplicableReviewsModifier.ForUpdate(review));

            _datastore.Update(solnEx);

            // create SharePoint folder structure
            if (solnEx.Solution.Status == SolutionStatus.Registered)
            {
                _evidenceBlobStoreLogic.PrepareForSolution(solnEx.Solution.Id);
            }
        }