コード例 #1
0
        public IActionResult Create([FromBody] FieldPostModel fieldPostModel)
        {
            var field = fieldsService.Create(fieldPostModel);

            if (field == null)
            {
                return(BadRequest(new { ErrorMessage = "NameId and FieldNumber already exists." }));
            }
            return(Ok(field));
        }
コード例 #2
0
        public FieldsMappingRuleModel Create(int businessEntityTypeId, FieldsMappingRuleModel fieldsMappingRule)
        {
            var originField = _fieldsService.Create(businessEntityTypeId, fieldsMappingRule.OriginField);
            var sourceField = _fieldsService.Create(businessEntityTypeId, fieldsMappingRule.SourceField);

            var result = _repository.Create(new FieldsMappingRule
            {
                ConfigurationId = fieldsMappingRule.ConfigurationId,
                IsVisible       = true,
                OriginFieldId   = originField.Id,
                SourceFieldId   = sourceField.Id
            });

            return(new FieldsMappingRuleModel
            {
                Id = result.Id,
                ConfigurationId = result.ConfigurationId,
                IsVisible = result.IsVisible,
                OriginField = originField,
                SourceField = sourceField
            });
        }
コード例 #3
0
 public FieldModel Post([FromQuery] int businessEntityTypeId, [FromBody] FieldModel value)
 {
     return(_service.Create(businessEntityTypeId, value));
 }