Exemple #1
0
        public (bool condition, string message, MinutzDecision value) CreateMinutzDecision
            (string referenceId, MinutzDecision decision, AuthRestModel user)
        {
            if (decision.Id == Guid.Parse("e38b69b3-8f2a-4979-9323-1819db4331f8"))
            {
                decision.Id = Guid.NewGuid();
            }

            if (string.IsNullOrEmpty(referenceId))
            {
                throw new ArgumentNullException(nameof(referenceId), "Please provide a valid reference id.");
            }

            var instanceConnectionString = _applicationSetting.CreateConnectionString(_applicationSetting.Server,
                                                                                      _applicationSetting.Catalogue, user.InstanceId,
                                                                                      _applicationSetting.GetInstancePassword(user.InstanceId));

            var masterConnectionString = _applicationSetting.CreateConnectionString(_applicationSetting.Server,
                                                                                    _applicationSetting.Catalogue, _applicationSetting.Username, _applicationSetting.Password);
            var result = _decisionRepository.Add(decision, user.InstanceId, instanceConnectionString);

            return(result, result ? "Success" : "Failed", decision);
        }
Exemple #2
0
        public void Insert(DecisionViewModel model)
        {
            var contractType = AutoMapper.Mapper.Map <DecisionViewModel, Decision>(model);

            _repository.Add(contractType);
        }