public virtual IActionResult ApiSolutionsPut([FromBody] Solution solution)
        {
            try
            {
                _datastore.Update(solution);
            }
            catch (Crm.CrmApiException ex)
            {
                return(StatusCode((int)ex.HttpStatus, ex.Message));
            }

            return(StatusCode(200, solution));
        }
示例#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);
            }
        }
        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);
            }
        }