protected override void ProcessMessage(IReceiverLink rec, Message msg)
        {
            var json     = Encoding.UTF8.GetString((byte[])msg.Body);
            var record   = JsonConvert.DeserializeObject <ChangeRecord <Solutions> >(json);
            var solution = record.NewVersion;

            // create SharePoint folder structure
            if (solution.Status == SolutionStatus.Registered)
            {
                _evidenceBlobStoreLogic.PrepareForSolution(solution.Id);
            }
        }
Exemplo n.º 2
0
        public void Update(Solutions solution)
        {
            _validator.ValidateAndThrowEx(solution, ruleSet: nameof(ISolutionsLogic.Update));

            _modifier.ForUpdate(solution);

            _datastore.Update(solution);

            // create SharePoint folder structure
            if (solution.Status == SolutionStatus.Registered)
            {
                _evidenceBlobStoreLogic.PrepareForSolution(solution.Id);
            }
        }
Exemplo n.º 3
0
 public IActionResult PrepareForSolution([FromRoute][Required] string solutionId)
 {
     try
     {
         _logic.PrepareForSolution(solutionId);
         return(new OkResult());
     }
     catch (FluentValidation.ValidationException ex)
     {
         return(new InternalServerErrorObjectResult(ex));
     }
     catch (KeyNotFoundException ex)
     {
         return(new NotFoundObjectResult(ex));
     }
 }
        public void Update(Solutions solution)
        {
            _validator.ValidateAndThrowEx(solution, ruleSet: nameof(ISolutionsLogic.Update));

            _modifier.ForUpdate(solution);

            var oldSoln = _datastore.ById(solution.Id);

            _datastore.Update(solution);

            var contact = _contacts.ByEmail(Context.Email());
            var record  = new ChangeRecord <Solutions>(contact.Id, oldSoln, solution);

            _notifier.Notify(record);

            // TODO   remove this code once we have activated SolutionChangeReceiver
            // create SharePoint folder structure
            if (solution.Status == SolutionStatus.Registered)
            {
                _evidenceBlobStoreLogic.PrepareForSolution(solution.Id);
            }
        }
        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);
            }
        }